mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
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
|
server.ssl = config.ssl
|
||||||
|
|
||||||
Signal::INT.trap {
|
Signal::INT.trap {
|
||||||
config.logger.write "Kemal is going to take a rest!\n"
|
if config.logging
|
||||||
config.logger.handler.close
|
config.logger.write "Kemal is going to take a rest!\n"
|
||||||
|
config.logger.handler.close
|
||||||
|
end
|
||||||
server.close
|
server.close
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ end
|
||||||
# development: STDOUT in
|
# development: STDOUT in
|
||||||
# production: kemal.log
|
# production: kemal.log
|
||||||
macro log(message)
|
macro log(message)
|
||||||
Kemal::Logger::INSTANCE.write "#{{{message}}}\n"
|
Kemal::Logger::INSTANCE.write "#{{{message}}}\n" if Kemal.config.logging
|
||||||
end
|
end
|
||||||
|
|
||||||
# Enables / Disables logging
|
# Enables / Disables logging
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
module Kemal::Middleware
|
module Kemal::Middleware
|
||||||
class SSL
|
class SSL
|
||||||
|
|
||||||
getter context
|
getter context
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
|
|
|
@ -71,5 +71,4 @@ class Kemal::ParamParser
|
||||||
@params[key] ||= value
|
@params[key] ||= value
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -42,5 +42,4 @@ class Kemal::Route
|
||||||
end
|
end
|
||||||
Regex.new "^#{pattern}/?$"
|
Regex.new "^#{pattern}/?$"
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue