From fb11c0c27cedf12ac4e145861ec558f0916a7e14 Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Sat, 6 May 2023 00:57:42 -0700 Subject: [PATCH] syslog: support not using syslog --- syslog/logger.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/syslog/logger.go b/syslog/logger.go index 8a427e2..fee0f11 100644 --- a/syslog/logger.go +++ b/syslog/logger.go @@ -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