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

Configurable log level #500

Merged
merged 3 commits into from
Mar 15, 2024
Merged

Configurable log level #500

merged 3 commits into from
Mar 15, 2024

Conversation

Roy-Orbison
Copy link
Contributor

Backwards-compatible, and only takes precedence over the fallback value.

Closes #498.

This code is untested but also a pretty minor change. I'm happy to modify it.

@Roy-Orbison Roy-Orbison marked this pull request as ready for review March 12, 2024 01:05
@unode
Copy link
Collaborator

unode commented Mar 12, 2024

Hi Roy thanks for this PR.

It looks to me that instead of introducing LOG_LEVEL with a default of None we should instead make it logging.INFO and simplify the third line of the code that configures logging (line 86).

I also see that LOG_LEVEL = logging.DEBUG might be redundant with or remove the need for DEBUG = True.
This is something we could mark as deprecated and a candidate for future removal.
Could you include this in your PR?

settings.DEBUG is only used in two locations in the mmpy_bot code so the need for backwards compatibility is slim.

@Roy-Orbison
Copy link
Contributor Author

Yes, it was intended to deprecate DEBUG. I didn't expect that many people have it enabled in production, but some might in development, or may uncomment it as needed to diagnose issues, and this shouldn't break those cases. I suppose this would necessitate a minor version bump.

@Roy-Orbison
Copy link
Contributor Author

I also noticed docs/settings.py doesn't seem to be referenced anywhere. The ReadTheDocs pages refer to mmpy_bot/settings.py instead.

unode
unode previously requested changes Mar 13, 2024
Copy link
Collaborator

@unode unode left a comment

Choose a reason for hiding this comment

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

Please exclude docs/settings.py from the PR (I've included suggestions in the review for your convenience) as the DEBUG there is for an unrelated purpose that I believe is, in any case, no longer being used.

docs/settings.py Outdated Show resolved Hide resolved
docs/settings.py Outdated Show resolved Hide resolved
mmpy_bot/settings.py Outdated Show resolved Hide resolved
@unode
Copy link
Collaborator

unode commented Mar 13, 2024

I also noticed docs/settings.py doesn't seem to be referenced anywhere. The ReadTheDocs pages refer to mmpy_bot/settings.py instead.

That's a very good point. I don't think there's anything Django specific there as docs are handled by Sphinx but I'll wait for @attzonko's input on it. At birds-eye it looks like some of those files are leftovers from the past and should be removed.

PS: once the above changes are included, I would say is ready to merge. Thank you for this contribution.

@attzonko
Copy link
Owner

Yeah I have not really poked in the docs folder much. I am sure there is some leftovers in there that could be cleaned up.

@unode unode dismissed their stale review March 14, 2024 12:05

Adressed

@unode
Copy link
Collaborator

unode commented Mar 14, 2024

Seems like black is still failing on code style.
Can you make the linter happy?

Backwards-compatible. Closes #498.
@Roy-Orbison
Copy link
Contributor Author

Adjusted using the playground. I think it's slightly less readable, myself, but Black did not like a line length.

mmpy_bot/settings.py Outdated Show resolved Hide resolved
tests/unit_tests/bot_test.py Outdated Show resolved Hide resolved
Copy link

codeclimate bot commented Mar 15, 2024

Code Climate has analyzed commit bc807f1 and detected 0 issues on this pull request.

View more on Code Climate.

@unode
Copy link
Collaborator

unode commented Mar 15, 2024

Merging. There was an integration test failure but I think it was unrelated to the changes.

@unode unode merged commit be718ad into attzonko:main Mar 15, 2024
7 of 8 checks passed
@Roy-Orbison Roy-Orbison deleted the int-log-level branch March 18, 2024 05:14
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.

Disable httpx logging?
3 participants