You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Anyone who uses libraries that generate a lot of warnings will resort to using -W0 as a default in Ruby. This does silence the warnings, but it also has the unfortunate side-effect of pretty much silencing Console.logger as well since the default level now moves up a notch.
What's doubly frustrating is anyone with the -W0 default will not see output from Console examples, where this:
Does nothing at all. This can be reproduced with RUBYOPT=-W0 ruby example.rb
Overriding this within an application is not convenient. Right now what I've found you have to do is:
ENV['CONSOLE_LEVEL'] ||= 'info'
Where that's a really round-about way of setting a default. It would be more convenient if the default_log_level could be specified, as in Console::Logger.default_log_level = :debug or whatever setting is desired, where that will be applied to all loggers created after that point.
The text was updated successfully, but these errors were encountered:
There's nothing wrong with having defaults tied to Ruby's global verbosity level, but right now it's really awkward to try and separate those two to override it.
Most other logging tools, even Logger, support an arbitrary per-logger logging level override. Logger.new(level: :debug) for example.
Anyone who uses libraries that generate a lot of warnings will resort to using
-W0
as a default in Ruby. This does silence the warnings, but it also has the unfortunate side-effect of pretty much silencingConsole.logger
as well since the default level now moves up a notch.What's doubly frustrating is anyone with the
-W0
default will not see output from Console examples, where this:Does nothing at all. This can be reproduced with
RUBYOPT=-W0 ruby example.rb
Overriding this within an application is not convenient. Right now what I've found you have to do is:
Where that's a really round-about way of setting a default. It would be more convenient if the
default_log_level
could be specified, as inConsole::Logger.default_log_level = :debug
or whatever setting is desired, where that will be applied to all loggers created after that point.The text was updated successfully, but these errors were encountered: