Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configurable startup logging as a block #291

Merged
merged 3 commits into from
Jan 15, 2017
Merged

Add configurable startup logging as a block #291

merged 3 commits into from
Jan 15, 2017

Conversation

twisterghost
Copy link
Contributor

Allow kemal.run to optionally take a code block to change the post-start logging, or run any other post-start code at that time. This fixes part of #290, wasn't sure how to handle the shut-down text.

I hope I'm not missing some glaringly obvious configuration here that already allows for this!

@samueleaton
Copy link
Contributor

samueleaton commented Jan 14, 2017

Oh this is great.

specs?

@twisterghost
Copy link
Contributor Author

I'll look into writing some specs for it. I didn't immediately see a file for them to live in. If you have a suggestion, let me know.

@sdogruyol sdogruyol merged commit 209a9e5 into kemalcr:master Jan 15, 2017
@sam0x17
Copy link

sam0x17 commented Jun 8, 2019

I don't understand how to use this to override the default startup message. Passing a custom block seems to still result in the "Kemal is ready to lead!" message. I'll happily document this if I can get some clarification on how to actually do it.

@sam0x17
Copy link

sam0x17 commented Jun 8, 2019

note: for those looking its:

def Kemal.display_startup_message(config, server)
  addresses = server.addresses.map { |address| "#{config.scheme}://#{address}" }.join ", "
  log "[#{config.env}] my cool server is live at #{addresses}"
end

Just make sure that is placed after the require "kemal" line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants