From 7ce988fbd95c0d9b975e7647f2e4d7ee3d5e3aad Mon Sep 17 00:00:00 2001 From: Joey Kimsey Date: Sat, 10 Aug 2024 14:58:57 -0400 Subject: [PATCH] improve line limit and add config for it --- Bin/Canary.php | 2 +- Config/constants.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Bin/Canary.php b/Bin/Canary.php index 85c6c07..95e59b3 100644 --- a/Bin/Canary.php +++ b/Bin/Canary.php @@ -226,7 +226,7 @@ class Canary { if ( ! CANARY_ENABLED ) { return; } - if ( strlen( self::$debugLog ) > 50000 ) { + if ( strlen( self::$debugLog ) > CANARY_DEBUG_LOG_LIMIT ) { self::$tempusLogger->addLog( 'log', 'Error log too large, possible loop.' ); return; } diff --git a/Config/constants.php b/Config/constants.php index 6ed83aa..b57dbb7 100644 --- a/Config/constants.php +++ b/Config/constants.php @@ -48,6 +48,9 @@ if ( ! defined( 'CANARY_SHOW_LINES' ) ) { if ( ! defined('CANARY_DEBUG_TO_CONSOLE' ) ) { define( 'CANARY_DEBUG_TO_CONSOLE', false ); } +if ( ! defined('CANARY_DEBUG_LOG_LIMIT' ) ) { + define( 'CANARY_DEBUG_LOG_LIMIT', 500000 ); +} # Tell the app all constants have been loaded. if ( ! defined('CANARY_CONSTANTS_LOADED' ) ) {