From 442556ed15423176faddc823cd120744d6b7beea Mon Sep 17 00:00:00 2001 From: Abel Hoogeveen Date: Fri, 1 Mar 2019 11:01:48 +0100 Subject: [PATCH] Implemented changes requested by FuzeWorks\Application. - Changed the enableDebugMode() method in Configurator. Now gets enabled when calling this method. Restricting this through detectDebugMode() is now optional. - Added multiple logs accross FuzeWorks. --- src/FuzeWorks/Configurator.php | 4 +++- src/FuzeWorks/Core.php | 5 +++-- src/Layout/layout.logger_http.php | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/FuzeWorks/Configurator.php b/src/FuzeWorks/Configurator.php index a3fd5e6..824c6cf 100644 --- a/src/FuzeWorks/Configurator.php +++ b/src/FuzeWorks/Configurator.php @@ -270,7 +270,7 @@ class Configurator public function enableDebugMode(): Configurator { $this->parameters['debugEnabled'] = true; - $this->parameters['debugMatch'] = (isset($this->parameters['debugMatch']) ? $this->parameters['debugMatch'] : false); + $this->parameters['debugMatch'] = (isset($this->parameters['debugMatch']) ? $this->parameters['debugMatch'] : true); return $this; } @@ -349,6 +349,7 @@ class Configurator // Then load the framework $container = Core::init(); + Logger::newLevel("Creating container..."); if ($debug == true) Logger::enable(); @@ -402,6 +403,7 @@ class Configurator } $container->initFactory(); + Logger::stopLevel(); return $container; } } \ No newline at end of file diff --git a/src/FuzeWorks/Core.php b/src/FuzeWorks/Core.php index 097bc99..f6a983e 100644 --- a/src/FuzeWorks/Core.php +++ b/src/FuzeWorks/Core.php @@ -109,16 +109,17 @@ class Core chdir(self::$cwd); // Log the shutdown - Logger::logInfo("Shutting FuzeWorks down gracefully"); + Logger::newLevel("Shutting FuzeWorks down gracefully"); // Fire the Shutdown event $event = Events::fireEvent('coreShutdownEvent'); - if ($event->isCancelled() === false) { Logger::shutdownError(); Logger::shutdown(); } + + Logger::stopLevel(); } /** diff --git a/src/Layout/layout.logger_http.php b/src/Layout/layout.logger_http.php index 38dea88..56a88fa 100644 --- a/src/Layout/layout.logger_http.php +++ b/src/Layout/layout.logger_http.php @@ -38,7 +38,7 @@ $layer = 0; foreach ($logs as $log) { if ($log['type'] == 'LEVEL_START') { ++$layer; - $color = 255 - ($layer * 25); + $color = 255 - ($layer * 20); $string .= '
'; $string .= '
' . $log['message'] . '' . (!empty($log['runtime']) ? '(' . round($log['runtime'] * 1000, 4) . 'ms)' : '') . '
'; } elseif ($log['type'] == 'LEVEL_STOP') {