From b21b1db7003aea8615ab9e6a4f07b74c97a32c24 Mon Sep 17 00:00:00 2001 From: Fabricio Voznika Date: Mon, 24 Jun 2019 15:01:58 -0700 Subject: 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 --- pkg/log/log.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'pkg/log/log.go') 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 -- cgit v1.2.3