sankalpjonn / timeloop

An elegant periodic task executor
MIT License
245 stars 49 forks source link

Is it possible to disable logs? #13

Open saleh-old opened 4 years ago

saleh-old commented 4 years ago

I'm using python's logger in my app heavily. I don't want Timeloop's logs to be added to my apps logs. I know I could increase the log-level so that INFO logs won't be stored, but I actually need INFO level.

Is there a way to disable it? Thanks in advance

projx commented 4 years ago

There is nothing in the code for disabling this. Which leaves 3 options:

1) Leave it 2) Modify the code (fork-it, add a disable feature, ask for it to be re-merged) 3) You could try disabling it, using logging.removeHandler

maguro commented 4 years ago

This worked for me, ymmv:

logging.getLogger("timeloop").setLevel(logging.CRITICAL)