quantum-elixir / quantum-core

:watch: Cron-like job scheduler for Elixir
https://hexdocs.pm/quantum/
Apache License 2.0
2.28k stars 148 forks source link

Problem: Would like :info that Quantum is running (not :debug) #447

Closed sensiblearts closed 4 years ago

sensiblearts commented 4 years ago

I request that you change the prority level of these messages from :debug to :info:

14:16:12.124 [info] [Pow.Store.Backend.MnesiaCache] Mnesia cluster initiated on :...
14:16:12.125 [debug] Elixir.Quantum.JobBroadcaster] Loading Initial Jobs from Config

And perhaps this too:

14:16:12.127 [debug] Elixir.Quantum.ExecutionBroadcaster] Adding job #Reference..
maennchen commented 4 years ago

Can you supply a reason why you want this change?

sensiblearts commented 4 years ago

@maennchen Thank you for the prompt reply.

I am trying to figure out why my job runs fine every 5 minutes, but failed to run when I changed to "@daily".

At first I thought Quantum was not running because there was nothing in the logs. So I tried adding it to :extra_applications. I.e., wasting time.

I just noticed that Pow logs its startup as :info, so I thought that might be common practice.

If there is a more standard way to confirm that all apps are started, please let me know.

Thanks.

maennchen commented 4 years ago

@sensiblearts I think this might be the wrong approach.

Generally saying you are sure that your application only starts after all dependent applications have been started.

In the case of quantum, this does not apply since the Scheduler is started by your application and not quantum itself.

If you added the Scheduler to your Application / Supervisor as stated in the installation docs, those would warn you if the Scheduler could not be started.

I think it would be very bad if every application would log that it is starting. in a big project you would have a vast amount of messages that are basically only confirming that OTP is working as intended.

Also, if you're already spending time debugging why something works / doesn't, I think it is also reasonable that people enable debug logs to verify what's happening.

PS: Logs can be manipulated application / Module specific:

sensiblearts commented 4 years ago

Thank you! That sounds good.