mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Fix multiple logger handlers when custom logger is used (#653)
This commit is contained in:
parent
ae7cda8291
commit
19661893ca
1 changed files with 3 additions and 4 deletions
|
@ -48,13 +48,13 @@ end
|
||||||
# This is used to replace the built-in `Kemal::LogHandler` with a custom logger.
|
# This is used to replace the built-in `Kemal::LogHandler` with a custom logger.
|
||||||
#
|
#
|
||||||
# A custom logger must inherit from `Kemal::BaseLogHandler` and must implement
|
# A custom logger must inherit from `Kemal::BaseLogHandler` and must implement
|
||||||
# `call(env)`, `write(message)` methods.
|
# `call(context)`, `write(message)` methods.
|
||||||
#
|
#
|
||||||
# ```
|
# ```
|
||||||
# class MyCustomLogger < Kemal::BaseLogHandler
|
# class MyCustomLogger < Kemal::BaseLogHandler
|
||||||
# def call(env)
|
# def call(context)
|
||||||
# puts "I'm logging some custom stuff here."
|
# puts "I'm logging some custom stuff here."
|
||||||
# call_next(env) # => This calls the next handler
|
# call_next(context) # => This calls the next handler
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
# # This is used from `log` method.
|
# # This is used from `log` method.
|
||||||
|
@ -71,7 +71,6 @@ end
|
||||||
# ```
|
# ```
|
||||||
def logger(logger : Kemal::BaseLogHandler)
|
def logger(logger : Kemal::BaseLogHandler)
|
||||||
Kemal.config.logger = logger
|
Kemal.config.logger = logger
|
||||||
Kemal.config.add_handler logger
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Enables / Disables static file serving.
|
# Enables / Disables static file serving.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue