[VOL-1414] Update voltha CLI to support dynamic logging. This
update also cleans up the log library as well as remove XPON
from the CLI.
Change-Id: Ife44abdcca7ac078f29db297d94a4b96f66b1514
diff --git a/rw_core/core/grpc_nbi_api_handler.go b/rw_core/core/grpc_nbi_api_handler.go
index 0cb9a14..d11c420 100644
--- a/rw_core/core/grpc_nbi_api_handler.go
+++ b/rw_core/core/grpc_nbi_api_handler.go
@@ -128,9 +128,13 @@
}
func (handler *APIHandler) UpdateLogLevel(ctx context.Context, logging *voltha.Logging) (*empty.Empty, error) {
- log.Debugw("UpdateLogLevel-request", log.Fields{"newloglevel": logging.Level, "intval": int(logging.Level)})
+ log.Debugw("UpdateLogLevel-request", log.Fields{"package": logging.PackageName, "intval": int(logging.Level)})
out := new(empty.Empty)
- log.SetPackageLogLevel(logging.PackageName, int(logging.Level))
+ if logging.PackageName == "" {
+ log.SetAllLogLevel(int(logging.Level))
+ } else {
+ log.SetPackageLogLevel(logging.PackageName, int(logging.Level))
+ }
return out, nil
}