We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1ab05e5 + 2ad0ded commit 79e2fa8Copy full SHA for 79e2fa8
internal/app/log.go
@@ -3,6 +3,7 @@ package app
3
import (
4
"io"
5
"os"
6
+ "strings"
7
8
"github.com/mattn/go-isatty"
9
"github.com/rs/zerolog"
@@ -38,11 +39,17 @@ func initLogger() {
38
39
40
var writer io.Writer
41
- switch modules["output"] {
42
+ switch output, path, _ := strings.Cut(modules["output"], ":"); output {
43
case "stderr":
44
writer = os.Stderr
45
case "stdout":
46
writer = os.Stdout
47
+ case "file":
48
+ if path == "" {
49
+ path = "go2rtc.log"
50
+ }
51
+ // if fail - only MemoryLog will be available
52
+ writer, _ = os.OpenFile(path, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
53
}
54
55
timeFormat := modules["time"]
0 commit comments