aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorlawl <github@dumbinter.net>2020-07-06 21:39:18 +0200
committerlawl <github@dumbinter.net>2020-07-06 21:39:18 +0200
commitf0a73d3ff7c9bffd4d99655570071c185a33ab4f (patch)
treedf7e034eae8f33d7a92cb6a8987a268be8ebe226 /main.go
parent35c4aa79a293496e52608d15a6010b55dba9bbb2 (diff)
downloadnoisetorch-f0a73d3ff7c9bffd4d99655570071c185a33ab4f.tar.gz
noisetorch-f0a73d3ff7c9bffd4d99655570071c185a33ab4f.zip
Log to file and stdout, instead of just file
Diffstat (limited to 'main.go')
-rw-r--r--main.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.go b/main.go
index 9344fdb..fe94eb4 100644
--- a/main.go
+++ b/main.go
@@ -2,6 +2,7 @@ package main
import (
"image"
+ "io"
"io/ioutil"
"log"
"os"
@@ -31,7 +32,9 @@ func main() {
log.Fatalf("error opening file: %v\n", err)
}
defer f.Close()
- log.SetOutput(f)
+
+ logwriter := io.MultiWriter(os.Stdout, f)
+ log.SetOutput(logwriter)
log.Printf("Application starting. Version: %s", version)
initializeConfigIfNot()