mosquito-cr / mosquito

A background task runner for crystal applications supporting periodic (CRON) and manually queued jobs
MIT License
227 stars 24 forks source link

Update use of ::Log to better indicate where a message is coming from #78

Closed robacarp closed 2 years ago

robacarp commented 2 years ago

Currently, mosquito logs look like this:

INFO - mosquito: Success: task queued_job<1642475392146:636> finished and took 13.0µs
INFO - mosquito: Running task custom_serializers_job<1642475392145:418> from custom_serializers_job
INFO - mosquito: using custom serialization: 12
INFO - mosquito: deserialized: 120
INFO - mosquito: Success: task custom_serializers_job<1642475392145:418> finished and took 17.0µs
INFO - mosquito: Running task rate_limited_job<1642475392146:766> from rate_limited_job
INFO - mosquito: mosquito:rate_limit:rate_limited_job
INFO - mosquito: Success: task rate_limited_job<1642475392146:766> finished and took 37.0µs
INFO - mosquito: Running task custom_serializers_job<1642475392145:480> from custom_serializers_job
INFO - mosquito: using custom serialization: 525600
INFO - mosquito: deserialized: 5256000
INFO - mosquito: Success: task custom_serializers_job<1642475392145:480> finished and took 25.0µs
INFO - mosquito: Running task rate_limited_job<1642475392146:571> from rate_limited_job
INFO - mosquito: mosquito:rate_limit:rate_limited_job
INFO - mosquito: Success: task rate_limited_job<1642475392146:571> finished and took 25.0µs
INFO - mosquito: Running task rate_limited_job<1642475392147:32> from rate_limited_job
WARN - mosquito: Failure: task rate_limited_job<1642475392147:32> failed, taking 34.0µs and will run again in 00:00:02 (at 2022-01-18 03:09:54 UTC)
INFO - mosquito: Running task periodically_puts<1642475392149:419> from periodically_puts
INFO - mosquito: Hello from PeriodicallyPuts

This defeats some of the purposes of using Log because messages cannot be filtered by topic easily. Ideally mosquito should be one of: