Skip to content

Commit

Permalink
ci: configure usestdlibvars to suggest time.Layout
Browse files Browse the repository at this point in the history
  • Loading branch information
ccoVeille committed Jan 19, 2025
1 parent f20ad78 commit dd19276
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,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
Expand Down
4 changes: 2 additions & 2 deletions pkg/gofr/logging/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit dd19276

Please sign in to comment.