diff --git a/components/Logger.php b/components/Logger.php index a8213db..3eb8f4e 100644 --- a/components/Logger.php +++ b/components/Logger.php @@ -25,8 +25,8 @@ class Logger extends \yii\log\Logger { public static $styles = [ - Logger::LEVEL_WARNING => Console::FG_YELLOW, - Logger::LEVEL_ERROR => Console::FG_RED, + Logger::LEVEL_WARNING => [Console::FG_YELLOW], + Logger::LEVEL_ERROR => [Console::FG_RED], ]; /** @@ -35,7 +35,10 @@ class Logger extends \yii\log\Logger public function log($message, $level, $category = 'application') { if ($level <= static::LEVEL_TRACE) { - //d(Console::ansiFormat($message, Console::FG_YELLOW)); + $style = self::$styles[$level]; + if ($style) { + $message = Console::ansiFormat($message, $style); + } Console::stdout($message."\n"); } parent::log($message, $level, $category); diff --git a/handlers/Base.php b/handlers/Base.php index 356cdd2..7fe72ec 100644 --- a/handlers/Base.php +++ b/handlers/Base.php @@ -100,7 +100,7 @@ public function parsePath($path) */ protected function write($path, $content) { - Yii::info('Written file: ' . $path,'file'); + Yii::warning('Written file: ' . $path,'file'); file_put_contents($path, $content); }