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

Importing wakeypy nukes logging config #343

Closed
reidswanson opened this issue Jun 4, 2024 · 3 comments · Fixed by #344
Closed

Importing wakeypy nukes logging config #343

reidswanson opened this issue Jun 4, 2024 · 3 comments · Fixed by #344
Assignees
Labels
Type: Bug Something isn't working

Comments

@reidswanson
Copy link

wakeypy > 0.7.2 nukes python logging

import logging
import wakepy


def main():
    log = logging.getLogger("main")
    log.info("Running in main")


if __name__ == '__main__':
    logging.basicConfig(level=logging.DEBUG)
    main()

When run with wakepy < 0.8.0 the program logs "Running in main" as expected. However, for wakepy > 0.7.2 nothing is logged.

I've tested on both Linux and Window with the same results.

@fohrloop
Copy link
Owner

fohrloop commented Jun 4, 2024

Oh wow that should not happen! It seems that importing wakepy >0.7.2 changes logging level to WARNING, so everything logged at info and debug levels is lost.

@fohrloop fohrloop added the Type: Bug Something isn't working label Jun 4, 2024
@fohrloop fohrloop self-assigned this Jun 4, 2024
@fohrloop fohrloop modified the milestones: wakepy 0.9.0, wakepy 0.10.0 Jun 4, 2024
fohrloop added a commit that referenced this issue Jun 4, 2024
Fixes: #343

Previously, on wakepy 0.8.0 and 0.9.0, importing wakepy would change
logging level to WARNING. This was caused by direct call to
logging.debug() when registering Method subclasses.
@fohrloop fohrloop removed this from the wakepy 0.10.0 milestone Jun 4, 2024
@fohrloop
Copy link
Owner

fohrloop commented Jun 4, 2024

It was due to some part of the code calling logging.debug() instead if logger.debug(). Fixed the issue in wakepy 0.9.1 which I've just released. Thanks for reporting it @reidswanson !

@reidswanson
Copy link
Author

No problem. Thanks for the great library :-)

fohrloop added a commit that referenced this issue Jun 4, 2024
the logging info may have some side effects (it may configure logging, as in #343)
fohrloop added a commit that referenced this issue Jun 4, 2024
Closes: #351

the logging info may have some side effects (it may configure logging, as in #343)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants