From 1afb4cbfa8218ab8616c59a041dcc85fa72834a8 Mon Sep 17 00:00:00 2001 From: Sdogruyol Date: Sun, 4 Dec 2016 01:27:26 +0300 Subject: [PATCH] Use log instead --- src/kemal.cr | 4 ++-- src/kemal/common_exception_handler.cr | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/kemal.cr b/src/kemal.cr index 41dd0b3..4804c88 100644 --- a/src/kemal.cr +++ b/src/kemal.cr @@ -30,7 +30,7 @@ module Kemal # Test environment doesn't need to have signal trap, built-in images, and logging. unless config.env == "test" Signal::INT.trap { - config.logger.write "Kemal is going to take a rest!\n" + log "Kemal is going to take a rest!\n" config.server.close exit } @@ -46,7 +46,7 @@ module Kemal end end - config.logger.write "[#{config.env}] Kemal is ready to lead at #{config.scheme}://#{config.host_binding}:#{config.port}\n" + log "[#{config.env}] Kemal is ready to lead at #{config.scheme}://#{config.host_binding}:#{config.port}\n" config.server.listen end end diff --git a/src/kemal/common_exception_handler.cr b/src/kemal/common_exception_handler.cr index 2b62c46..451831a 100644 --- a/src/kemal/common_exception_handler.cr +++ b/src/kemal/common_exception_handler.cr @@ -11,7 +11,7 @@ module Kemal rescue ex : Kemal::Exceptions::CustomException call_exception_with_status_code(context, ex, context.response.status_code) rescue ex : Exception - Kemal.config.logger.write("Exception: #{ex.inspect_with_backtrace}\n") + log("Exception: #{ex.inspect_with_backtrace}\n") return call_exception_with_status_code(context, ex, 500) if Kemal.config.error_handlers.has_key?(500) verbosity = Kemal.config.env == "production" ? false : true return render_500(context, ex.inspect_with_backtrace, verbosity)