1 | <?php |
||
5 | class Journal implements \Psr\Log\LoggerInterface |
||
6 | { |
||
7 | use \Psr\Log\LoggerTrait; |
||
8 | |||
9 | protected $journalFolder; |
||
10 | protected $journalRecord; |
||
11 | |||
12 | /** |
||
13 | * @param string $folder |
||
14 | * @param array $record |
||
15 | */ |
||
16 | 59 | public function __construct($folder = __DIR__, array $record = ['emergency', 'alert', 'critical', 'error']) |
|
21 | |||
22 | |||
23 | /** |
||
24 | * @param mixed $level |
||
25 | * @param string $message |
||
26 | * @param array $context |
||
27 | * |
||
28 | * @return null |
||
29 | */ |
||
30 | 1 | public function log($level, $message, array $context = array()) |
|
48 | |||
49 | /** |
||
50 | * @var array |
||
51 | */ |
||
52 | protected $levelToPoints |
||
53 | = [ |
||
54 | 'emergency' => 0, |
||
55 | 'alert' => 1, |
||
56 | 'critical' => 2, |
||
57 | 'error' => 3, |
||
58 | 'warning' => 4, |
||
59 | 'notice' => 5, |
||
60 | 'info' => 6, |
||
61 | 'debug' => 7, |
||
62 | ]; |
||
63 | |||
64 | /** |
||
65 | * @return string |
||
66 | */ |
||
67 | 1 | protected function getCurrentDate() |
|
76 | |||
77 | /** |
||
78 | * @return string |
||
79 | */ |
||
80 | 1 | protected function getJournalPath() |
|
84 | |||
85 | } |