This repository was archived by the owner on Jan 5, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +27
-10
lines changed Expand file tree Collapse file tree 3 files changed +27
-10
lines changed Original file line number Diff line number Diff line change 1+ // +build linux darwin dragonfly freebsd netbsd openbsd solaris
2+
3+ package xlog
4+
5+ import "log/syslog"
6+
7+ // NewSysLog creates a new sys log.
8+ func NewSysLog (opts ... Option ) * Log {
9+ w , err := syslog .New (syslog .LOG_DEBUG , "" )
10+ if err != nil {
11+ panic (err )
12+ }
13+ return NewXLog (w , opts ... )
14+ }
Original file line number Diff line number Diff line change 1+ // +build windows
2+
3+ package xlog
4+
5+ import (
6+ "os"
7+ )
8+
9+ // NewSysLog creates a new sys log. Because there is no syslog support for
10+ // Windows, we output to os.Stdout.
11+ func NewSysLog (opts ... Option ) * Log {
12+ return NewXLog (os .Stdout , opts ... )
13+ }
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import (
1313 "fmt"
1414 "io"
1515 "log"
16- "log/syslog"
1716 "os"
1817 "strings"
1918)
@@ -61,15 +60,6 @@ type Log struct {
6160 * log.Logger
6261}
6362
64- // NewSysLog creates a new sys log.
65- func NewSysLog (opts ... Option ) * Log {
66- w , err := syslog .New (syslog .LOG_DEBUG , "" )
67- if err != nil {
68- panic (err )
69- }
70- return NewXLog (w , opts ... )
71- }
72-
7363// NewStdLog creates a new std log.
7464func NewStdLog (opts ... Option ) * Log {
7565 return NewXLog (os .Stdout , opts ... )
You can’t perform that action at this time.
0 commit comments