调整日志和封装优先级代码

This commit is contained in:
Yun
2025-07-24 17:13:17 +08:00
parent ecaac58926
commit 037d8cf107
8 changed files with 256 additions and 8 deletions
+8 -4
View File
@@ -1,9 +1,13 @@
package timerx
import "time"
import (
"time"
"github.com/yuninks/timerx/logger"
)
type Options struct {
logger Logger
logger logger.Logger
location *time.Location
timeout time.Duration
priority int
@@ -11,7 +15,7 @@ type Options struct {
func defaultOptions() Options {
return Options{
logger: NewLogger(),
logger: logger.NewLogger(),
location: time.Local,
timeout: time.Hour,
priority: 0,
@@ -29,7 +33,7 @@ func newOptions(opts ...Option) Options {
}
// 设置日志
func SetLogger(log Logger) Option {
func SetLogger(log logger.Logger) Option {
return func(o *Options) {
o.logger = log
}