Skip to content

Commit 3c1f9e0

Browse files
authored
fix: syslog functionality on macOS 12+ (#7)
1 parent 40f63a4 commit 3c1f9e0

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

go.mod

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
module github.com/nezhahq/service
22

3-
go 1.12
3+
go 1.18
44

5-
require golang.org/x/sys v0.20.0
5+
require (
6+
github.com/nezhahq/xsyslog v1.0.0
7+
golang.org/x/sys v0.28.0
8+
)
9+
10+
require github.com/ebitengine/purego v0.8.1 // indirect

go.sum

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211 h1:9UQO31fZ+0aKQOFldThf7BKPMJTiBfWycGh/u3UoO88=
2-
golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
3-
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
4-
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
1+
github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE=
2+
github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
3+
github.com/nezhahq/xsyslog v1.0.0 h1:fSSDxaMy7eEWdTB5L2yp47GOctOM/gItfPsF1freZBc=
4+
github.com/nezhahq/xsyslog v1.0.0/go.mod h1:wRJ6n/bly5i71/ZWhnoA39v0rFvr3Q1PSlIlExbX3fk=
5+
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
6+
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=

service_unix.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,22 @@ import (
1515
"log/syslog"
1616
"os/exec"
1717
"syscall"
18+
19+
"github.com/nezhahq/xsyslog"
1820
)
1921

2022
const defaultLogDirectory = "/var/log"
2123

2224
func newSysLogger(name string, errs chan<- error) (Logger, error) {
23-
w, err := syslog.New(syslog.LOG_DAEMON|syslog.LOG_INFO, name)
25+
w, err := xsyslog.New(syslog.LOG_DAEMON|syslog.LOG_INFO, name)
2426
if err != nil {
2527
return nil, err
2628
}
2729
return sysLogger{w, errs}, nil
2830
}
2931

3032
type sysLogger struct {
31-
*syslog.Writer
33+
*xsyslog.Writer
3234
errs chan<- error
3335
}
3436

0 commit comments

Comments
 (0)