libi / dcron

轻量分布式定时任务库 a lightweight distributed job scheduler library
MIT License
422 stars 73 forks source link

Added compatible logger injection #84

Closed AH-dark closed 5 months ago

AH-dark commented 6 months ago

In the production environment, we often use a globally unique logger and cooperate with ELK, etc. to collect data. It may be necessary to add an implementation of a common logger.

codecov-commenter commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (68982eb) 84.97% compared to head (3c2bf4e) 84.97%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #84 +/- ## ======================================= Coverage 84.97% 84.97% ======================================= Files 17 17 Lines 1278 1278 ======================================= Hits 1086 1086 Misses 160 160 Partials 32 32 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

dxyinme commented 5 months ago

I think we don't want to involve too many dependencies into project. we prefer to let user to implement the dlog.PrintfLogger interface and pass it to dcron when it initialized. you can add an example subomdule to teach how to use logrus or zap to take the place of default log.

anyway, thank you for your contribution.