diff --git a/.golangci.yml b/.golangci.yml index fc16abd2f..8ff88ef37 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -54,6 +54,8 @@ linters-settings: allow-unused: false # report any unused nolint directives require-explanation: true # require an explanation for nolint directives require-specific: true # require nolint directives to be specific about which linter is being skipped + usestdlibvars: + time-layout: true # Suggest the use of constants available in time package revive: rules: # default revive rules, they have to be present otherwise they are disabled diff --git a/pkg/gofr/logging/logger.go b/pkg/gofr/logging/logger.go index 37e912357..1bce33898 100644 --- a/pkg/gofr/logging/logger.go +++ b/pkg/gofr/logging/logger.go @@ -159,12 +159,12 @@ func (l *logger) prettyPrint(e logEntry, out io.Writer) { // This decouples the logger implementation from its usage if fn, ok := e.Message.(PrettyPrint); ok { fmt.Fprintf(out, "\u001B[38;5;%dm%s\u001B[0m [%s] ", e.Level.color(), e.Level.String()[0:4], - e.Time.Format("15:04:05")) + e.Time.Format(time.TimeOnly)) fn.PrettyPrint(out) } else { fmt.Fprintf(out, "\u001B[38;5;%dm%s\u001B[0m [%s] ", e.Level.color(), e.Level.String()[0:4], - e.Time.Format("15:04:05")) + e.Time.Format(time.TimeOnly)) fmt.Fprintf(out, "%v\n", e.Message) }