Skip to content

Commit

Permalink
Fix multiple logger handlers when custom logger is used (#653)
Browse files Browse the repository at this point in the history
  • Loading branch information
aravindavk authored Feb 17, 2023
1 parent ae7cda8 commit 1966189
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/kemal/helpers/helpers.cr
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ end
# 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
# `call(env)`, `write(message)` methods.
# `call(context)`, `write(message)` methods.
#
# ```
# class MyCustomLogger < Kemal::BaseLogHandler
# def call(env)
# def call(context)
# 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
#
# # This is used from `log` method.
Expand All @@ -71,7 +71,6 @@ end
# ```
def logger(logger : Kemal::BaseLogHandler)
Kemal.config.logger = logger
Kemal.config.add_handler logger
end

# Enables / Disables static file serving.
Expand Down

0 comments on commit 1966189

Please sign in to comment.