Skip to content

Commit

Permalink
Merge pull request #47 from ipfs/fix/syslog-windonts
Browse files Browse the repository at this point in the history
remove syslogger
  • Loading branch information
Stebalien authored Sep 13, 2018
2 parents dda4893 + faea9f5 commit f29ae87
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions oldlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ const (
envLogging = "IPFS_LOGGING"
envLoggingFmt = "IPFS_LOGGING_FMT"

envLoggingFile = "GOLOG_FILE" // /path/to/file
envLoggingSyslog = "GOLOG_SYSLOG_ENABLE" // 1 or 0
envLoggingFile = "GOLOG_FILE" // /path/to/file
)

// ErrNoSuchLogger is returned when the util pkg is asked for a non existant logger
Expand All @@ -59,7 +58,7 @@ func SetupLogging() {
lfmt = LogFormats[defaultLogFormat]
}

// check if we log to a file, or syslog, building a list of log backends
// check if we log to a file
var lgbe []logging.Backend
if logfp := os.Getenv(envLoggingFile); len(logfp) > 0 {
f, err := os.Create(logfp)
Expand All @@ -70,16 +69,6 @@ func SetupLogging() {
}
}

// check if we want a syslogger
if env := os.Getenv(envLoggingSyslog); env == "1" {
slbe, err := logging.NewSyslogBackend("")
if err != nil {
fmt.Fprintf(os.Stderr, "ERROR go-log: %s: failed to set logging syslog backend", err)
} else {
lgbe = append(lgbe, slbe)
}
}

// logs written to stderr
lgbe = append(lgbe, logging.NewLogBackend(colorable.NewColorableStderr(), "", 0))

Expand Down

0 comments on commit f29ae87

Please sign in to comment.