organise startup message

pull/454/head
wernerr 2020-06-07 21:10:38 +02:00
parent 535dc52697
commit 8c2f4e3edb
1 changed files with 7 additions and 4 deletions

11
app.go
View File

@ -380,8 +380,7 @@ func (app *App) Serve(ln net.Listener, tlsconfig ...*tls.Config) error {
}
// Print startup message
if !app.Settings.DisableStartupMessage {
fmt.Printf(" _______ __\n ____ / ____(_) /_ ___ _____\n_____ / /_ / / __ \\/ _ \\/ ___/\n __ / __/ / / /_/ / __/ /\n /_/ /_/_.___/\\___/_/ v%s\n", Version)
fmt.Printf("Started listening on %s\n", ln.Addr().String())
startupMessage(ln)
}
return app.server.Serve(ln)
@ -422,8 +421,7 @@ func (app *App) Listen(address interface{}, tlsconfig ...*tls.Config) error {
}
// Print startup message
if !app.Settings.DisableStartupMessage && !utils.GetArgument("-child") {
fmt.Printf(" _______ __\n ____ / ____(_) /_ ___ _____\n_____ / /_ / / __ \\/ _ \\/ ___/\n __ / __/ / / /_/ / __/ /\n /_/ /_/_.___/\\___/_/ v%s\n", Version)
fmt.Printf("Started listening on %s\n", ln.Addr().String())
startupMessage(ln)
}
return app.server.Serve(ln)
@ -589,3 +587,8 @@ func (app *App) init() *App {
app.mutex.Unlock()
return app
}
func startupMessage(ln net.Listener) {
fmt.Printf(" _______ __\n ____ / ____(_) /_ ___ _____\n_____ / /_ / / __ \\/ _ \\/ ___/\n __ / __/ / / /_/ / __/ /\n /_/ /_/_.___/\\___/_/ v%s\n", Version)
fmt.Printf("Started listening on %s\n", ln.Addr().String())
}