Logger is now fully functional.

This commit is contained in:
Abel Hoogeveen 2016-07-09 13:00:56 +02:00
parent 7a3bd64fb5
commit 729ccac707
2 changed files with 7 additions and 4 deletions

View File

@ -139,6 +139,8 @@ class Logger {
self::$log_to_file = Config::get('error')->log_to_file;
self::$logger_template = Config::get('error')->logger_template;
self::newLevel('Logger Initiated');
self::loadTracy();
}
/**
@ -146,17 +148,17 @@ class Logger {
*
* @return void
*/
public static function loadComposer()
public static function loadTracy()
{
if (class_exists('\Tracy\Debugger', true))
{
if (ENVIRONMENT === 'DEVELOPMENT')
{
Debugger::enable(Debugger::DEVELOPMENT, realpath(Core::$appDir . DS . 'Logs'));
Debugger::enable(Debugger::DEVELOPMENT, realpath(Core::$logDir));
}
else
{
Debugger::enable(Debugger::PRODUCTION, realpath(Core::$appDir . DS . 'Logs'));
Debugger::enable(Debugger::PRODUCTION, realpath(Core::$logDir));
}
self::$useTracy = true;
}
@ -287,7 +289,7 @@ class Logger {
Layout::reset();
Layout::assign('Logs', self::$Logs);
$contents = Layout::get('logger_cli', Core::$coreDir . DS . 'Views');
$file = Core::$appDir . 'Logs'.DS.'log_latest.php';
$file = Core::$logDir .DS. 'Logs'.DS.'log_latest.php';
if (is_writable($file))
{
file_put_contents($file, '<?php ' . $contents);

View File

@ -13,6 +13,7 @@ $configurator->setParameters($parameters);
$configurator->setTimeZone('Europe/Amsterdam');
$configurator->setTempDirectory(__DIR__ . '/temp');
$configurator->setLogDirectory(__DIR__ . '/temp');
$container = $configurator->createContainer();