summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go6
-rw-r--r--os.go4
2 files changed, 10 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 != "" {
diff --git a/os.go b/os.go
index 44ec2ba9c..484d07731 100644
--- a/os.go
+++ b/os.go
@@ -3,6 +3,7 @@ package main
import (
"github.com/golang/protobuf/proto"
"io/ioutil"
+ "log"
"net/url"
"os"
"path"
@@ -35,6 +36,9 @@ func InitOS() {
func ResolveModule(moduleSpecifier string, containingFile string) (
moduleName string, filename string, err error) {
+
+ log.Printf("ResolveModule %s %s", moduleSpecifier, containingFile)
+
moduleUrl, err := url.Parse(moduleSpecifier)
if err != nil {
return