summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-05-23 13:23:29 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-05-23 13:23:29 -0400
commit644e7fa065ba4e6f553998b10de6839301e943cd (patch)
tree29cc88c71b4d26b11bab6175612809bd77ffc327 /main.go
parentbe4883722f00ac71d4586f2e80557fd2ba055d24 (diff)
Add debug logging to golang side
Diffstat (limited to 'main.go')
-rw-r--r--main.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/main.go b/main.go
index 7c6fdfbd0..941f7ffdc 100644
--- a/main.go
+++ b/main.go
@@ -5,6 +5,7 @@ import (
"fmt"
"github.com/golang/protobuf/proto"
"github.com/ry/v8worker2"
+ "io/ioutil"
"log"
"os"
"runtime/pprof"
@@ -34,6 +35,11 @@ func main() {
}
args = v8worker2.SetFlags(args)
+ // Unless the debug flag is specified, discard logs.
+ if !*flagDebug {
+ log.SetOutput(ioutil.Discard)
+ }
+
// Maybe start Golang CPU profiler.
// Use --prof for profiling JS.
if *flagGoProf != "" {