diff options
Diffstat (limited to 'pkg/log/log.go')
-rw-r--r-- | pkg/log/log.go | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/pkg/log/log.go b/pkg/log/log.go index 7d563241e..9387586e6 100644 --- a/pkg/log/log.go +++ b/pkg/log/log.go @@ -30,7 +30,7 @@ import ( "syscall" "time" - "gvisor.googlesource.com/gvisor/pkg/linewriter" + "gvisor.dev/gvisor/pkg/linewriter" ) // Level is the log level. @@ -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) } |