fixed extra output for ls-* commands

This commit is contained in:
yusing 2024-11-04 01:32:26 +08:00
parent 291304af75
commit 5ff27b9e3d
2 changed files with 2 additions and 2 deletions

View file

@ -40,7 +40,7 @@ var (
)
func init() {
if APIJWTSecret == nil {
if APIJWTSecret == nil && GetArgs().Command == CommandStart {
log.Warn().Msg("API JWT secret is empty, authentication is disabled")
}
}

View file

@ -51,7 +51,7 @@ func init() {
).Level(level).With().Timestamp().Logger()
}
func DiscardLogger() { logger = zerolog.Nop() }
func DiscardLogger() { zerolog.SetGlobalLevel(zerolog.Disabled) }
func AddHook(h zerolog.Hook) { logger = logger.Hook(h) }