From a4616cf1d9b241dfd48d22ac48736f4eee68f51c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignas=20Vy=C5=A1niauskas?= Date: Mon, 19 Jan 2026 14:20:11 +0200 Subject: [PATCH 1/4] Drop systemInfo from log entries It is no longer useful since we do not centrally collect the logs and wastes a lot of log storage space. --- src/dividat-driver/server/main.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/dividat-driver/server/main.go b/src/dividat-driver/server/main.go index 94f5bfe..55710b1 100644 --- a/src/dividat-driver/server/main.go +++ b/src/dividat-driver/server/main.go @@ -37,12 +37,6 @@ func Start(logger *logrus.Logger, origins []string) context.CancelFunc { baseLog.WithError(err).Panic("Could not get system information.") } - baseLog = baseLog.WithFields(logrus.Fields{ - "machineId": systemInfo.MachineId, - "os": systemInfo.Os, - "arch": systemInfo.Arch, - }) - baseLog.Info("Dividat Driver starting") // Setup log endpoint From 54b7df7fd6fa39b4e58ddf0f4d518e218d5ad745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignas=20Vy=C5=A1niauskas?= Date: Mon, 19 Jan 2026 14:22:13 +0200 Subject: [PATCH 2/4] Drop the self-heap-monitor Upcoming PlayOS metric collection will be used for observation of memory usage. --- src/dividat-driver/server/main.go | 3 --- src/dividat-driver/server/monitor.go | 19 ------------------- 2 files changed, 22 deletions(-) delete mode 100644 src/dividat-driver/server/monitor.go diff --git a/src/dividat-driver/server/main.go b/src/dividat-driver/server/main.go index 55710b1..c4b061e 100644 --- a/src/dividat-driver/server/main.go +++ b/src/dividat-driver/server/main.go @@ -62,9 +62,6 @@ func Start(logger *logrus.Logger, origins []string) context.CancelFunc { // Create a logger for server log := baseLog.WithField("package", "server") - // Start the monitor - go startMonitor(baseLog.WithField("package", "monitor")) - // Setup HTTP Server server := http.Server{Addr: "127.0.0.1:" + serverPort} diff --git a/src/dividat-driver/server/monitor.go b/src/dividat-driver/server/monitor.go deleted file mode 100644 index 95f9121..0000000 --- a/src/dividat-driver/server/monitor.go +++ /dev/null @@ -1,19 +0,0 @@ -package server - -import ( - "runtime" - "time" - - "github.com/sirupsen/logrus" -) - -func startMonitor(log *logrus.Entry) { - var m runtime.MemStats - - c := time.NewTicker(30 * time.Second).C - - for range c { - runtime.ReadMemStats(&m) - log.WithField("heapAlloc", m.HeapAlloc).WithField("routines", runtime.NumGoroutine()).Info("Monitoring runtime.") - } -} From 52a51ef8b583ffa083a7c8aa5768ae4edd37a39b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignas=20Vy=C5=A1niauskas?= Date: Mon, 19 Jan 2026 15:50:39 +0200 Subject: [PATCH 3/4] Log legacy data channel connection attempts at Debug level --- src/dividat-driver/senso/main.go | 4 ++-- src/dividat-driver/senso/tcp.go | 14 +++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/dividat-driver/senso/main.go b/src/dividat-driver/senso/main.go index 2b0ce4f..4a36d10 100644 --- a/src/dividat-driver/senso/main.go +++ b/src/dividat-driver/senso/main.go @@ -72,9 +72,9 @@ func (handle *Handle) Connect(address string) { handle.broker.TryPub(data, "rx") } - go connectTCP(ctx, handle.log.WithField("channel", "data"), address+":55568", handle.broker.Sub("noTx"), onReceive) + go connectTCP(ctx, handle.log.WithField("channel", "data"), address+":55568", handle.broker.Sub("noTx"), onReceive, true) time.Sleep(1000 * time.Millisecond) - go connectTCP(ctx, handle.log.WithField("channel", "control"), address+":55567", handle.broker.Sub("tx"), onReceive) + go connectTCP(ctx, handle.log.WithField("channel", "control"), address+":55567", handle.broker.Sub("tx"), onReceive, false) handle.cancelCurrentConnection = cancel } diff --git a/src/dividat-driver/senso/tcp.go b/src/dividat-driver/senso/tcp.go index 6794063..31c2d77 100644 --- a/src/dividat-driver/senso/tcp.go +++ b/src/dividat-driver/senso/tcp.go @@ -20,11 +20,19 @@ const maxInterval = 30 * time.Second type onReceive = func([]byte) // connectTCP creates a persistent tcp connection to address -func connectTCP(ctx context.Context, baseLogger *logrus.Entry, address string, tx chan interface{}, onReceive onReceive) { +// isOptional is used when connecting to the data channel, which is used only in legacy Senso firmware +func connectTCP(ctx context.Context, baseLogger *logrus.Entry, address string, tx chan interface{}, onReceive onReceive, isOptional bool) { var dialer net.Dialer var log = baseLogger.WithField("address", address) + var connectionAttemptLogLevel logrus.Level + if isOptional { + connectionAttemptLogLevel = logrus.DebugLevel + } else { + connectionAttemptLogLevel = logrus.InfoLevel + } + var conn net.Conn dialTCP := func() error { @@ -34,11 +42,11 @@ func connectTCP(ctx context.Context, baseLogger *logrus.Entry, address string, t conn.Close() } - log.Info("Dialing TCP connection.") + log.Log(connectionAttemptLogLevel, "Dialing TCP connection.") conn, connErr = dialer.DialContext(ctx, "tcp", address) if connErr != nil { - log.WithError(connErr).Info("Could not connect with Senso.") + log.WithError(connErr).Log(connectionAttemptLogLevel, "Could not connect with Senso.") } return connErr } From 8093a4bbbf4c9ac536a69a26284a4f0b5e5f2d52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignas=20Vy=C5=A1niauskas?= Date: Mon, 19 Jan 2026 15:58:13 +0200 Subject: [PATCH 4/4] Update Changelog --- Changelog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changelog.md b/Changelog.md index 074fafc..8108a91 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,8 @@ ## [UNRELEASED] +- Reduce log metadata and volume + ## [2.7.0] - 2025-10-15 ### Added