Skip to content

Commit

Permalink
add cron logger config.
Browse files Browse the repository at this point in the history
  • Loading branch information
camry committed Sep 20, 2022
1 parent 6ab652d commit 4bc3972
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/gcron/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ type Server struct {
cronOpts []cron.Option
}

// Options 配置 gRPC 选项。
// Logger 配置日志记录器。
func Logger(logger glog.Logger) ServerOption {
return func(s *Server) { s.log = glog.NewHelper(logger) }
}

// Options 配置 Cron 选项。
func Options(cronOpts ...cron.Option) ServerOption {
return func(s *Server) { s.cronOpts = cronOpts }
}
Expand Down

0 comments on commit 4bc3972

Please sign in to comment.