0

Given this setup, I cannot see any debug logs:

import logging
import coloredlogs

coloredlogs.install(isatty=True)

logger = logging.getLogger()
logger.setLevel(logging.DEBUG)

# Show the current debug level
logger.critical(logger.level)


logger.critical("critical")
logger.error("error")
logger.warning("warning")
logger.info("info")
logger.debug("debug") <-- NOT SHOWN!

Yet if I change to coloredlogs.install(level=logging.DEBUG,isatty=True)

I get all the DEBUG notices but they include other libs debug messages (botocore, urllib..) which is unwanted since I want to see only my debug notices.

What did I miss?

1 Answer 1

1

Have you tried:

logging.basicConfig(level=logging.DEBUG)

instead of logger.setLevel? I assume you only set the level of that logger, but the corresponding handlers still have a higher level, so the message is ignored.

Sign up to request clarification or add additional context in comments.

1 Comment

Not working, but 'coloredlogs.install(level=logging.DEBUG,isatty=True)' Does the job, but it shows a lot more debugging, even for external libs which is unwanted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.