summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-05-25 12:25:55 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-05-25 12:25:55 -0400
commit08e005d45f475a8b45d18ca887dbf790e93bc1db (patch)
tree7455661d2aac0d54f3ceccc00e2cb080b0135911 /main.go
parent5353e9e90f3cdc090acec6b81c90e803ef22dcda (diff)
Improve debug logging in golang
Diffstat (limited to 'main.go')
-rw-r--r--main.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/main.go b/main.go
index d557ab204..ab1828d94 100644
--- a/main.go
+++ b/main.go
@@ -3,8 +3,6 @@ package main
import (
"flag"
"github.com/ry/v8worker2"
- "io/ioutil"
- "log"
"os"
"runtime/pprof"
)
@@ -28,10 +26,6 @@ func FlagsParse() []string {
}
args = v8worker2.SetFlags(args)
- // Unless the debug flag is specified, discard logs.
- if !*flagDebug {
- log.SetOutput(ioutil.Discard)
- }
return args
}
@@ -43,7 +37,7 @@ func main() {
if *flagGoProf != "" {
f, err := os.Create(*flagGoProf)
if err != nil {
- log.Fatal(err)
+ panic(err)
}
pprof.StartCPUProfile(f)
defer pprof.StopCPUProfile()