From 5f9b83633f1bb9b75c66f6411f6f63b3d6023e14 Mon Sep 17 00:00:00 2001 From: aajkl Date: Sat, 29 Jun 2024 12:02:37 +0800 Subject: [PATCH] replace log with core log --- cmd/vmihub/main.go | 13 +++- go.mod | 3 +- go.sum | 8 ++- internal/api/image/chunk.go | 2 +- internal/api/image/image.go | 2 +- internal/api/image/util.go | 2 +- internal/api/user/user.go | 2 +- internal/common/image.go | 2 +- internal/common/user.go | 2 +- internal/log/field.go | 78 -------------------- internal/log/inner.go | 62 ---------------- internal/log/log.go | 108 ---------------------------- internal/log/sentry.go | 72 ------------------- internal/middlewares/gin_zerolog.go | 8 +-- internal/storage/s3/s3.go | 2 +- internal/testutils/utils.go | 13 +++- internal/utils/retry.go | 2 +- 17 files changed, 42 insertions(+), 339 deletions(-) delete mode 100644 internal/log/field.go delete mode 100644 internal/log/inner.go delete mode 100644 internal/log/log.go delete mode 100644 internal/log/sentry.go diff --git a/cmd/vmihub/main.go b/cmd/vmihub/main.go index 4943d42..27bc906 100644 --- a/cmd/vmihub/main.go +++ b/cmd/vmihub/main.go @@ -13,9 +13,10 @@ import ( "github.com/gin-gonic/gin" "github.com/gin-gonic/gin/binding" "github.com/go-playground/validator/v10" + "github.com/projecteru2/core/log" + "github.com/projecteru2/core/types" "github.com/projecteru2/vmihub/config" "github.com/projecteru2/vmihub/internal/api" - "github.com/projecteru2/vmihub/internal/log" "github.com/projecteru2/vmihub/internal/models" storFact "github.com/projecteru2/vmihub/internal/storage/factory" "github.com/projecteru2/vmihub/internal/utils" @@ -83,7 +84,15 @@ func runServer(_ *cli.Context) error { ctx, cancel := signal.NotifyContext(context.TODO(), syscall.SIGINT, syscall.SIGTERM) defer cancel() - if err := log.SetupLog(ctx, &cfg.Log); err != nil { + logCfg := &types.ServerLogConfig{ + Level: cfg.Log.Level, + UseJSON: cfg.Log.UseJSON, + Filename: cfg.Log.Filename, + MaxSize: cfg.Log.MaxSize, + MaxAge: cfg.Log.MaxAge, + MaxBackups: cfg.Log.MaxBackups, + } + if err := log.SetupLog(ctx, logCfg, cfg.Log.SentryDSN); err != nil { zerolog.Fatal().Err(err).Send() } defer log.SentryDefer() diff --git a/go.mod b/go.mod index 16f97b4..6d4f168 100644 --- a/go.mod +++ b/go.mod @@ -35,6 +35,7 @@ require ( github.com/panjf2000/ants/v2 v2.7.3 github.com/pelletier/go-toml v1.9.5 github.com/pkg/errors v0.9.1 + github.com/projecteru2/core v0.0.0-20240614132727-08e4fbc219d1 github.com/rbcervilla/redisstore/v9 v9.0.0 github.com/redis/go-redis/v9 v9.5.1 github.com/rs/zerolog v1.30.0 @@ -76,7 +77,7 @@ require ( github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/goccy/go-json v0.10.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect github.com/gorilla/context v1.1.2 // indirect diff --git a/go.sum b/go.sum index c25b9ee..3493447 100644 --- a/go.sum +++ b/go.sum @@ -135,8 +135,8 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0= github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -247,6 +247,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/projecteru2/core v0.0.0-20240614132727-08e4fbc219d1 h1:ckh4IsnppXEbe9vb3Au4lKO5Z7ZNqanNBLdWViBdvxI= +github.com/projecteru2/core v0.0.0-20240614132727-08e4fbc219d1/go.mod h1:JDOLwVw4EdLTk+bqI/LdU4Ix/Wl6BaaHMzaOO5vpU8U= github.com/rbcervilla/redisstore/v9 v9.0.0 h1:wOPbBaydbdxzi1gTafDftCI/Z7vnsXw0QDPCuhiMG0g= github.com/rbcervilla/redisstore/v9 v9.0.0/go.mod h1:q/acLpoKkTZzIsBYt0R4THDnf8W/BH6GjQYvxDSSfdI= github.com/redis/go-redis/v9 v9.0.3/go.mod h1:WqMKv5vnQbRuZstUwxQI195wHy+t4PuXDOjzMvcuQHk= @@ -320,6 +322,8 @@ go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= +go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/arch v0.7.0 h1:pskyeJh/3AmoQ8CPE95vxHLqp1G1GfGNXTmcl9NEKTc= golang.org/x/arch v0.7.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= diff --git a/internal/api/image/chunk.go b/internal/api/image/chunk.go index 99146ff..6bcfdfe 100644 --- a/internal/api/image/chunk.go +++ b/internal/api/image/chunk.go @@ -16,8 +16,8 @@ import ( "github.com/gin-gonic/gin/binding" "github.com/mcuadros/go-defaults" + "github.com/projecteru2/core/log" "github.com/projecteru2/vmihub/internal/common" - "github.com/projecteru2/vmihub/internal/log" "github.com/projecteru2/vmihub/internal/models" storFact "github.com/projecteru2/vmihub/internal/storage/factory" stotypes "github.com/projecteru2/vmihub/internal/storage/types" diff --git a/internal/api/image/image.go b/internal/api/image/image.go index 090974f..12fa37b 100644 --- a/internal/api/image/image.go +++ b/internal/api/image/image.go @@ -12,8 +12,8 @@ import ( "sync" "sync/atomic" + "github.com/projecteru2/core/log" "github.com/projecteru2/vmihub/internal/common" - "github.com/projecteru2/vmihub/internal/log" storFact "github.com/projecteru2/vmihub/internal/storage/factory" storTypes "github.com/projecteru2/vmihub/internal/storage/types" diff --git a/internal/api/image/util.go b/internal/api/image/util.go index da42d22..94b1cb0 100644 --- a/internal/api/image/util.go +++ b/internal/api/image/util.go @@ -12,8 +12,8 @@ import ( "github.com/dustin/go-humanize" "github.com/gin-gonic/gin" "github.com/google/uuid" + "github.com/projecteru2/core/log" "github.com/projecteru2/vmihub/internal/common" - "github.com/projecteru2/vmihub/internal/log" "github.com/projecteru2/vmihub/internal/models" "github.com/projecteru2/vmihub/internal/utils" "github.com/projecteru2/vmihub/pkg/terrors" diff --git a/internal/api/user/user.go b/internal/api/user/user.go index c9ccc50..32c2969 100644 --- a/internal/api/user/user.go +++ b/internal/api/user/user.go @@ -10,9 +10,9 @@ import ( "github.com/dgrijalva/jwt-go" "github.com/gin-gonic/gin" "github.com/gin-gonic/gin/binding" + "github.com/projecteru2/core/log" "github.com/projecteru2/vmihub/config" "github.com/projecteru2/vmihub/internal/common" - "github.com/projecteru2/vmihub/internal/log" "github.com/projecteru2/vmihub/internal/middlewares" "github.com/projecteru2/vmihub/internal/models" "github.com/projecteru2/vmihub/internal/utils" diff --git a/internal/common/image.go b/internal/common/image.go index 158ecc4..394ca4f 100644 --- a/internal/common/image.go +++ b/internal/common/image.go @@ -4,7 +4,7 @@ import ( "net/http" "github.com/gin-gonic/gin" - "github.com/projecteru2/vmihub/internal/log" + "github.com/projecteru2/core/log" "github.com/projecteru2/vmihub/internal/models" "github.com/projecteru2/vmihub/pkg/terrors" ) diff --git a/internal/common/user.go b/internal/common/user.go index ff21866..e21df0b 100644 --- a/internal/common/user.go +++ b/internal/common/user.go @@ -10,8 +10,8 @@ import ( "github.com/cockroachdb/errors" "github.com/gin-contrib/sessions" "github.com/gin-gonic/gin" + "github.com/projecteru2/core/log" "github.com/projecteru2/vmihub/config" - "github.com/projecteru2/vmihub/internal/log" "github.com/projecteru2/vmihub/internal/models" "github.com/projecteru2/vmihub/pkg/terrors" ) diff --git a/internal/log/field.go b/internal/log/field.go deleted file mode 100644 index 23feb9f..0000000 --- a/internal/log/field.go +++ /dev/null @@ -1,78 +0,0 @@ -package log - -import ( - "context" - - "github.com/alphadose/haxmap" -) - -// Fields is a wrapper for zerolog.Entry -// we need to insert some sentry captures here -type Fields struct { - kv *haxmap.Map[string, any] -} - -// WithFunc is short for WithField -func WithFunc(fname string) *Fields { - return WithField("func", fname) -} - -// WithField add kv into log entry -func WithField(key string, value any) *Fields { - r := haxmap.New[string, any]() - r.Set(key, value) - return &Fields{ - kv: r, - } -} - -// WithField . -func (f *Fields) WithField(key string, value any) *Fields { - f.kv.Set(key, value) - return f -} - -// Fatalf forwards to sentry -func (f Fields) Fatalf(ctx context.Context, err error, format string, args ...any) { - fatalf(ctx, err, format, f.kv, args...) -} - -// Warnf is Warnf -func (f Fields) Warnf(ctx context.Context, format string, args ...any) { - warnf(ctx, format, f.kv, args...) -} - -// Warn is Warn -func (f Fields) Warn(ctx context.Context, args ...any) { - f.Warnf(ctx, "%+v", args...) -} - -// Infof is Infof -func (f Fields) Infof(ctx context.Context, format string, args ...any) { - infof(ctx, format, f.kv, args...) -} - -// Info is Info -func (f Fields) Info(ctx context.Context, args ...any) { - f.Infof(ctx, "%+v", args...) -} - -// Debugf is Debugf -func (f Fields) Debugf(ctx context.Context, format string, args ...any) { - debugf(ctx, format, f.kv, args...) -} - -// Debug is Debug -func (f Fields) Debug(ctx context.Context, args ...any) { - f.Debugf(ctx, "%+v", args...) -} - -// Errorf forwards to sentry -func (f Fields) Errorf(ctx context.Context, err error, format string, args ...any) { - errorf(ctx, err, format, f.kv, args...) -} - -// Error forwards to sentry -func (f Fields) Error(ctx context.Context, err error, args ...any) { - f.Errorf(ctx, err, "%+v", args...) -} diff --git a/internal/log/inner.go b/internal/log/inner.go deleted file mode 100644 index 52cbd85..0000000 --- a/internal/log/inner.go +++ /dev/null @@ -1,62 +0,0 @@ -package log - -import ( - "context" - - "github.com/alphadose/haxmap" - "github.com/getsentry/sentry-go" - "github.com/rs/zerolog" -) - -func fatalf(ctx context.Context, err error, format string, fields *haxmap.Map[string, any], args ...any) { - args = argsValidate(args) - reportToSentry(ctx, sentry.LevelFatal, err, format, args...) - f := globalLogger.Fatal() - wrap(f, fields).Err(err).Msgf(format, args...) -} - -func warnf(_ context.Context, format string, fields *haxmap.Map[string, any], args ...any) { - args = argsValidate(args) - f := globalLogger.Warn() - wrap(f, fields).Msgf(format, args...) -} - -func infof(_ context.Context, format string, fields *haxmap.Map[string, any], args ...any) { - args = argsValidate(args) - f := globalLogger.Info() - wrap(f, fields).Msgf(format, args...) -} - -func debugf(_ context.Context, format string, fields *haxmap.Map[string, any], args ...any) { - args = argsValidate(args) - f := globalLogger.Debug() - wrap(f, fields).Msgf(format, args...) -} - -func errorf(ctx context.Context, err error, format string, fields *haxmap.Map[string, any], args ...any) { - if err == nil { - return - } - args = argsValidate(args) - reportToSentry(ctx, sentry.LevelError, err, format, args...) - f := globalLogger.Error() - wrap(f, fields).Stack().Err(err).Msgf(format, args...) -} - -func argsValidate(args []any) []any { - if len(args) > 0 { - return args - } - return []any{""} -} - -func wrap(f *zerolog.Event, kv *haxmap.Map[string, any]) *zerolog.Event { - if kv == nil { - return f - } - kv.ForEach(func(k string, v any) bool { - f = f.Interface(k, v) - return true - }) - return f -} diff --git a/internal/log/log.go b/internal/log/log.go deleted file mode 100644 index 2ec5483..0000000 --- a/internal/log/log.go +++ /dev/null @@ -1,108 +0,0 @@ -package log - -import ( - "context" - "io" - "os" - "strings" - "time" - - "github.com/cockroachdb/errors" - "github.com/getsentry/sentry-go" - "github.com/projecteru2/vmihub/config" - "gopkg.in/natefinch/lumberjack.v2" - - "github.com/rs/zerolog" -) - -var ( - globalLogger zerolog.Logger - sentryDSN string -) - -func GetLogger() *zerolog.Logger { - return &globalLogger -} - -// SetupLog init logger -func SetupLog(ctx context.Context, cfg *config.LogConfig) error { - level, err := zerolog.ParseLevel(strings.ToLower(cfg.Level)) - if err != nil { - return err - } - var writer io.Writer - switch { - case cfg.Filename != "": - // file log always uses json format. - writer = &lumberjack.Logger{ - Filename: cfg.Filename, - MaxBackups: cfg.MaxBackups, // files - MaxSize: cfg.MaxSize, // megabytes - MaxAge: cfg.MaxAge, // days - } - case !cfg.UseJSON: - writer = zerolog.ConsoleWriter{ - Out: os.Stdout, - TimeFormat: time.RFC822, - } - default: - writer = os.Stdout - } - rslog := zerolog.New(writer).With().Timestamp().Logger().Level(level) - zerolog.ErrorStackMarshaler = func(err error) any { - return errors.GetSafeDetails(err).SafeDetails - } - globalLogger = rslog - // Sentry - if cfg.SentryDSN != "" { - sentryDSN = cfg.SentryDSN - WithFunc("log.SetupLog").Infof(ctx, "sentry %v", sentryDSN) - _ = sentry.Init(sentry.ClientOptions{Dsn: sentryDSN}) - } - return nil -} - -// Fatalf forwards to sentry -func Fatalf(ctx context.Context, err error, format string, args ...any) { - fatalf(ctx, err, format, nil, args...) -} - -// Warnf is Warnf -func Warnf(ctx context.Context, format string, args ...any) { - warnf(ctx, format, nil, args...) -} - -// Warn is Warn -func Warn(ctx context.Context, args ...any) { - Warnf(ctx, "%+v", args...) -} - -// Infof is Infof -func Infof(ctx context.Context, format string, args ...any) { - infof(ctx, format, nil, args...) -} - -// Info is Info -func Info(ctx context.Context, args ...any) { - Infof(ctx, "%+v", args...) -} - -// Debugf is Debugf -func Debugf(ctx context.Context, format string, args ...any) { - debugf(ctx, format, nil, args...) -} - -// Debug is Debug -func Debug(ctx context.Context, args ...any) { - Debugf(ctx, "%+v", args...) -} - -// Errorf forwards to sentry -func Errorf(ctx context.Context, err error, format string, args ...any) { - errorf(ctx, err, format, nil, args...) -} - -// Error forwards to sentry -func Error(ctx context.Context, err error, args ...any) { - Errorf(ctx, err, "%+v", args...) -} diff --git a/internal/log/sentry.go b/internal/log/sentry.go deleted file mode 100644 index da2ab92..0000000 --- a/internal/log/sentry.go +++ /dev/null @@ -1,72 +0,0 @@ -package log - -import ( - "context" - "fmt" - "runtime/debug" - "strings" - "time" - - "github.com/cockroachdb/errors" - "github.com/getsentry/sentry-go" - "google.golang.org/grpc/peer" -) - -const ( - TracingID = iota -) - -// SentryDefer . -func SentryDefer() { - if sentryDSN == "" { - return - } - defer sentry.Flush(2 * time.Second) - if r := recover(); r != nil { - sentry.CaptureMessage(fmt.Sprintf("%+v: %s", r, debug.Stack())) - panic(r) - } -} - -func genGRPCTracingInfo(ctx context.Context) (tracingInfo string) { - if ctx == nil { - return "" - } - - tracing := []string{} - if p, ok := peer.FromContext(ctx); ok { - tracing = append(tracing, p.Addr.String()) - } - - if traceID := ctx.Value(TracingID); traceID != nil { - if tid, ok := traceID.(string); ok { - tracing = append(tracing, tid) - } - } - tracingInfo = strings.Join(tracing, "-") - return -} - -func reportToSentry(ctx context.Context, level sentry.Level, err error, format string, args ...any) { - if sentryDSN == "" { - return - } - defer sentry.Flush(2 * time.Second) - event, extraDetails := errors.BuildSentryReport(err) - for k, v := range extraDetails { - event.Extra[k] = v - } - event.Level = level - - if msg := fmt.Sprintf(format, args...); msg != "" { - event.Tags["message"] = msg - } - - if tracingInfo := genGRPCTracingInfo(ctx); tracingInfo != "" { - event.Tags["tracing"] = tracingInfo - } - - if res := string(*sentry.CaptureEvent(event)); res != "" { - WithFunc("log.reportToSentry").WithField("ID", res).Info(ctx, "Report to Sentry") - } -} diff --git a/internal/middlewares/gin_zerolog.go b/internal/middlewares/gin_zerolog.go index f0ed2d2..fcaeb9b 100644 --- a/internal/middlewares/gin_zerolog.go +++ b/internal/middlewares/gin_zerolog.go @@ -4,7 +4,7 @@ import ( "time" "github.com/gin-gonic/gin" - "github.com/projecteru2/vmihub/internal/log" + "github.com/projecteru2/core/log" ) type ginHands struct { @@ -70,7 +70,7 @@ func Logger(serName string) gin.HandlerFunc { func logSwitch(data *ginHands) { switch { case data.StatusCode >= 400 && data.StatusCode < 500: - log.GetLogger().Warn(). + log.GetGlobalLogger().Warn(). Str("ser_name", data.SerName). Str("method", data.Method). Str("path", data.Path). @@ -80,7 +80,7 @@ func logSwitch(data *ginHands) { Msg(data.MsgStr) case data.StatusCode >= 500: //nolint - log.GetLogger().Error(). + log.GetGlobalLogger().Error(). Str("ser_name", data.SerName). Str("method", data.Method). Str("path", data.Path). @@ -90,7 +90,7 @@ func logSwitch(data *ginHands) { Msg(data.MsgStr) default: - log.GetLogger().Info(). + log.GetGlobalLogger().Info(). Str("ser_name", data.SerName). Str("method", data.Method). Str("path", data.Path). diff --git a/internal/storage/s3/s3.go b/internal/storage/s3/s3.go index 9c9ded6..71ab3ac 100644 --- a/internal/storage/s3/s3.go +++ b/internal/storage/s3/s3.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - "github.com/projecteru2/vmihub/internal/log" + "github.com/projecteru2/core/log" stotypes "github.com/projecteru2/vmihub/internal/storage/types" "github.com/aws/aws-sdk-go/aws" diff --git a/internal/testutils/utils.go b/internal/testutils/utils.go index b46c00b..70e7c6a 100644 --- a/internal/testutils/utils.go +++ b/internal/testutils/utils.go @@ -11,8 +11,9 @@ import ( "github.com/cockroachdb/errors" "github.com/gin-contrib/sessions" "github.com/gin-gonic/gin" + "github.com/projecteru2/core/log" + "github.com/projecteru2/core/types" "github.com/projecteru2/vmihub/config" - "github.com/projecteru2/vmihub/internal/log" "github.com/projecteru2/vmihub/internal/middlewares" "github.com/projecteru2/vmihub/internal/models" storFact "github.com/projecteru2/vmihub/internal/storage/factory" @@ -26,7 +27,15 @@ func Prepare(ctx context.Context, t *testing.T) error { if err != nil { return err } - if err := log.SetupLog(ctx, &cfg.Log); err != nil { + logCfg := &types.ServerLogConfig{ + Level: cfg.Log.Level, + UseJSON: cfg.Log.UseJSON, + Filename: cfg.Log.Filename, + MaxSize: cfg.Log.MaxSize, + MaxAge: cfg.Log.MaxAge, + MaxBackups: cfg.Log.MaxBackups, + } + if err := log.SetupLog(ctx, logCfg, cfg.Log.SentryDSN); err != nil { return errors.Newf("Can't initialize log: %v\n", err) } if err := models.Init(&cfg.Mysql, t); err != nil { diff --git a/internal/utils/retry.go b/internal/utils/retry.go index f5320ff..b34548b 100644 --- a/internal/utils/retry.go +++ b/internal/utils/retry.go @@ -4,7 +4,7 @@ import ( "context" "time" - "github.com/projecteru2/vmihub/internal/log" + "github.com/projecteru2/core/log" ) // RetryTask .