Skip to content
This repository was archived by the owner on Mar 30, 2023. It is now read-only.

Commit 455afbf

Browse files
committed
Make fakewarp log configurable
1 parent 325db8c commit 455afbf

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

cmd/fakewarp/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,11 @@ func runCli(args []string) error {
156156
}
157157

158158
func main() {
159-
f, err := os.OpenFile("/var/log/fakewarp.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
159+
logFilename := os.Getenv("FAKEWARP_LOG")
160+
if logFilename == "" {
161+
logFilename = "/var/log/fakewarp.log"
162+
}
163+
f, err := os.OpenFile(logFilename, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
160164
if err != nil {
161165
log.Fatalf("error opening file: %v", err)
162166
}

0 commit comments

Comments
 (0)