[VOL-4760] Log library generalization
Change-Id: I8235413276bdfa07ca6319887b80415077d2ab9d
diff --git a/vendor/github.com/opencord/voltha-lib-go/v7/pkg/log/log.go b/vendor/github.com/opencord/voltha-lib-go/v7/pkg/log/log.go
index 7b1a123..6810fe1 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v7/pkg/log/log.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v7/pkg/log/log.go
@@ -660,3 +660,39 @@
func (l clogger) GetLogLevel() LogLevel {
return levelToLogLevel(cfgs[l.packageName].Level.Level())
}
+
+//UpdateCallerSkipLevel create new loggers for specified registered pacakges with the default updated caller skipltFields.
+//This will enable to skip wrapper file caller in caller info and stacktrace
+func UpdateCallerSkipLevel(skipLevel int) (CLogger, error) {
+ pkgName, _, _, _ := getCallerInfo()
+ if cfg, exist := cfgs[pkgName]; exist {
+ l, err := cfg.Build(zp.AddCallerSkip(skipLevel))
+ if err != nil {
+ return loggers[pkgName], err
+ }
+
+ // Update the existing zap logger instance
+ loggers[pkgName].log = l.Sugar()
+ loggers[pkgName].parent = l
+
+ return loggers[pkgName], nil
+ }
+
+ return loggers[pkgName], errors.New("Package Not Found")
+}
+
+//UpdateAllCallerSkipLevel create new loggers for all registered pacakges with the default updated caller skipltFields.
+//This will enable to skip wrapper file caller in caller info and stacktrace
+func UpdateAllCallerSkipLevel(skipLevel int) error {
+ for pkgName, cfg := range cfgs {
+ l, err := cfg.Build(zp.AddCallerSkip(skipLevel))
+ if err != nil {
+ return err
+ }
+
+ // Update the existing zap logger instance
+ loggers[pkgName].log = l.Sugar()
+ loggers[pkgName].parent = l
+ }
+ return nil
+}
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 809e2e5..fd94487 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -65,7 +65,7 @@
github.com/jessevdk/go-flags
# github.com/mattn/go-runewidth v0.0.10
github.com/mattn/go-runewidth
-# github.com/opencord/voltha-lib-go/v7 v7.2.0
+# github.com/opencord/voltha-lib-go/v7 v7.2.1
## explicit
github.com/opencord/voltha-lib-go/v7/pkg/db/kvstore
github.com/opencord/voltha-lib-go/v7/pkg/flows