// +build linux darwin

package logging

import (
	log "gopkg.in/inconshreveable/log15.v2"
)

// getSystemHandler on Linux writes messages to syslog.
func getSystemHandler(syslog string, debug bool, format log.Format) log.Handler {
	// SyslogHandler
	if syslog != "" {
		if !debug {
			return log.LvlFilterHandler(
				log.LvlInfo,
				log.Must.SyslogHandler(syslog, format),
			)
		}

		return log.Must.SyslogHandler(syslog, format)
	}

	return nil
}

// +build linux darwin

package logging

import (
	slog "log/syslog"

	log "gopkg.in/inconshreveable/log15.v2"
)

// getSystemHandler on Linux writes messages to syslog.
func getSystemHandler(syslog string, debug bool, format log.Format) log.Handler {
	// SyslogHandler
	if syslog != "" {
		if !debug {
			return log.LvlFilterHandler(
				log.LvlInfo,
				log.Must.SyslogHandler(slog.LOG_INFO, syslog, format),
			)
		}

		return log.Must.SyslogHandler(slog.LOG_INFO, syslog, format)
	}

	return nil
}

--- 
+++ 
@@ -3,8 +3,6 @@
 package logging
 
 import (
-	slog "log/syslog"
-
 	log "gopkg.in/inconshreveable/log15.v2"
 )
 
@@ -15,11 +13,11 @@
 		if !debug {
 			return log.LvlFilterHandler(
 				log.LvlInfo,
-				log.Must.SyslogHandler(slog.LOG_INFO, syslog, format),
+				log.Must.SyslogHandler(syslog, format),
 			)
 		}
 
-		return log.Must.SyslogHandler(slog.LOG_INFO, syslog, format)
+		return log.Must.SyslogHandler(syslog, format)
 	}
 
 	return nil
Revert "Temporary workaround for log15 API breakage"

This reverts commit 30c859499e24ba6255508cd664c09cf4c1731bbe.

Signed-off-by: Stéphane Graber <089afc6d81f66f1168a9849e15660feae286e024@ubuntu.com>
