summaryrefslogtreecommitdiffhomepage
path: root/pkg/log/log.go
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2019-06-24 15:01:58 -0700
committergVisor bot <gvisor-bot@google.com>2019-06-24 15:03:02 -0700
commitb21b1db7003aea8615ab9e6a4f07b74c97a32c24 (patch)
tree7854d36dfa38000d423a7f045b61aad57eaf1b4d /pkg/log/log.go
parent35719d52c7ac7faa87b610013aedd69ad5d99ecc (diff)
Allow to change logging options using 'runsc debug'
New options are: runsc debug --strace=off|all|function1,function2 runsc debug --log-level=warning|info|debug runsc debug --log-packets=true|false Updates #407 PiperOrigin-RevId: 254843128
Diffstat (limited to 'pkg/log/log.go')
-rw-r--r--pkg/log/log.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg/log/log.go b/pkg/log/log.go
index 0765a1963..ab9ad01ef 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