diff --git a/src/marten.cr b/src/marten.cr index a841c795..d1619f15 100644 --- a/src/marten.cr +++ b/src/marten.cr @@ -237,7 +237,7 @@ module Marten Marten::Server.setup - Log.info { "Marten running on #{Marten::Server.addresses.join ", "} (Press CTRL+C to quit)" } + show_server_info Signal::INT.trap do Signal::INT.reset @@ -300,4 +300,20 @@ module Marten end end end + + private def self.show_server_info : Nil + base_message = "Marten running on #{Marten::Server.addresses.join ", "} (Press CTRL+C to quit)" + + if Marten.settings.debug? + Log.info { + String.build do |s| + s << "#{"=" * base_message.size}\n" + s << base_message + s << "\n#{"=" * base_message.size}" + end + } + else + Log.info { base_message } + end + end end