diff --git a/color.go b/color.go index f982b379..2dbf831a 100644 --- a/color.go +++ b/color.go @@ -67,6 +67,10 @@ var DefaultColors = Colors{ // defaultColors is a function to override default colors to config func defaultColors(colors Colors) Colors { + if colors.Black == "" { + colors.Black = DefaultColors.Black + } + if colors.Red == "" { colors.Red = DefaultColors.Red } diff --git a/listen.go b/listen.go index 8bd6f0dd..89a6fba6 100644 --- a/listen.go +++ b/listen.go @@ -212,8 +212,8 @@ func (app *App) startupMessage(addr string, tls bool, pids string) { str := fmt.Sprintf("%"+pad+"s", " ") str += fmt.Sprintf("%s%s%s", colors.Cyan, s, colors.Black) str += fmt.Sprintf("%"+pad+"s", " ") - if len([]rune(str))-10 < width && len([]rune(str))%2 != 0 { - // add an ending space if the length of str is odd and str is not too long + if len([]rune(s))-10 < width && len([]rune(s))%2 == 0 { + // add an ending space if the length of str is even and str is not too long str += " " } return str @@ -256,7 +256,7 @@ func (app *App) startupMessage(addr string, tls bool, pids string) { if app.config.AppName != "" { mainLogo += " │ " + centerValue(app.config.AppName, 49) + " │\n" } - mainLogo += " │ " + centerValue(" Fiber v"+Version, 49) + " │\n" + mainLogo += " │ " + centerValue("Fiber v"+Version, 49) + " │\n" if host == "0.0.0.0" { mainLogo +=