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

Improve logging #24

Merged
merged 3 commits into from
Nov 7, 2024
Merged

Improve logging #24

merged 3 commits into from
Nov 7, 2024

Conversation

r0x0d
Copy link
Member

@r0x0d r0x0d commented Nov 6, 2024

No description provided.

@r0x0d r0x0d requested a review from beav November 6, 2024 13:38
Copy link

codecov bot commented Nov 6, 2024

Codecov Report

Attention: Patch coverage is 16.00000% with 21 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
command_line_assistant/logging.py 0.00% 14 Missing ⚠️
command_line_assistant/handlers.py 0.00% 4 Missing ⚠️
command_line_assistant/__main__.py 0.00% 2 Missing ⚠️
command_line_assistant/history.py 75.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
command_line_assistant/cli.py 85.00% <100.00%> (+0.78%) ⬆️
command_line_assistant/config.py 76.00% <ø> (ø)
command_line_assistant/history.py 90.90% <75.00%> (ø)
command_line_assistant/__main__.py 0.00% <0.00%> (ø)
command_line_assistant/handlers.py 0.00% <0.00%> (ø)
command_line_assistant/logging.py 0.00% <0.00%> (ø)

command_line_assistant/config.py Outdated Show resolved Hide resolved
command_line_assistant/config.py Outdated Show resolved Hide resolved
command_line_assistant/config.py Outdated Show resolved Hide resolved
@@ -13,7 +13,7 @@ def handle_history_read(config: Config) -> dict:

filepath = config.history.file
if not filepath or not filepath.exists():
logging.warning(f"History file {filepath} does not exist.")
logging.warning("History file %s does not exist.", filepath)
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the reason for moving away from f-strings here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixing ruff/pyright linting warning for lazy logging

Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this is G004. TIL. Are we going to enable that in the pyproject.toml?

Copy link
Member Author

Choose a reason for hiding this comment

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

We can. I will add it in another PR.

command_line_assistant/logging.py Outdated Show resolved Hide resolved
r0x0d added 2 commits November 7, 2024 09:39
The --verbose command line switch will enable log in terminal
Add some basic logging configuration to save the logs in a file and output to the terminal as minimal as possible
@r0x0d r0x0d merged commit 3a155ed into rhel-lightspeed:main Nov 7, 2024
7 of 8 checks passed
@r0x0d r0x0d deleted the improve-logging branch November 7, 2024 12:50
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.

2 participants