diff options
Diffstat (limited to 'pkg/log/log.go')
-rw-r--r-- | pkg/log/log.go | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/pkg/log/log.go b/pkg/log/log.go index 0765a1963..9387586e6 100644 --- a/pkg/log/log.go +++ b/pkg/log/log.go @@ -50,6 +50,19 @@ const ( Debug ) +func (l Level) String() string { + switch l { + case Warning: + return "Warning" + case Info: + return "Info" + case Debug: + return "Debug" + default: + return fmt.Sprintf("Invalid level: %d", l) + } +} + // Emitter is the final destination for logs. type Emitter interface { // Emit emits the given log statement. This allows for control over the @@ -209,7 +222,7 @@ var logMu sync.Mutex // log is the default logger. var log atomic.Value -// Log retieves the global logger. +// Log retrieves the global logger. func Log() *BasicLogger { return log.Load().(*BasicLogger) } |