-
Notifications
You must be signed in to change notification settings - Fork 86
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
Bind Moodle $CFG->debug to $loggingenabled #141
Conversation
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?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @nadavkav
You just need to remove all spaces in line 69 and 74 because of Moodle coding style.
classes/log/store.php
Outdated
@@ -65,10 +65,16 @@ class store extends php_obj implements log_writer { | |||
* @param log_manager $manager | |||
*/ | |||
public function __construct(log_manager $manager) { | |||
global $CFG; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove all white spaces (Moodle coding style)
classes/log/store.php
Outdated
$this->helper_setup($manager); | ||
$this->logguests = $this->get_config('logguests', 1); | ||
$routes = $this->get_config('routes', ''); | ||
$this->routes = $routes === '' ? [] : explode(',', $routes); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove all white spaces (Moodle coding style)
I removed the lines completely. |
$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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might have used &&
instead of and
to protect against future changes, since some people don't understand there's a slight difference in precedence between the two. Not too worried about that though, just something to be aware of 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I Agree, just used an old piece of code from another plugin I have.
Better fix it, at some point.
Thanks for your suggestion here @Nicosoft 👍 |
BTW, was also thinking the logs should go to the standard php os level logs. here: |
Hey @nadavkav, yeah that would be awesome 👍 |
Description
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?)
Related Issues
none
PR Type