Skip to content
Myr

Remove syslog stuff for Windows support + LogToFile()'s a better choice.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Christian Rocha · committed by Christian Rocha · parent 5d434e1 · Browse files · 1 file+0 added−17 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+0 added−17 removed

  • other:+0 added−17 removed

1 file+0 added−17 removed

modified:logging.go-17 removed
1// +build darwin dragonfly freebsd linux netbsd openbsd solaris21package tea23import (4 "log"7 "log/syslog"5 "os"6)78// LogToFile sets up default logging to log to a file This is helpful as we
15 unmodified lines
24 }25 log.SetOutput(f)26 return f, nil27}3132// UseSysLog sets up logging to log the system log. This becomes helpful when33// debugging since we can't print to the terminal since our TUI is occupying it.34//35// On macOS this is a just a matter of: tail -f /var/log/system.log36// On Linux this varies depending on distribution.37func UseSysLog(programName string) error {38 l, err := syslog.New(syslog.LOG_NOTICE, programName)39 if err != nil {40 return err41 }42 log.SetOutput(l)43 return nil44}