diff options
author | Miguel Mota <hello@miguelmota.com> | 2021-11-22 18:53:22 -0800 |
---|---|---|
committer | Miguel Mota <hello@miguelmota.com> | 2021-11-22 18:53:22 -0800 |
commit | 60de82342d58c3896f755c196d22c28e4b2afe36 (patch) | |
tree | 1e2990c3032a21c79d8979834c9c4d9d2a5fece6 | |
parent | 6d671b28ae3294d5ef4fed110f6351fbaf51600f (diff) |
Log debug output file if DEBUG set
-rw-r--r-- | cointop/debug.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/cointop/debug.go b/cointop/debug.go index 77f0a1e..904b6cc 100644 --- a/cointop/debug.go +++ b/cointop/debug.go @@ -20,9 +20,6 @@ func (ct *Cointop) setLogOutputFile() { debugFile := os.Getenv("DEBUG_FILE") if debugFile != "" { filename = pathutil.NormalizePath(debugFile) - if filename != debugFile && os.Getenv("DEBUG") != "" { - fmt.Printf("Writing debug log to %s\n", filename) - } } f, err := os.OpenFile(filename, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0600) if err != nil { @@ -30,4 +27,5 @@ func (ct *Cointop) setLogOutputFile() { } log.SetOutput(f) ct.logfile = f + fmt.Printf("Writing debug log to %s\n", filename) } |