1 | <?php |
||
26 | class Logger implements LoggerInterface, HandlerAwareInterface |
||
27 | { |
||
28 | use LoggerTrait; |
||
29 | use HandlerAwareTrait; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $channel; |
||
35 | |||
36 | /** |
||
37 | * Channel usually is APP ID |
||
38 | * |
||
39 | * @param string $channel |
||
40 | */ |
||
41 | public function __construct(string $channel) |
||
45 | |||
46 | /** |
||
47 | * {@inheritDoc} |
||
48 | */ |
||
49 | public function log($level, $message, array $context = array()) |
||
57 | |||
58 | /** |
||
59 | * @param LogEntryInterface|string $message |
||
60 | * @param string $level |
||
61 | * @param array $context |
||
62 | * @return LogEntryInterface |
||
63 | * @throws \InvalidArgumentException if message not right |
||
64 | */ |
||
65 | protected function initEntry($message, string $level, array $context): LogEntryInterface |
||
76 | |||
77 | /** |
||
78 | * @param $message |
||
79 | * @return LogEntryInterface |
||
80 | * @throws \InvalidArgumentException if message not right |
||
81 | */ |
||
82 | protected function validate($message): LogEntryInterface |
||
93 | |||
94 | /** |
||
95 | * Set channel name in context |
||
96 | * |
||
97 | * @param array &$context |
||
98 | */ |
||
99 | protected function setChannel(array &$context) |
||
105 | } |