Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: configure usestdlibvars to suggest time.Layout #1407

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
Loading