sankalpjonn/timeloop

Is it possible to disable logs?

Opened this issue · 2 comments

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

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

This worked for me, ymmv:

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