mvniekerk / tokio-cron-scheduler

Schedule tasks on Tokio using cron-like annotation
Apache License 2.0
453 stars 54 forks source link

Added additional feature to allow to use log crate instead of tracing crate #60

Closed marioloko closed 5 months ago

marioloko commented 5 months ago

The tracing crate is great for logging asynchronous applications, however it requires an extra overhead on the application startup to set up the traces endpoints. Some applications which use this library do not set up the tracing endpoint, and this can make the error logs invisible for the library users. In contrast the log crate is fairly easy to set up, however it does not perform so good in asynchronous context. The tracing library has a log-always feature which write logs of all the traces, allowing the errors to be visible for both, tracing library users and log library users.

This pull request adds a new feature to this crate, the log feature. When this feature is used, it will set the log-always feature in the tracing crate, so the users of the log library are able to watch errors in the library.

mvniekerk commented 5 months ago

Hi Mario Thank you for your PR!