Changed the location where Tracy is loaded.

By using the Configurator, Tracy will be loaded before FuzeWorks solving the issue.
This commit is contained in:
Abel Hoogeveen 2016-07-19 18:42:05 +02:00
parent 8aac7fc3bb
commit 099409bc1f
3 changed files with 9 additions and 24 deletions

View File

@ -32,6 +32,7 @@
namespace FuzeWorks;
use FuzeWorks\Exception\InvalidArgumentException;
use Tracy\Debugger;
/**
* Class Configurator.
@ -199,6 +200,13 @@ class Configurator
define('ENVIRONMENT', 'PRODUCTION');
}
// And enable Tracy Debugger
if (class_exists('Tracy\Debugger', true))
{
Debugger::enable(!$this->parameters['debugMode'], realpath($this->parameters['logDir']));
Logger::$useTracy = true;
}
// Then load the framework
Core::init();
}

View File

@ -142,29 +142,6 @@ 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();
}
/**
* Try to load Trace Debugger when available
*
* @return void
*/
public static function loadTracy()
{
if (class_exists('\Tracy\Debugger', true))
{
if (ENVIRONMENT === 'DEVELOPMENT')
{
Debugger::enable(Debugger::DEVELOPMENT, realpath(Core::$logDir));
}
else
{
Debugger::enable(Debugger::PRODUCTION, realpath(Core::$logDir));
}
self::$useTracy = true;
}
}
/**

View File

@ -518,7 +518,7 @@ class Output {
echo $output;
Logger::log('Final output sent to browser');
Logger::log('Output sent to browser');
Logger::logDebug('Total execution time: '.$elapsed);
}