syslog: support not using syslog

This commit is contained in:
Kyle Isom 2023-05-06 00:57:42 -07:00
parent 27cc67d2cf
commit fb11c0c27c
1 changed files with 6 additions and 4 deletions

View File

@ -143,10 +143,12 @@ func Setup(opts *Options) error {
log.p = priority
var err error
log.l, err = gsyslog.NewLogger(priority, opts.Facility, opts.Tag)
if err != nil {
return err
if opts.WriteSyslog {
var err error
log.l, err = gsyslog.NewLogger(priority, opts.Facility, opts.Tag)
if err != nil {
return err
}
}
return nil