Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double output with coloredlogs and logging #5

Open
jjanis opened this issue Apr 16, 2019 · 3 comments
Open

Double output with coloredlogs and logging #5

jjanis opened this issue Apr 16, 2019 · 3 comments

Comments

@jjanis
Copy link

jjanis commented Apr 16, 2019

Your code causes double output when used in project where I define my own loggers with logging.DEBUG level.

#!/usr/bin/env python3

import logging
import coloredlogs
from datetime import timedelta
from timeloop import Timeloop

logging.basicConfig(level=logging.DEBUG)
coloredlogs.install(level=logging.DEBUG)
logger = logging.getLogger(__name__)

looper = Timeloop()

@looper.job(interval=timedelta(seconds=5))
def work():
    pass

looper.start(block=True)
@sankalpjonn
Copy link
Owner

sankalpjonn commented Apr 18, 2019 via email

@lockieRichter
Copy link

Having this same issue, has this been resolved?

@KoenDierckx
Copy link

KoenDierckx commented Mar 12, 2021

I solved it this way

# Timeloop has a default logging handler, remove it, so we only use our own handlers (avoids duplicate logs) logging.getLogger('timeloop').handlers.clear()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants