Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce DEBUG_LOG env var #1039

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,8 @@
// */
// 'developer',

'debug_log' => env('DEBUG_LOG', false),

// /*
// | -------
// | Github
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
new Hm_Dispatch($config);

/* log some debug stats about the page */
if (DEBUG_MODE) {
if (DEBUG_MODE or $config->get('debug_log')) {
Hm_Debug::load_page_stats();
Hm_Debug::show();
}
2 changes: 1 addition & 1 deletion lib/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ public function __construct($parent, $page, $output = [], $protected = []) {
* @return string
*/
private function invalid_ajax_key() {
if (DEBUG_MODE) {
if (DEBUG_MODE or $this->config->get('debug_log')) {
Hm_Debug::add('REQUEST KEY check failed');
Hm_Debug::load_page_stats();
Hm_Debug::show();
Expand Down
2 changes: 1 addition & 1 deletion lib/modules_exec.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public function __construct($config) {
* @return void
*/
public function process_module_setup() {
if (DEBUG_MODE) {
if (DEBUG_MODE or $this->site_config->get('debug_log')) {
$this->setup_debug_modules();
}
else {
Expand Down
2 changes: 1 addition & 1 deletion lib/output.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public static function load_page_stats() {
* @return boolean|null
*/
function elog($mixed) {
if (DEBUG_MODE) {
if (DEBUG_MODE or env('DEBUG_LOG', false)) {
$bt = debug_backtrace();
$caller = array_shift($bt);
Hm_Debug::add(sprintf('ELOG called in %s at line %d', $caller['file'], $caller['line']));
Expand Down