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

This commit is contained in:
Christian Rocha 2020-07-27 14:58:51 -04:00
parent 5d434e1753
commit c6a1afd3c7
No known key found for this signature in database
GPG Key ID: D6CC7A16E5878018
1 changed files with 0 additions and 17 deletions

View File

@ -1,10 +1,7 @@
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
package tea
import (
"log"
"log/syslog"
"os"
)
@ -28,17 +25,3 @@ func LogToFile(path string, prefix string) (*os.File, error) {
log.SetOutput(f)
return f, nil
}
// UseSysLog sets up logging to log the system log. This becomes helpful when
// debugging since we can't print to the terminal since our TUI is occupying it.
//
// On macOS this is a just a matter of: tail -f /var/log/system.log
// On Linux this varies depending on distribution.
func UseSysLog(programName string) error {
l, err := syslog.New(syslog.LOG_NOTICE, programName)
if err != nil {
return err
}
log.SetOutput(l)
return nil
}