If $DEBUG_FILE is set, use that rather than /tmp/cointop.log

pull/236/head
Simon Roberts 3 years ago
parent 6e1338e61f
commit 8c976d3c0f
No known key found for this signature in database
GPG Key ID: 0F30F99E6B771FD4

@ -3,11 +3,16 @@ package cointop
import (
"os"
"github.com/cointop-sh/cointop/pkg/pathutil"
log "github.com/sirupsen/logrus"
)
func (ct *Cointop) initlog() {
filename := "/tmp/cointop.log"
debugFile := os.Getenv("DEBUG_FILE")
if debugFile != "" {
filename = pathutil.NormalizePath(debugFile)
}
f, err := os.OpenFile(filename, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0600)
if err != nil {
panic(err)

Loading…
Cancel
Save