aboutsummaryrefslogtreecommitdiff
path: root/plugin/pkg/log/log.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/pkg/log/log.go')
-rw-r--r--plugin/pkg/log/log.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugin/pkg/log/log.go b/plugin/pkg/log/log.go
index 161fbc886..387d7f8e2 100644
--- a/plugin/pkg/log/log.go
+++ b/plugin/pkg/log/log.go
@@ -10,6 +10,7 @@ package log
import (
"fmt"
+ "io/ioutil"
golog "log"
)
@@ -61,6 +62,9 @@ func Error(v ...interface{}) { log(err, v...) }
// Errorf is equivalent to log.Printf, but prefixed with "[ERROR] ".
func Errorf(format string, v ...interface{}) { logf(err, format, v...) }
+// Discard sets the log output to /dev/null.
+func Discard() { golog.SetOutput(ioutil.Discard) }
+
const (
debug = "[DEBUG] "
err = "[ERROR] "