You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by "craigcondit (via GitHub)" <gi...@apache.org> on 2023/06/13 15:47:01 UTC
[GitHub] [yunikorn-k8shim] craigcondit commented on a diff in pull request #611: [YUNIKORN-1797] K8Shim: Implement scoped logging
craigcondit commented on code in PR #611:
URL: https://github.com/apache/yunikorn-k8shim/pull/611#discussion_r1228355723
##########
pkg/log/logger.go:
##########
@@ -30,13 +33,99 @@ var once sync.Once
var logger *zap.Logger
var zapConfigs *zap.Config
+// LoggerHandle is used to efficiently look up logger references
+type LoggerHandle struct {
+ name string
+}
+
+func (h LoggerHandle) String() string {
+ return h.name
+}
+
+// Logger names
+const (
+ defaultLog = "log.level"
+ logPrefix = "log."
+ levelSuffix = ".level"
+)
+
+var K8Shim = LoggerHandle{name: "k8shim"}
+var Kubernetes = LoggerHandle{name: "kubernetes"}
+var Admission = LoggerHandle{name: "admission"}
+var Test = LoggerHandle{name: "test"}
Review Comment:
This doesn't work because the core and shim loggers are managed separately. The performance impact of these changes is already negligible.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@yunikorn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org