cronitorio / cronitor-python

Python client for Cronitor
MIT License
73 stars 9 forks source link

cronitor module is posting logs #17

Closed elnoxgdl closed 2 years ago

elnoxgdl commented 2 years ago

Hi Team,

I recently started a project where I wanted to use cronitor python module. It's working, however whenever I set up a logger in my code cronitor is also posting in my logger. I'm not using the root logger instead I'm using a name even like that cronitor module is posting there, this of course is messing my custom log format.

import sys
import cronitor
import logging

log = logging.getLogger("my_custom")
logHandler = logging.StreamHandler(sys.stdout)
log.addHandler(logHandler)
log.setLevel(logging.INFO)

log.info("whatever")

And the output is a duplicate of my message but with a different format simply by importing it does this, yes I tried to disable the logger for the module in the usual ways but other than modifying the module code I see this as a possible bug.

My env is pure python 3.9.x

whatever
INFO:my_custom:whatever

Thanks!

aflanagan commented 2 years ago

This was fixed in the 4.4.3 release