New Upstream Snapshot - golang-github-hlandau-dexlogconfig

Ready changes

Summary

Merged new upstream version: 0.0~git20220319.0.86a3fc3 (was: 0.0~git20161112.0.244f29b).

Resulting package

Built on 2023-01-19T09:55 (took 4m9s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots golang-github-hlandau-dexlogconfig-dev

Lintian Result

Diff

diff --git a/debian/changelog b/debian/changelog
index 9f6d60a..e35922c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+golang-github-hlandau-dexlogconfig (0.0~git20220319.0.86a3fc3-1) UNRELEASED; urgency=low
+
+  * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Thu, 19 Jan 2023 09:52:44 -0000
+
 golang-github-hlandau-dexlogconfig (0.0~git20161112.0.244f29b-3) unstable; urgency=medium
 
   [ Debian Janitor ]
diff --git a/debian/patches/license.patch b/debian/patches/license.patch
index 0387555..5f62cf7 100644
--- a/debian/patches/license.patch
+++ b/debian/patches/license.patch
@@ -11,8 +11,10 @@ Bug: https://github.com/hlandau/dexlogconfig/issues/1
 Last-Update: 2016-10-06
 ---
 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: golang-github-hlandau-dexlogconfig.git/LICENSE
+===================================================================
 --- /dev/null
-+++ b/LICENSE
++++ golang-github-hlandau-dexlogconfig.git/LICENSE
 @@ -0,0 +1,5 @@
 +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 +
diff --git a/syslog_other.go b/syslog_other.go
index 92f4e0f..351c5fc 100644
--- a/syslog_other.go
+++ b/syslog_other.go
@@ -2,5 +2,76 @@
 
 package dexlogconfig
 
+import "github.com/hlandau/xlog"
+import "golang.org/x/sys/windows/svc/eventlog"
+import "gopkg.in/hlandau/easyconfig.v1/cflag"
+import "gopkg.in/hlandau/svcutils.v1/exepath"
+import "fmt"
+
+var (
+	eventLogFlag         = cflag.Bool(flagGroup, "eventlog", false, "Log to event log?")
+	eventLogNameFlag     = cflag.String(flagGroup, "eventlogname", "", "Event log source name (uses .exe program name if unset)")
+	eventLogSeverityFlag = cflag.String(flagGroup, "eventlogseverity", "DEBUG", "Event log severity limit")
+)
+
+func openEventLog() {
+	var err error
+
+	if !eventLogFlag.Value() {
+		return
+	}
+
+	pn := eventLogNameFlag.Value()
+
+	if pn == "" {
+		pn = exepath.ProgramName
+	}
+
+	esink.Log, err = eventlog.Open(pn)
+	if err != nil {
+		return
+	}
+
+	if sev, ok := xlog.ParseSeverity(eventLogSeverityFlag.Value()); ok {
+		esink.MinSeverity = sev
+	}
+
+	xlog.RootSink.Add(&esink)
+}
+
+type eventSink struct {
+	Log         *eventlog.Log
+	MinSeverity xlog.Severity
+}
+
+func (s *eventSink) ReceiveLocally(sev xlog.Severity, format string, params ...interface{}) {
+	s.ReceiveFromChild(sev, format, params...)
+}
+
+func (s *eventSink) ReceiveFromChild(sev xlog.Severity, format string, params ...interface{}) {
+	if sev > s.MinSeverity {
+		return
+	}
+
+	var eid uint32
+	eid = 1
+
+	msg := fmt.Sprintf(format, params...)
+
+	if sev <= xlog.SevError {
+		s.Log.Error(eid, msg)
+	} else if sev <= xlog.SevWarn {
+		s.Log.Warning(eid, msg)
+	} else {
+		s.Log.Info(eid, msg)
+	}
+
+	// ignore errors
+}
+
+var esink = eventSink{
+	MinSeverity: xlog.SevDebug,
+}
+
 func openSyslog()  {}
 func openJournal() {}
diff --git a/syslogconfig.go b/syslogconfig.go
index 5579ab2..d0f7604 100644
--- a/syslogconfig.go
+++ b/syslogconfig.go
@@ -112,3 +112,5 @@ func (s *journalSink) ReceiveFromChild(sev xlog.Severity, format string, params
 var jsink = journalSink{
 	MinSeverity: xlog.SevDebug,
 }
+
+func openEventLog() {}
diff --git a/xlogconfig.go b/xlogconfig.go
index 9960355..219bdd3 100644
--- a/xlogconfig.go
+++ b/xlogconfig.go
@@ -9,7 +9,7 @@ import "gopkg.in/hlandau/svcutils.v1/systemd"
 
 var (
 	flagGroup          = cflag.NewGroup(nil, "xlog")
-	logSeverityFlag    = cflag.String(flagGroup, "severity", "NOTICE", "Log severity (any syslog severity name or number)")
+	logSeverityFlag    = cflag.String(flagGroup, "severity", "NOTICE", "Log severity (any syslog severity name or number (0-7) or 'trace' (8) (most verbose))")
 	logFileFlag        = cflag.String(flagGroup, "file", "", "Log to filename")
 	fileSeverityFlag   = cflag.String(flagGroup, "fileseverity", "TRACE", "File logging severity limit")
 	logStderrFlag      = cflag.Bool(flagGroup, "stderr", true, "Log to stderr?")
@@ -72,5 +72,6 @@ func Init() {
 	openStderr()
 	openSyslog()
 	openJournal()
+	openEventLog()
 	openFile()
 }

Debdiff

File lists identical (after any substitutions)

No differences were encountered in the control files

More details

Full run details