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

unify logging configuration #2720

Merged
merged 12 commits into from
Jan 6, 2022
Merged

unify logging configuration #2720

merged 12 commits into from
Jan 6, 2022

Conversation

trichter
Copy link
Member

@trichter trichter commented Sep 30, 2020

This PR tries to unify the logging configuration.
All calls to logging.basicConfig inside the library are deleted and some loglevel keywords are removed. Logging should be configured in the user's code. A simple logging.basicConfig() is often good enough. I added the NullHandler to the obspy's root logger 'obspy' so that by default no logging is emmited. Logging is only configured displayed for obspy-runtests -v.

WIP: If this PR is endorsed I would further refine it.

PR Checklist

  • Correct base branch selected? master for new features, maintenance_... for bug fixes
  • This PR is not directly related to an existing issue (which has no PR yet).
  • If the PR is making changes to documentation, docs pages can be built automatically.
    Just remove the space in the following string after the + sign: "+ DOCS"
  • If any network modules should be tested for the PR, add them as a comma separated list
    (e.g. clients.fdsn,clients.arclink) after the colon in the following magic string: "+TESTS:"
    (you can also add "ALL" to just simply run all tests across all modules)
  • All tests still pass.
  • Any new features or fixed regressions are be covered via new tests.
  • Any new or changed features have are fully documented.
  • Significant changes have been added to CHANGELOG.txt .
  • First time contributors have added your name to CONTRIBUTORS.txt .

@trichter
Copy link
Member Author

trichter commented Oct 7, 2020

This PR is ready for review. I also added the possibility to specify a second -v flag in obspy-runtests. One -v will just display warnings. Two -v will use the verbose mode of runtests.

Closes #2625.

@trichter trichter marked this pull request as ready for review October 7, 2020 07:04
@heavelock
Copy link
Contributor

Changes in obspy/signal/tf_misfit.py seem to be unrelated.

@trichter
Copy link
Member Author

trichter commented Oct 7, 2020

Changes in obspy/signal/tf_misfit.py seem to be unrelated.

Yes, these changes just deal with a DeprecationWarning of matplotlib. Are only related, because both warnings and logs show when running obspy-runtests.

@trichter trichter added this to the 2.0.0 milestone Oct 15, 2020
megies added a commit that referenced this pull request Oct 23, 2020
fixes #2732

might affect #2720 but actually doesn't look like it
@heavelock
Copy link
Contributor

I just took again a look on this PR and I though about something that new. Why only deprecation since it's targeting master?
I think you could add deprecations to the 1.2.3 and here just drop it completely.

@trichter
Copy link
Member Author

Thanks for having a look. I am all for fast depreciation, but I think most people favor a slower pace with depreciations only for mayor versions. IMHO this is ready for merging.

@trichter trichter mentioned this pull request Jan 6, 2022
20 tasks
@ThomasLecocq
Copy link
Contributor

look OK if all tests 🟢

@trichter trichter merged commit a5b4b50 into master Jan 6, 2022
@trichter trichter deleted the logging_config branch January 6, 2022 09: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.

3 participants