Skip to content

Commit

Permalink
Fix calls to fatal to fit slog
Browse files Browse the repository at this point in the history
  • Loading branch information
slarwise committed Aug 12, 2024
1 parent 5954cb4 commit 092b4f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,18 @@ func main() {
if len(os.Getenv("DEBUG")) > 0 {
logFile, err := os.Create("./log")
if err != nil {
fatal("Failed to create log file: %s", err)
fatal("Failed to create log file", "err", err)
}
slog.SetDefault(slog.New(slog.NewTextHandler(logFile, nil)))
} else {
log.SetOutput(io.Discard)
}
screen, err := tcell.NewScreen()
if err != nil {
fatal("Failed to create a terminal screen: %s", err.Error())
fatal("Failed to create a terminal screen", "err", err)
}
if err := screen.Init(); err != nil {
fatal("Failed to initialize terminal screen: %s", err)
fatal("Failed to initialize terminal screen", "err", err)
}
screen.EnablePaste()
screen.Clear()
Expand Down

0 comments on commit 092b4f8

Please sign in to comment.