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

Stop using the root logger #7

Merged
merged 1 commit into from
Dec 16, 2024
Merged

Stop using the root logger #7

merged 1 commit into from
Dec 16, 2024

Conversation

C0rn3j
Copy link
Contributor

@C0rn3j C0rn3j commented Dec 16, 2024

Couple calls still used the root logging instead of the created logger, breaking logging when the library was imported.

I am too lazy to add a test, but this is enough(can probably do 2x stream handler instead):

import logging

from playsound3 import playsound

logging.basicConfig(
	level=logging.DEBUG,
	format='%(asctime)s [%(levelname)s] %(message)s',
	handlers=[
		logging.FileHandler('/tmp/nyx.log'),
		logging.StreamHandler(),
	],
)
logging.getLogger().handlers[1].setLevel(logging.INFO)

logging.info("Hi")

@sjmikler sjmikler merged commit c118310 into sjmikler:main Dec 16, 2024
11 checks passed
@C0rn3j C0rn3j deleted the logging-fix branch December 16, 2024 19:59
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.

2 participants