Aller au contenu

Empty Log Message (ARCH5163)

Ce contenu n’est pas encore disponible dans votre langue.

Key go.logging.empty-log-message · Severity info · Category logging

A log call with an empty or whitespace-only message produces noise with no diagnostic value. Every log line should carry meaningful text describing what happened.

func tick(log *slog.Logger, n int) {
log.Info("", "count", n)
}
func tick(log *slog.Logger, n int) {
log.Info("tick processed", "count", n)
}

Give the log call a clear, meaningful message describing the event.