1
2
3
4
5
6
7
8
9
10
11 package psiprobe.tools.logging.commons;
12
13 import java.util.ArrayList;
14 import java.util.List;
15
16 import psiprobe.tools.logging.LogDestination;
17 import psiprobe.tools.logging.jdk.Jdk14LoggerAccessor;
18 import psiprobe.tools.logging.log4j.Log4JLoggerAccessor;
19
20
21
22
23 public class GetAllDestinationsVisitor extends AbstractLoggerAccessorVisitor {
24
25
26 private final List<LogDestination> destinations = new ArrayList<>();
27
28
29
30
31
32
33 public List<LogDestination> getDestinations() {
34 return destinations;
35 }
36
37 @Override
38 public void visit(Log4JLoggerAccessor accessor) {
39 destinations.addAll(accessor.getAppenders());
40 }
41
42 @Override
43 public void visit(Jdk14LoggerAccessor accessor) {
44 destinations.addAll(accessor.getHandlers());
45 }
46
47 }