[agent-go] 新增线程池部分代码

This commit is contained in:
zeaslity
2023-03-28 13:47:04 +08:00
parent 31f9267401
commit 84fe111482
6 changed files with 54 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
package g
import (
"fmt"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
@@ -34,16 +35,30 @@ func NewLogger() (*Logger, error) {
return &Logger{logger}, nil
}
func (l *Logger) Printf(msg string, args ...interface{}) {
l.Logger.Info(fmt.Sprintf("%s ==> %v", msg, args))
}
// Debug logs a debug message.
func (l *Logger) Debug(msg string, fields ...zap.Field) {
l.Logger.Debug(msg, fields...)
}
func (l *Logger) DebugF(msg string, args ...interface{}) {
l.Logger.Debug(fmt.Sprintf(msg, args...))
}
// Info logs an info message.
func (l *Logger) Info(msg string, fields ...zap.Field) {
l.Logger.Info(msg, fields...)
}
// InfoF logs an info message with format
func (l *Logger) InfoF(msg string, args ...interface{}) {
l.Logger.Info(fmt.Sprintf(msg, args...))
}
// Warn logs a warning message.
func (l *Logger) Warn(msg string, fields ...zap.Field) {
l.Logger.Warn(msg, fields...)