clean_logs icon indicating copy to clipboard operation
clean_logs copied to clipboard

Possible to change logging levels at runtime?

Open fiznool opened this issue 6 years ago • 1 comments

Nice module!

I was wondering if it is possible to change the logging level at runtime. I can imagine a scenario where logging is set to CRITICAL by default on a production app, but when debugging in production it might be nice to set the log level to DEBUG in the Chrome console. This would produce all debug logs and above from that point onwards.

Is this possible?

fiznool avatar Nov 01 '18 16:11 fiznool

At the moment you can't change the logging level at runtime that way it is now, you would need to write custom code on your app to do it. If I need it to implement it on my app I would make a wrapper around this module and have the Loggin level tie to a props value that you can change at run time.

I use this module in a wrapper while in development mode and production I send the messages to the database, but the code is specific to MeteorJS that is why I did not include the logic here.

pgiani avatar Nov 01 '18 16:11 pgiani