Skip to content

Commit

Permalink
Discard logs if debug mode is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
giulianopz committed Mar 29, 2023
1 parent ec89e75 commit 541acd8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/newscanoe/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"flag"
"io"
"log"
"os"
"os/signal"
Expand All @@ -26,7 +27,9 @@ func main() {
flag.BoolVar(&display.DebugMode, "d", false, "enable debug mode")
flag.Parse()

//TODO discard logs if debug mode is disabled
if !display.DebugMode {
log.SetOutput(io.Discard)
}

origTermios := termios.EnableRawMode(os.Stdin.Fd())
defer termios.DisableRawMode(os.Stdin.Fd(), origTermios)
Expand Down

0 comments on commit 541acd8

Please sign in to comment.