From 0646c364915a1fa01c624a4122c8ead15c4a14f2 Mon Sep 17 00:00:00 2001 From: Trek H Date: Thu, 10 Sep 2020 13:06:22 +0930 Subject: [PATCH 1/2] treat: nil read pin and add debug logging --- cmd/treatment/main.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/treatment/main.go b/cmd/treatment/main.go index 6d9fbb48..c7cea7d7 100644 --- a/cmd/treatment/main.go +++ b/cmd/treatment/main.go @@ -62,7 +62,7 @@ const ( logMaxSize = 500 // MB logMaxBackup = 10 logMaxAge = 28 // days - logVerbosity = logger.Info + logVerbosity = logger.Debug logSuppress = true ) @@ -113,14 +113,14 @@ func main() { // The netsender client will handle communication with netreceiver and GPIO stuff. log.Log(logger.Debug, "initialising netsender client") - ns, err := netsender.New(log, gpio.InitPin, gpio.ReadPin, gpio.WritePin, varMap) + ns, err := netsender.New(log, gpio.InitPin, nil, gpio.WritePin, varMap) if err != nil { log.Log(logger.Fatal, "could not initialise netsender client", "error", err.Error()) } // Revid will handle the recording and sending of audio for sound checking. log.Log(logger.Debug, "initialising revid") - rv, err := revid.New(config.Config{Logger: log}, ns) + rv, err := revid.New(config.Config{Logger: log, LogLevel: logger.Debug}, ns) if err != nil { log.Log(logger.Fatal, "could not initialise revid", "error", err.Error()) } @@ -208,6 +208,9 @@ func run(rv *revid.Revid, ns *netsender.Sender, file *string, l *logger.Logger, sleep(ns, l) continue } + default: + l.Log(logger.Warning, "mode is not valid", "mode", ns.Mode()) + } l.Log(logger.Info, "revid updated with new mode") sleep(ns, l) From 52e7881b62cba4c110add11acf68d59d18a2891c Mon Sep 17 00:00:00 2001 From: Trek H Date: Mon, 14 Sep 2020 11:22:11 +0930 Subject: [PATCH 2/2] treat: removed debug by default --- cmd/treatment/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/treatment/main.go b/cmd/treatment/main.go index c7cea7d7..d716c7d8 100644 --- a/cmd/treatment/main.go +++ b/cmd/treatment/main.go @@ -62,7 +62,7 @@ const ( logMaxSize = 500 // MB logMaxBackup = 10 logMaxAge = 28 // days - logVerbosity = logger.Debug + logVerbosity = logger.Info logSuppress = true ) @@ -120,7 +120,7 @@ func main() { // Revid will handle the recording and sending of audio for sound checking. log.Log(logger.Debug, "initialising revid") - rv, err := revid.New(config.Config{Logger: log, LogLevel: logger.Debug}, ns) + rv, err := revid.New(config.Config{Logger: log}, ns) if err != nil { log.Log(logger.Fatal, "could not initialise revid", "error", err.Error()) }