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.
This commit is contained in:
Abel Hoogeveen 2019-03-01 11:01:48 +01:00
parent 53e721f781
commit 442556ed15
No known key found for this signature in database
GPG Key ID: 96C2234920BF4292
3 changed files with 7 additions and 4 deletions

View File

@ -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;
}
}

View File

@ -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();
}
/**

View File

@ -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 .= '<div style="background: rgb(188 , 232 ,' . $color . ');border: 1px black solid;margin: 5px 0;padding: 5px 20px;">';
$string .= '<div style="font-weight: bold; font-size: 11pt;">' . $log['message'] . '<span style="float: right">' . (!empty($log['runtime']) ? '(' . round($log['runtime'] * 1000, 4) . 'ms)' : '') . '</span></div>';
} elseif ($log['type'] == 'LEVEL_STOP') {