From 7dbb48f5c1bb344dad94b3c5f7b4a587952d9a05 Mon Sep 17 00:00:00 2001 From: richardsonjack Date: Thu, 24 May 2018 11:58:53 +0930 Subject: [PATCH] Update to use new logger --- RevidCLI.go | 6 +++--- revid/Revid.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/RevidCLI.go b/RevidCLI.go index 8330df3f..48112e17 100644 --- a/RevidCLI.go +++ b/RevidCLI.go @@ -257,14 +257,14 @@ func main() { for *netSenderFlagPtr { varsChanged, err := netSend() if err != nil { - config.Logger.Log("Error", err.Error()) + config.logger.log("revidCLI","Error", err.Error()) time.Sleep(time.Duration(netSendRetryTime) * time.Second) continue } if varsChanged { if vars["mode"] == "Paused" { if !paused { - config.Logger.Log("Info", "Pausing revid") + config.logger.log("revidCLI","Info", "Pausing revid") stopRevid() paused = true } @@ -477,7 +477,7 @@ func createRevidInstance() { // If the config does have a logger, use it to output error, otherwise // just output to std output if config.Logger != nil { - config.Logger.Log("FATAL ERROR", err.Error()) + config.logger.log("revidCLI","FATAL ERROR", err.Error()) } else { fmt.Printf("FATAL ERROR: %v", err.Error()) } diff --git a/revid/Revid.go b/revid/Revid.go index 46600e88..4753bf90 100644 --- a/revid/Revid.go +++ b/revid/Revid.go @@ -229,7 +229,7 @@ func (r *revid) ChangeConfig(config Config) (err error) { func (r *revid) Log(logType, m string) { if r.config.Verbosity == Yes { if r.config.Logger != nil { - r.config.Logger.Log(logType, m) + r.config.logger.log("revid",logType, m) return } fmt.Println(logType + ": " + m)