Add banner

This commit is contained in:
Maksym Pavlenko
2019-11-12 17:27:02 -08:00
parent 7617018811
commit f10c993b5b
+20 -1
View File
@@ -17,10 +17,25 @@ import (
type Opts struct {
ConfigPath string `long:"config" short:"c" default:"config.toml" env:"PODSYNC_CONFIG_PATH"`
Debug bool `long:"debug"`
NoBanner bool `long:"no-banner"`
}
const banner = `
_______ _______ ______ _______ _ _______
( ____ )( ___ )( __ \ ( ____ \|\ /|( ( /|( ____ \
| ( )|| ( ) || ( \ )| ( \/( \ / )| \ ( || ( \/
| (____)|| | | || | ) || (_____ \ (_) / | \ | || |
| _____)| | | || | | |(_____ ) \ / | (\ \) || |
| ( | | | || | ) | ) | ) ( | | \ || |
| ) | (___) || (__/ )/\____) | | | | ) \ || (____/\
|/ (_______)(______/ \_______) \_/ |/ )_)(_______/
`
func main() {
log.SetFormatter(&log.TextFormatter{})
log.SetFormatter(&log.TextFormatter{
TimestampFormat: time.RFC3339,
FullTimestamp: true,
})
stop := make(chan os.Signal, 1)
signal.Notify(stop, syscall.SIGINT, syscall.SIGTERM)
@@ -41,6 +56,10 @@ func main() {
log.SetLevel(log.DebugLevel)
}
if !opts.NoBanner {
log.Info(banner)
}
// Load TOML file
log.Debugf("loading configuration %q", opts.ConfigPath)
cfg, err := config.LoadConfig(opts.ConfigPath)