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

Fix logger issue #227

Merged
merged 3 commits into from
Jun 14, 2024
Merged

Fix logger issue #227

merged 3 commits into from
Jun 14, 2024

Conversation

mschwoer
Copy link
Collaborator

  • Fixes the followiung issue on python < 3.11:
0:00:00.027515 INFO:                 │   └──mobility_observed 
0:00:00.027580 INFO:                 └──output_columns
0:00:00.027647 INFO:                     └──mobility_calibrated 
0:00:00.029549 INFO: Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/alphadia/cli.py", line 333, in run
    plan = Plan(
  File "/usr/local/lib/python3.9/site-packages/alphadia/planning.py", line 128, in __init__
    if (level_code := logging.getLevelNamesMapping().get(level_to_set)) is None:
AttributeError: module 'logging' has no attribute 'getLevelNamesMapping'

0:00:00.029638 ERROR: module 'logging' has no attribute 'getLevelNamesMapping'

getLevelNamesMapping is available for python >=3.11 only.

Note that I also changed the behaviour: if the requested log level is not available, an error is raised. Alternatively, one could just continue with the default level.

  • exit on error with a nonzero exit code
  • fix a little flaw that filenames in log output had a trailing dot

Copy link
Collaborator

@mo-sameh mo-sameh left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@jalew188 jalew188 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@GeorgWa GeorgWa left a comment

Choose a reason for hiding this comment

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

LGTM

@GeorgWa GeorgWa merged commit c48f61d into development Jun 14, 2024
3 checks passed
@GeorgWa GeorgWa deleted the fix-logger-issue branch June 14, 2024 20:02
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.

4 participants