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

Avoid logging.basicConfig #67

Merged
merged 3 commits into from
Nov 10, 2022
Merged

Avoid logging.basicConfig #67

merged 3 commits into from
Nov 10, 2022

Conversation

paugier
Copy link
Contributor

@paugier paugier commented Nov 10, 2022

Fixes #66 (and snek5000/snek5000#38)

logging.basicConfig should be used only in scripts because it affects the root logger, which can break other loggers.

pymech/log.py Outdated
handler = logging.StreamHandler()
formatter = logging.Formatter("%(levelname)s: %(message)s")
handler.setFormatter(formatter)
logger.addHandler(handler)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for figuring this out!

@ashwinvis
Copy link
Member

@paugier Can you ensure mypy passes?

@paugier
Copy link
Contributor Author

paugier commented Nov 10, 2022

I don't know how to do it! I tried locally and it passes...

@paugier
Copy link
Contributor Author

paugier commented Nov 10, 2022

Coverage is a bit difficult here since we would need to run without rich.

@ashwinvis
Copy link
Member

Coverage is a bit difficult here since we would need to run without rich.

That's alright, I dont mind.

@ashwinvis ashwinvis merged commit 52f327e into eX-Mech:main Nov 10, 2022
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

Successfully merging this pull request may close these issues.

importing pymech breaks snakemake log (without rich)
2 participants