Copilot commented on code in PR #2838:
URL: https://github.com/apache/dubbo-go/pull/2838#discussion_r2048389103
##########
logger/logger.go:
##########
@@ -19,21 +19,64 @@
package logger
import (
- "gopkg.in/natefinch/lumberjack.v2"
-)
+ dubbogoLogger "github.com/dubbogo/gost/log/logger"
-import (
- "dubbo.apache.org/dubbo-go/v3/common"
- "dubbo.apache.org/dubbo-go/v3/common/constant"
+ "go.uber.org/zap"
+ "go.uber.org/zap/zapcore"
)
-func FileConfig(config *common.URL) *lumberjack.Logger {
- return &lumberjack.Logger{
- Filename: config.GetParam(constant.LoggerFileNameKey,
"dubbo.log"),
- MaxSize:
config.GetParamByIntValue(constant.LoggerFileNaxSizeKey, 1),
- MaxBackups:
config.GetParamByIntValue(constant.LoggerFileMaxBackupsKey, 1),
- MaxAge:
config.GetParamByIntValue(constant.LoggerFileMaxAgeKey, 3),
- LocalTime:
config.GetParamBool(constant.LoggerFileLocalTimeKey, true),
- Compress: config.GetParamBool(constant.LoggerFileCompressKey,
true),
+var logger Logger
+
+func init() {
+ dubbogoLogger.InitLogger(nil)
+}
+
+// SetLogger sets logger for dubbo and getty
+func SetLogger(log Logger) {
+ logger = log
+}
+
+// GetLogger gets the loggerF
+func GetLogger() Logger {
+ return logger
+}
+
+// SetLoggerLevel use for set logger level
Review Comment:
[nitpick] Update the comment to improve grammar and clarity, for example:
'SetLoggerLevel is used to set the logger level.'
```suggestion
// SetLoggerLevel is used to set the logger level.
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]