mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-01-05 22:25:48 +08:00
feat: 数据迁移新增实时日志&数据库游标遍历查询问题修复
This commit is contained in:
@@ -4,7 +4,7 @@ import "fmt"
|
||||
|
||||
const (
|
||||
AppName = "mayfly-go"
|
||||
Version = "v1.7.4"
|
||||
Version = "v1.7.5"
|
||||
)
|
||||
|
||||
func GetAppInfo() string {
|
||||
|
||||
@@ -48,6 +48,10 @@ func DebugContext(ctx context.Context, msg string, args ...any) {
|
||||
Log(ctx, slog.LevelDebug, msg, args...)
|
||||
}
|
||||
|
||||
func DebugfContext(ctx context.Context, format string, args ...any) {
|
||||
Log(ctx, slog.LevelDebug, fmt.Sprintf(format, args...))
|
||||
}
|
||||
|
||||
func Debugf(format string, args ...any) {
|
||||
Log(context.Background(), slog.LevelDebug, fmt.Sprintf(format, args...))
|
||||
}
|
||||
@@ -69,6 +73,10 @@ func InfoContext(ctx context.Context, msg string, args ...any) {
|
||||
Log(ctx, slog.LevelInfo, msg, args...)
|
||||
}
|
||||
|
||||
func InfofContext(ctx context.Context, format string, args ...any) {
|
||||
Log(ctx, slog.LevelInfo, fmt.Sprintf(format, args...))
|
||||
}
|
||||
|
||||
func Infof(format string, args ...any) {
|
||||
Log(context.Background(), slog.LevelInfo, fmt.Sprintf(format, args...))
|
||||
}
|
||||
@@ -85,6 +93,10 @@ func WarnContext(ctx context.Context, msg string, args ...any) {
|
||||
Log(ctx, slog.LevelWarn, msg, args...)
|
||||
}
|
||||
|
||||
func WarnfContext(ctx context.Context, format string, args ...any) {
|
||||
Log(ctx, slog.LevelWarn, fmt.Sprintf(format, args...))
|
||||
}
|
||||
|
||||
func Warnf(format string, args ...any) {
|
||||
Log(context.Background(), slog.LevelWarn, fmt.Sprintf(format, args...))
|
||||
}
|
||||
@@ -101,6 +113,10 @@ func ErrorContext(ctx context.Context, msg string, args ...any) {
|
||||
Log(ctx, slog.LevelError, msg, args...)
|
||||
}
|
||||
|
||||
func ErrorfContext(ctx context.Context, format string, args ...any) {
|
||||
Log(ctx, slog.LevelError, fmt.Sprintf(format, args...))
|
||||
}
|
||||
|
||||
func Errorf(format string, args ...any) {
|
||||
Log(context.Background(), slog.LevelError, fmt.Sprintf(format, args...))
|
||||
}
|
||||
|
||||
@@ -42,3 +42,16 @@ func MapValues[M ~map[K]V, K comparable, V any](m M) []V {
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// MapMerge maps merge, 若存在重复的key,则以最后的map值为准
|
||||
func MapMerge[M ~map[K]V, K comparable, V any](maps ...M) M {
|
||||
mergedMap := make(M)
|
||||
|
||||
for _, m := range maps {
|
||||
for k, v := range m {
|
||||
mergedMap[k] = v
|
||||
}
|
||||
}
|
||||
|
||||
return mergedMap
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user