Handle cases when logger can be nil
This commit is contained in:
parent
8bac0a8aef
commit
788c7241d4
5 changed files with 5 additions and 6 deletions
|
@ -16,8 +16,10 @@ at_exit do
|
|||
server.ssl = config.ssl
|
||||
|
||||
Signal::INT.trap {
|
||||
config.logger.write "Kemal is going to take a rest!\n"
|
||||
config.logger.handler.close
|
||||
if config.logging
|
||||
config.logger.write "Kemal is going to take a rest!\n"
|
||||
config.logger.handler.close
|
||||
end
|
||||
server.close
|
||||
exit
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ end
|
|||
# development: STDOUT in
|
||||
# production: kemal.log
|
||||
macro log(message)
|
||||
Kemal::Logger::INSTANCE.write "#{{{message}}}\n"
|
||||
Kemal::Logger::INSTANCE.write "#{{{message}}}\n" if Kemal.config.logging
|
||||
end
|
||||
|
||||
# Enables / Disables logging
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
module Kemal::Middleware
|
||||
class SSL
|
||||
|
||||
getter context
|
||||
|
||||
def initialize
|
||||
|
|
|
@ -71,5 +71,4 @@ class Kemal::ParamParser
|
|||
@params[key] ||= value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -42,5 +42,4 @@ class Kemal::Route
|
|||
end
|
||||
Regex.new "^#{pattern}/?$"
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue