@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | |
17 | 17 | |
18 | 18 | if (!defined('LOG_DIR')) { |
19 | - GeneratorHelper::createDir(BASE_DIR . DIRECTORY_SEPARATOR . 'logs'); |
|
20 | - define('LOG_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'logs'); |
|
19 | + GeneratorHelper::createDir(BASE_DIR.DIRECTORY_SEPARATOR.'logs'); |
|
20 | + define('LOG_DIR', BASE_DIR.DIRECTORY_SEPARATOR.'logs'); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $config = Config::getInstance(); |
56 | 56 | $args = func_get_args(); |
57 | 57 | list($logger, $debug, $path) = $this->setup($config, $args); |
58 | - $this->stream = fopen($path . DIRECTORY_SEPARATOR . date('Ymd') . '.log', 'a+'); |
|
58 | + $this->stream = fopen($path.DIRECTORY_SEPARATOR.date('Ymd').'.log', 'a+'); |
|
59 | 59 | $this->addPushLogger($logger, $debug, $config); |
60 | 60 | $this->log_level = Config::getParam('log.level', 'info'); |
61 | 61 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | private function createLoggerPath(Config $config) |
143 | 143 | { |
144 | 144 | $logger = $this->setLoggerName($config); |
145 | - $path = LOG_DIR . DIRECTORY_SEPARATOR . $logger . DIRECTORY_SEPARATOR . date('Y') . DIRECTORY_SEPARATOR . date('m'); |
|
145 | + $path = LOG_DIR.DIRECTORY_SEPARATOR.$logger.DIRECTORY_SEPARATOR.date('Y').DIRECTORY_SEPARATOR.date('m'); |
|
146 | 146 | GeneratorHelper::createDir($path); |
147 | 147 | |
148 | 148 | return $path; |
@@ -165,10 +165,10 @@ discard block |
||
165 | 165 | */ |
166 | 166 | public static function log($msg, $type = LOG_DEBUG, array $context = null) |
167 | 167 | { |
168 | - if(null === $context) { |
|
168 | + if (null === $context) { |
|
169 | 169 | $context = []; |
170 | 170 | } |
171 | - if(Config::getParam('profiling.enable')) { |
|
171 | + if (Config::getParam('profiling.enable')) { |
|
172 | 172 | Inspector::stats($msg); |
173 | 173 | } |
174 | 174 | switch ($type) { |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | self::getInstance()->addLog($msg, \Monolog\Logger::WARNING, $context); |
180 | 180 | break; |
181 | 181 | case LOG_CRIT: |
182 | - if(Config::getParam('log.slack.hook')) { |
|
182 | + if (Config::getParam('log.slack.hook')) { |
|
183 | 183 | SlackHelper::getInstance()->trace($msg, '', '', $context); |
184 | 184 | } |
185 | 185 | self::getInstance()->addLog($msg, \Monolog\Logger::CRITICAL, $context); |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | { |
223 | 223 | $context['uri'] = null !== $_SERVER && array_key_exists('REQUEST_URI', $_SERVER) ? $_SERVER['REQUEST_URI'] : 'Unknow'; |
224 | 224 | $context['method'] = null !== $_SERVER && array_key_exists('REQUEST_METHOD', $_SERVER) ? $_SERVER['REQUEST_METHOD'] : 'Unknow'; |
225 | - if(null !== $_SERVER && array_key_exists('HTTP_X_PSFS_UID', $_SERVER)) { |
|
225 | + if (null !== $_SERVER && array_key_exists('HTTP_X_PSFS_UID', $_SERVER)) { |
|
226 | 226 | $context['uid'] = $_SERVER['HTTP_X_PSFS_UID']; |
227 | 227 | } |
228 | 228 | return $context; |