[VOL-2694] Use package specific logger instance in all log statements
Change-Id: Id216765f347be95872b820b63133daef7d2a7bbb
diff --git a/internal/pkg/openflow/client.go b/internal/pkg/openflow/client.go
index f43bb11..94ad645 100644
--- a/internal/pkg/openflow/client.go
+++ b/internal/pkg/openflow/client.go
@@ -31,7 +31,6 @@
"time"
)
-var logger, _ = log.AddPackage(log.JSON, log.DebugLevel, nil)
var NoVolthaConnectionError = errors.New("no-voltha-connection")
type ofcEvent byte
@@ -246,7 +245,7 @@
}
go func() {
if err := ofc.establishConnectionToController(); err != nil {
- log.Errorw("controller-connection-failed", log.Fields{"error": err})
+ logger.Errorw("controller-connection-failed", log.Fields{"error": err})
panic(err)
}
}()
@@ -282,19 +281,19 @@
// If the child context exists, then cancel it
if ofDone != nil {
- log.Debugw("closing-child-processes",
+ logger.Debugw("closing-child-processes",
log.Fields{"device-id": ofc.DeviceID})
ofDone()
}
// If the connection is open, then close it
if ofc.conn != nil {
- log.Debugw("closing-of-connection",
+ logger.Debugw("closing-of-connection",
log.Fields{"device-id": ofc.DeviceID})
ofc.conn.Close()
ofc.conn = nil
}
- log.Debugw("state-machine-finished",
+ logger.Debugw("state-machine-finished",
log.Fields{"device-id": ofc.DeviceID})
}