1 | <?php |
||
38 | class Logger extends ObjectAbstract implements LoggerInterface, LogEntryPrototypeInterface |
||
39 | { |
||
40 | use LoggerTrait, LogEntryPrototypeTrait, ExtendedLoggerTrait; |
||
41 | |||
42 | /** |
||
43 | * Instantiate with default channel name and log entry prototype |
||
44 | * |
||
45 | * @param string $channel default channel |
||
46 | * @param LogEntryInterface $entryPrototype if any |
||
47 | * @access protected |
||
48 | */ |
||
49 | public function __construct( |
||
56 | |||
57 | /** |
||
58 | * Set/With current channel, followed by any log() method |
||
59 | * |
||
60 | * @param string $channel current channel |
||
61 | * @return $this |
||
62 | * @access protected |
||
63 | */ |
||
64 | public function with(/*# string */ $channel) |
||
69 | |||
70 | /** |
||
71 | * Logs with an arbitrary level. |
||
72 | * |
||
73 | * @param mixed $level |
||
74 | * @param string $message |
||
75 | * @param array $context |
||
76 | * @return null |
||
77 | */ |
||
78 | public function log($level, $message, array $context = array()) |
||
94 | |||
95 | /** |
||
96 | * Add handler to the channel with priority |
||
97 | * |
||
98 | * @param callable $handler |
||
99 | * @param string $channel channel to listen to |
||
100 | * @param int $priority |
||
101 | * @return $this |
||
102 | * @access public |
||
103 | * @api |
||
104 | */ |
||
105 | public function addHandler( |
||
112 | |||
113 | /** |
||
114 | * Remove this handler from the channel |
||
115 | * |
||
116 | * if $channel == '', then remove this handler from all channels |
||
117 | * |
||
118 | * @param callable|string $handlerOrClassname |
||
119 | * @param string $channel |
||
120 | * @return $this |
||
121 | * @access public |
||
122 | * @api |
||
123 | */ |
||
124 | public function removeHandler($handlerOrClassname, $channel = '') |
||
128 | |||
129 | /** |
||
130 | * Add processor to the channel with priority |
||
131 | * |
||
132 | * @param callable $processor |
||
133 | * @param string $channel channel to listen to |
||
134 | * @param int $priority |
||
135 | * @return $this |
||
136 | * @access public |
||
137 | * @api |
||
138 | */ |
||
139 | public function addProcessor( |
||
146 | |||
147 | /** |
||
148 | * Remove this $processor from $channel |
||
149 | * |
||
150 | * if $channel == '', then remove processor from all channels |
||
151 | * |
||
152 | * @param callable|string $processorOrClassname |
||
153 | * @param string $channel |
||
154 | * @return $this |
||
155 | * @access public |
||
156 | * @api |
||
157 | */ |
||
158 | public function removeProcessor($processorOrClassname, $channel = '') |
||
164 | } |
||
165 |