the `logger` is initialized only in development mode
Closed this issue · 4 comments
Serhiy-Nazarov commented
Unreloader = Rack::Unreloader.new(subclasses: %w'Roda Sequel::Model', logger: logger, reload: dev){App}
In the non development mode logger
doesn't exist. Isn't it?
jeremyevans commented
Correct, but the :logger
option accepts nil
as a valid value for no logger, so this is not a problem.
Serhiy-Nazarov commented
@jeremyevans
I mean logger
variable is missing. So it's not nil.
If the environment is not development
, logger
variable is not defined. And it will exception.
jeremyevans commented
Above this code, we have:
if dev
require 'logger'
logger = Logger.new($stdout)
end
In Ruby, if dev
is false, then logger
is nil
.
If you are actually getting an exception raised, please post the backtrace.
Serhiy-Nazarov commented
Thanks @jeremyevans
This is new knowledge for me :)