1 | <?php |
||
12 | class ElasticaLogger implements LoggerInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var LoggerInterface |
||
16 | */ |
||
17 | protected $logger; |
||
18 | |||
19 | /** |
||
20 | * @var array |
||
21 | */ |
||
22 | protected $queries = array(); |
||
23 | |||
24 | /** |
||
25 | * @var boolean |
||
26 | */ |
||
27 | protected $debug; |
||
28 | |||
29 | /** |
||
30 | * Constructor. |
||
31 | * |
||
32 | * @param LoggerInterface|null $logger The Symfony logger |
||
33 | * @param boolean $debug |
||
34 | */ |
||
35 | 26 | public function __construct(LoggerInterface $logger = null, $debug = false) |
|
40 | |||
41 | /** |
||
42 | * Returns the number of queries that have been logged. |
||
43 | * |
||
44 | * @return integer The number of queries logged |
||
45 | */ |
||
46 | 4 | public function getNbQueries() |
|
50 | |||
51 | /** |
||
52 | * Returns a human-readable array of queries logged. |
||
53 | * |
||
54 | * @return array An array of queries |
||
55 | */ |
||
56 | 2 | public function getQueries() |
|
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | 5 | public function debug($message, array $context = array()) |
|
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | 2 | public function emergency($message, array $context = array()) |
|
84 | |||
85 | /** |
||
86 | * {@inheritdoc} |
||
87 | */ |
||
88 | 2 | public function alert($message, array $context = array()) |
|
94 | |||
95 | /** |
||
96 | * {@inheritdoc} |
||
97 | */ |
||
98 | 2 | public function critical($message, array $context = array()) |
|
104 | |||
105 | /** |
||
106 | * {@inheritdoc} |
||
107 | */ |
||
108 | 2 | public function error($message, array $context = array()) |
|
114 | |||
115 | /** |
||
116 | * {@inheritdoc} |
||
117 | */ |
||
118 | 2 | public function warning($message, array $context = array()) |
|
124 | |||
125 | /** |
||
126 | * {@inheritdoc} |
||
127 | */ |
||
128 | 2 | public function notice($message, array $context = array()) |
|
134 | |||
135 | /** |
||
136 | * {@inheritdoc} |
||
137 | */ |
||
138 | 2 | public function info($message, array $context = array()) |
|
144 | |||
145 | /** |
||
146 | * {@inheritdoc} |
||
147 | */ |
||
148 | 2 | public function log($level, $message, array $context = array()) |
|
154 | } |
||
155 |