1 | <?php namespace GameScan\Core\Tools; |
||
7 | class Log |
||
8 | { |
||
9 | const LOG_NAME = "GAME-SCAN"; |
||
10 | private $log = null; |
||
11 | private $handlers = array(); |
||
12 | private $prefix = null; |
||
13 | private $formatter = null; |
||
14 | private $outputFormat = "[%datetime%] [%channel%] [%level_name%] %message% %context% %extra%\n"; |
||
15 | private $dateFormat = "Y-m-d H:i:s"; |
||
16 | private $path = "/tmp/gameScan.log"; |
||
17 | private $logLevel = 200; |
||
18 | private $processor = null; |
||
19 | private $availablesConfigs = [ |
||
20 | "outputFormat", |
||
21 | "dateFormat", |
||
22 | "path", |
||
23 | "logLevel" |
||
24 | ]; |
||
25 | |||
26 | |||
27 | 2 | public function __construct(\Monolog\Handler\AbstractHandler $handler = null, $formatter = null, $processor = null, array $config = array()) |
|
35 | |||
36 | 2 | private function loadConfig($config) |
|
44 | |||
45 | 2 | private function initializeFormatter($formatter) |
|
55 | |||
56 | 2 | private function initializeProcessor($processor) |
|
60 | |||
61 | 2 | private function initializeLoger() |
|
67 | |||
68 | public function addHandler(\Monolog\Handler\AbstractHandler $handler) |
||
73 | |||
74 | |||
75 | public function setHandler(\Monolog\Handler\AbstractHandler $handler) |
||
91 | |||
92 | |||
93 | public function info($message) |
||
99 | |||
100 | |||
101 | public function debug($message) |
||
107 | |||
108 | |||
109 | public function warning($message) |
||
115 | |||
116 | |||
117 | 2 | public function error($message) |
|
123 | |||
124 | |||
125 | public function critical($message) |
||
131 | |||
132 | |||
133 | public function emergency($message) |
||
139 | |||
140 | 2 | private function formatMessage($message) |
|
144 | |||
145 | public function setPrefix($prefix) |
||
149 | } |
||
150 |