From ecd418c96cced150be4a864fa2e43d11bb9a2fc3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E5=85=89=E6=98=A5?=
Date: Fri, 8 Sep 2023 13:28:57 +0800
Subject: [PATCH] - update log
---
library.go | 2 +-
utils/golog/slog.go | 16 ++++++++--------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/library.go b/library.go
index 8258192e..4817dd27 100644
--- a/library.go
+++ b/library.go
@@ -1,5 +1,5 @@
package go_library
func Version() string {
- return "1.0.164"
+ return "1.0.165"
}
diff --git a/utils/golog/slog.go b/utils/golog/slog.go
index e11bebff..a51f0f0d 100644
--- a/utils/golog/slog.go
+++ b/utils/golog/slog.go
@@ -154,8 +154,8 @@ type LoggerOperation struct {
}
// Debug logs at LevelDebug.
-func (l *LoggerOperation) Debug(msg string, args ...any) {
- l.logger.Debug(msg, args...)
+func (l *LoggerOperation) Debug(msg any) {
+ l.logger.Debug(fmt.Sprintf("%v", msg))
}
// Debugf formats the message according to the format specifier
@@ -169,8 +169,8 @@ func (l *LoggerOperation) DebugContext(ctx context.Context, msg string, args ...
}
// Info logs at LevelInfo.
-func (l *LoggerOperation) Info(msg string, args ...any) {
- l.logger.Info(msg, args...)
+func (l *LoggerOperation) Info(msg any) {
+ l.logger.Info(fmt.Sprintf("%v", msg))
}
// Infof formats the message according to the format specifier
@@ -184,8 +184,8 @@ func (l *LoggerOperation) InfoContext(ctx context.Context, msg string, args ...a
}
// Warn logs at LevelWarn.
-func (l *LoggerOperation) Warn(msg string, args ...any) {
- l.logger.Warn(msg, args...)
+func (l *LoggerOperation) Warn(msg any) {
+ l.logger.Warn(fmt.Sprintf("%v", msg))
}
// Warnf formats the message according to the format specifier
@@ -198,8 +198,8 @@ func (l *LoggerOperation) WarnContext(ctx context.Context, msg string, args ...a
}
// Error logs at LevelError.
-func (l *LoggerOperation) Error(msg string, args ...any) {
- l.logger.Error(msg, args...)
+func (l *LoggerOperation) Error(msg any) {
+ l.logger.Error(fmt.Sprintf("%v", msg))
}
// Errorf formats the message according to the format specifier