Skip to content

Commit dd969e2

Browse files
jonocodesShadow243
authored andcommitted
Introduce DEBUG_LOG env var
1 parent aded248 commit dd969e2

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed

config/app.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,8 @@
781781
// */
782782
// 'developer',
783783

784+
'debug_log' => env('DEBUG_LOG', false),
785+
784786
// /*
785787
// | -------
786788
// | Github

index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
new Hm_Dispatch($config);
5555

5656
/* log some debug stats about the page */
57-
if (DEBUG_MODE) {
57+
if (DEBUG_MODE or $config->get('debug_log')) {
5858
Hm_Debug::load_page_stats();
5959
Hm_Debug::show();
6060
}

lib/module.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ public function __construct($parent, $page, $output = [], $protected = []) {
347347
* @return string
348348
*/
349349
private function invalid_ajax_key() {
350-
if (DEBUG_MODE) {
350+
if (DEBUG_MODE or $this->config->get('debug_log')) {
351351
Hm_Debug::add('REQUEST KEY check failed');
352352
Hm_Debug::load_page_stats();
353353
Hm_Debug::show();

lib/modules_exec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public function __construct($config) {
234234
* @return void
235235
*/
236236
public function process_module_setup() {
237-
if (DEBUG_MODE) {
237+
if (DEBUG_MODE or $site_config->get('debug_log')) {
238238
$this->setup_debug_modules();
239239
}
240240
else {

lib/output.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public static function load_page_stats() {
172172
* @return boolean|null
173173
*/
174174
function elog($mixed) {
175-
if (DEBUG_MODE) {
175+
if (DEBUG_MODE or env('DEBUG_LOG', false)) {
176176
$bt = debug_backtrace();
177177
$caller = array_shift($bt);
178178
Hm_Debug::add(sprintf('ELOG called in %s at line %d', $caller['file'], $caller['line']));

0 commit comments

Comments
 (0)