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

logging.getLogger('optapy').setLevel(logging.DEBUG) (as documented) has no effect on optapy 9.370b0 logger #181

Open
Alex-K37 opened this issue Dec 27, 2023 · 0 comments

Comments

@Alex-K37
Copy link

Environment is Python 3.11 JDK 11.

I started with logging.getLogger('optapy').setLevel(logging.DEBUG) as described in the optapy documentation, which did not work.

The following initial code prints MY debug test message, but NOTHING below INFO from optapy:

logging.basicConfig(level=logging.DEBUG)
logging.getLogger('optapy').setLevel(logging.DEBUG)
if not logging.getLogger('optapy').hasHandlers():
    handler = logging.StreamHandler()
    handler.setLevel(logging.DEBUG)
    logging.getLogger().addHandler(handler)
    
logging.getLogger('optapy').debug("Initial DEBUG Testlog.")

I have only had success after looking at the issues here and was able to make it work with only this:

import org
org.optaplanner.optapy.logging.PythonLoggingToLogbackAdapter.setLevel("org.optaplanner",logging.DEBUG)

May I suggest to either fix the code or the documentation? I wasted hours trying to debug my constraints.

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

1 participant