1 | <?php |
||
34 | class Logger extends ObjectAbstract implements LoggerInterface, LogEntryPrototypeInterface |
||
35 | { |
||
36 | use LoggerTrait, LogEntryPrototypeTrait, ExtendedLoggerTrait; |
||
37 | |||
38 | /** |
||
39 | * Must set current channel name EACH TIME! |
||
40 | * |
||
41 | * @param string $channel |
||
42 | * @return $this |
||
43 | * @access public |
||
44 | * @api |
||
45 | */ |
||
46 | public function __invoke(/*# string */ $channel) |
||
50 | |||
51 | /** |
||
52 | * Logs with an arbitrary level. |
||
53 | * |
||
54 | * @param mixed $level |
||
55 | * @param string $message |
||
56 | * @param array $context |
||
57 | * @return null |
||
58 | */ |
||
59 | public function log($level, $message, array $context = array()) |
||
78 | |||
79 | /** |
||
80 | * Add handler to the channel with priority |
||
81 | * |
||
82 | * if $channel == '', use current logger channel |
||
83 | * |
||
84 | * @param callable $handler |
||
85 | * @param string $channel channel to listen to |
||
86 | * @param int $priority |
||
87 | * @return $this |
||
88 | * @access public |
||
89 | * @api |
||
90 | */ |
||
91 | public function addHandler( |
||
98 | |||
99 | /** |
||
100 | * Remove this handler from the channel |
||
101 | * |
||
102 | * if $channel == '', then remove this handler from all channels |
||
103 | * |
||
104 | * @param callable $handler |
||
105 | * @param string $channel |
||
106 | * @return $this |
||
107 | * @access public |
||
108 | * @api |
||
109 | */ |
||
110 | public function removeHandler(callable $handler, $channel = '') |
||
114 | |||
115 | /** |
||
116 | * Add processor to the channel with priority |
||
117 | * |
||
118 | * if $channel == '', use current logger channel |
||
119 | * |
||
120 | * @param callable $processor |
||
121 | * @param string $channel channel to listen to |
||
122 | * @param int $priority |
||
123 | * @return $this |
||
124 | * @access public |
||
125 | * @api |
||
126 | */ |
||
127 | public function addProcessor( |
||
134 | |||
135 | /** |
||
136 | * Remove this $processor from $channel |
||
137 | * |
||
138 | * if $channel == '', then remove processor from all channels |
||
139 | * |
||
140 | * @param callable $processor |
||
141 | * @param string $channel |
||
142 | * @return $this |
||
143 | * @access public |
||
144 | * @api |
||
145 | */ |
||
146 | public function removeProcessor(callable $processor, $channel = '') |
||
150 | } |
||
151 |