Skip to content

Commit

Permalink
Make sure to instantiate null log handler
Browse files Browse the repository at this point in the history
  • Loading branch information
sdogruyol committed Mar 6, 2016
1 parent c7d2b33 commit e3c3154
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/kemal/config.cr
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ module Kemal
end

def setup_logging
if @logging
@logger ||= Kemal::CommonLogHandler.new(@env)
HANDLERS.insert(0, @logger.not_nil!)
else
@logger = Kemal::NullLogHandler.new(@env)
end
@logger = if @logging
Kemal::CommonLogHandler.new(@env)
else
Kemal::NullLogHandler.new(@env)
end
HANDLERS.insert(0, @logger.not_nil!)
end

private def setup_error_handler
Expand Down

0 comments on commit e3c3154

Please sign in to comment.