Skip to content

Commit

Permalink
feat: Add Logger.*Empty(...) functions for empty logging at a given l…
Browse files Browse the repository at this point in the history
…evel.

At times, we want to add one or more new lines to the logs without
logging anything. When this needs to be tied to the configured level,
these functions can be used to seamlessly achieve the desired end
result.
  • Loading branch information
G3 authored and G3 committed Sep 10, 2024
1 parent 6014947 commit 9c76c2f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions zzzlogi.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,36 @@ type Logger interface {
Trace(args ...interface{})
// Logs the specified arguments at Trace level using the specified format.
Tracef(format string, args ...interface{})
// Logs just a new empty line only if the logging level is at least Trace.
TraceEmpty()
// Logs the specified arguments at Debug level using the default format
// (i.e. separated by space).
Debug(args ...interface{})
// Logs the specified arguments at Debug level using the specified format.
Debugf(format string, args ...interface{})
// Logs just a new empty line only if the logging level is at least Debug.
DebugEmpty()
// Logs the specified arguments at Info level using the default format
// (i.e. separated by space).
Info(args ...interface{})
// Logs the specified arguments at Info level using the specified format.
Infof(format string, args ...interface{})
// Logs just a new empty line only if the logging level is at least Info.
InfoEmpty()
// Logs the specified arguments at Warn level using the default format
// (i.e. separated by space).
Warn(args ...interface{})
// Logs the specified arguments at Warn level using the specified format.
Warnf(format string, args ...interface{})
// Logs just a new empty line only if the logging level is at least Warn.
WarnEmpty()
// Logs the specified arguments at Error level using the default format
// (i.e. separated by space).
Error(args ...interface{})
// Logs the specified arguments at Error level using the specified format.
Errorf(format string, args ...interface{})
// Logs just a new empty line only if the logging level is at least Error.
ErrorEmpty()
// Logs the specified arguments at Fatal level using the default format
// (i.e. separated by space).
Fatal(args ...interface{})
Expand Down

0 comments on commit 9c76c2f

Please sign in to comment.