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 configuration set by fms_mo takes precedence over user script's one #27

Open
andrea-fasoli opened this issue Dec 11, 2024 · 0 comments
Assignees

Comments

@andrea-fasoli
Copy link
Collaborator

Logging configuration is initialized in fms_mo/__init__.py by:

logging.basicConfig(filename="fms_mo.log", encoding="utf-8", level=logging.INFO)

Customization of logging.basicConfig is a common feature found in many python scripts. For example, a user may want to set their own log filename, or output stream, change logging level, etc.

However, the first instance of logging.basicConfig (in this case by fms_mo) takes precedence. This initial configuration can be overridden by passing force=True to the subsequent calls of logging.basicConfig but this is not widely known. The resulting logging behavior is quite opaque.

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

3 participants