From 4f9aed1e1c746d5b0399f286f65d88749faf675a Mon Sep 17 00:00:00 2001 From: Nadav Kavalerchik Date: Thu, 5 Oct 2017 20:07:33 +0300 Subject: [PATCH 1/3] Bind Moodle $CFG->debug to $loggingenabled Turn on xapi_logstore file debugging when Moodle debugging is turned on. (maybe this should go into os level standard logs as well, so it not bloating inside the folder?) --- classes/log/store.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/classes/log/store.php b/classes/log/store.php index 039b55cf4..14ca640f2 100644 --- a/classes/log/store.php +++ b/classes/log/store.php @@ -65,10 +65,16 @@ class store extends php_obj implements log_writer { * @param log_manager $manager */ public function __construct(log_manager $manager) { + global $CFG; + $this->helper_setup($manager); $this->logguests = $this->get_config('logguests', 1); $routes = $this->get_config('routes', ''); $this->routes = $routes === '' ? [] : explode(',', $routes); + + if (!empty($CFG->debug) and $CFG->debug >= DEBUG_DEVELOPER) { + $this->loggingenabled = true; + } } /** From 4a38b2873d4df2985df49096dfb6574f0cf179af Mon Sep 17 00:00:00 2001 From: Nadav Kavalerchik Date: Fri, 6 Oct 2017 01:44:27 +0300 Subject: [PATCH 2/3] Update store.php --- classes/log/store.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/log/store.php b/classes/log/store.php index 14ca640f2..7d34530cd 100644 --- a/classes/log/store.php +++ b/classes/log/store.php @@ -66,12 +66,12 @@ class store extends php_obj implements log_writer { */ public function __construct(log_manager $manager) { global $CFG; - + $this->helper_setup($manager); $this->logguests = $this->get_config('logguests', 1); $routes = $this->get_config('routes', ''); $this->routes = $routes === '' ? [] : explode(',', $routes); - + if (!empty($CFG->debug) and $CFG->debug >= DEBUG_DEVELOPER) { $this->loggingenabled = true; } From f2a833885789ae398b5d2eafb8418f2e38f017dc Mon Sep 17 00:00:00 2001 From: Nadav Kavalerchik Date: Fri, 6 Oct 2017 01:44:50 +0300 Subject: [PATCH 3/3] Update store.php --- classes/log/store.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/classes/log/store.php b/classes/log/store.php index 7d34530cd..7d2630cc8 100644 --- a/classes/log/store.php +++ b/classes/log/store.php @@ -66,12 +66,10 @@ class store extends php_obj implements log_writer { */ public function __construct(log_manager $manager) { global $CFG; - $this->helper_setup($manager); $this->logguests = $this->get_config('logguests', 1); $routes = $this->get_config('routes', ''); $this->routes = $routes === '' ? [] : explode(',', $routes); - if (!empty($CFG->debug) and $CFG->debug >= DEBUG_DEVELOPER) { $this->loggingenabled = true; }