mirror of
https://github.com/getgrav/grav.git
synced 2026-05-06 12:06:40 +02:00
Add DEV/PROD parameter to debugger constructor
This commit is contained in:
@@ -18,7 +18,7 @@ if (!ini_get('date.timezone')) {
|
||||
$grav = Grav::instance(
|
||||
[
|
||||
'Loader' => $loader,
|
||||
'Debugger' => new Debugger
|
||||
'Debugger' => new Debugger(Debugger::PRODUCTION)
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user