diff --git a/index.php b/index.php index f35aa9b98..26fe3baea 100644 --- a/index.php +++ b/index.php @@ -18,7 +18,7 @@ if (!ini_get('date.timezone')) { $grav = Grav::instance( [ 'Loader' => $loader, - 'Debugger' => new Debugger + 'Debugger' => new Debugger(Debugger::PRODUCTION) ] ); diff --git a/system/src/Grav/Common/Debugger.php b/system/src/Grav/Common/Debugger.php index 50f367856..a6e2c56d8 100644 --- a/system/src/Grav/Common/Debugger.php +++ b/system/src/Grav/Common/Debugger.php @@ -9,12 +9,15 @@ use \Tracy\Debugger as TracyDebugger; */ class Debugger { - public function __construct() + const PRODUCTION = TracyDebugger::PRODUCTION; + const DEVELOPMENT = TracyDebugger::DEVELOPMENT; + + public function __construct($mode = self::PRODUCTION) { // Start the timer and enable debugger in production mode as we do not have system configuration yet. // Debugger catches all errors and logs them, for example if the script doesn't have write permissions. TracyDebugger::timer(); - TracyDebugger::enable(TracyDebugger::DEVELOPMENT, is_dir(LOG_DIR) ? LOG_DIR : null); + TracyDebugger::enable($mode, is_dir(LOG_DIR) ? LOG_DIR : null); } public function init()