You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by so...@apache.org on 2022/11/17 08:36:01 UTC
[apisix-go-plugin-runner] branch master updated: feat: make GetLogger public (#115)
This is an automated email from the ASF dual-hosted git repository.
soulbird pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-go-plugin-runner.git
The following commit(s) were added to refs/heads/master by this push:
new cc61adc feat: make GetLogger public (#115)
cc61adc is described below
commit cc61adcdade8ec9a6687b4b6ec133d2a50c9cc14
Author: 刘奕聪 <im...@gmail.com>
AuthorDate: Thu Nov 17 16:35:55 2022 +0800
feat: make GetLogger public (#115)
Co-authored-by: yakovliu <ya...@tencent.com>
---
pkg/log/log.go | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/pkg/log/log.go b/pkg/log/log.go
index 3a3639c..9883fa4 100644
--- a/pkg/log/log.go
+++ b/pkg/log/log.go
@@ -43,7 +43,7 @@ func NewLogger(level zapcore.Level, out zapcore.WriteSyncer) {
logger = lg.Sugar()
}
-func getLogger() *zap.SugaredLogger {
+func GetLogger() *zap.SugaredLogger {
loggerInit.Do(func() {
if logger == nil {
// logger is not initialized, for example, running `go test`
@@ -54,21 +54,21 @@ func getLogger() *zap.SugaredLogger {
}
func Debugf(template string, args ...interface{}) {
- getLogger().Debugf(template, args...)
+ GetLogger().Debugf(template, args...)
}
func Infof(template string, args ...interface{}) {
- getLogger().Infof(template, args...)
+ GetLogger().Infof(template, args...)
}
func Warnf(template string, args ...interface{}) {
- getLogger().Warnf(template, args...)
+ GetLogger().Warnf(template, args...)
}
func Errorf(template string, args ...interface{}) {
- getLogger().Errorf(template, args...)
+ GetLogger().Errorf(template, args...)
}
func Fatalf(template string, args ...interface{}) {
- getLogger().Fatalf(template, args...)
+ GetLogger().Fatalf(template, args...)
}