-
Notifications
You must be signed in to change notification settings - Fork 41
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
Set Winston log level to "debug" #75
base: master
Are you sure you want to change the base?
Conversation
Log is not set on verbose to not pollute logs. I propose:
|
I am currently working on adding a selector list to the config page of plugins which would let the user set the logging level from "off" to "debug" - so some sort of a global variable. Default would be "error" or could be "off". But it might be overkill and I will consider switching on/off logging depending on dev mode. Is there a method to query if dev mode is on or would one just check of "/data/testplugins" exists? Would it make sense to use winston's filter function to make controllable what type of messages are shown? |
Yeah, I think that this will be an overkill. You can just check /data/testplugins existence Or even better, just provide it as a manual flag that plugin developer can use during work. Or a command line command from volumio plugin which sets the logging to desired level by adding the info to a specific file |
"... Or a command line command from volumio plugin which sets the logging to desired level by adding the info to a specific file": Wouldn't that require "pluginhelper.js" to be extended or did I misunderstand "volumio plugin"? |
Yes, exactly. Which IMHO would be a good tool for plugins developer |
Just another thought on using "/data/testplugins": I think quite a lot of users have set Test Plugins mode on and leave it at this. If plugin's just rely on the testplugins file extensive logging will still happen on many systems where it is not required/wanted. So IMHO a dedictated flag file e.g. in "/data/configuration/plugin_type/plugin_name" or maybe in "/data/plugins/plugin_type/plugin_name" would be the better choice - or a new volumio plugin command. Since I never tried it: Would "volumio plugin" also work from the the directory of a plugin already installed, i.e. from "/data/plugins/plugin_type/plugin_name"? |
I agree, IMHO we shall just add an entry to plugin volumio plugin debugmode which toggles the creation of a file like /data/plugins/debugmode If this file is there, we set to debug, otherwise we don't. |
IMHO that would be a good compromise. Maybe an according button on the "dev" page makes sense, too. BTW: Would you prefer plugin's logging to be completely silenced by default (even error messages)? |
Yeah I agree. No, I would leave plugin logging as they are now ;) |
Ok, so bottom line the "debugmode" file should only unlock "self.logger.debug"? |
Yep |
Fixes #74