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

Custom logger #2664

Merged
merged 1 commit into from
Jan 2, 2025
Merged

Custom logger #2664

merged 1 commit into from
Jan 2, 2025

Conversation

MattHag
Copy link
Collaborator

@MattHag MattHag commented Nov 6, 2024

No description provided.

@MattHag
Copy link
Collaborator Author

MattHag commented Nov 6, 2024

@pfps
If the custom logger is fine, we can remove hundreds of code lines.

@pfps
Copy link
Collaborator

pfps commented Nov 6, 2024

Yes, good idea. There is currently some weirdness going on with logging that I have seen occasionally. Some logging messages appear to be generated using some sort of default settings. I expect that this is another effect of how Python does module initialization. With any luck the changes here might be able to fix this weirdness.

@MattHag MattHag marked this pull request as draft November 6, 2024 20:26
@MattHag
Copy link
Collaborator Author

MattHag commented Nov 6, 2024

Great, then I just wait for the open changes to be merged and then I'll remove several hundred code lines.

Implement logger that internally checks if log level is enabled. Thus,
unnecessary log message computation costs are avoid, when logging is
disabled and logging code can be cut in half.

Related pwr-Solaar#2663
@MattHag MattHag marked this pull request as ready for review January 2, 2025 12:13
@MattHag MattHag requested a review from pfps January 2, 2025 12:14
Copy link
Collaborator

@pfps pfps left a comment

Choose a reason for hiding this comment

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

Looks good

@pfps pfps merged commit 33c057f into pwr-Solaar:master Jan 2, 2025
5 checks passed
MattHag added a commit to MattHag/Solaar that referenced this pull request Jan 2, 2025
Logger enabled checks clutter the code unnecessarily. The checks are
now handled in a custom logger class. Eventually they can be completely
removed in the future.

Related pwr-Solaar#2664
MattHag added a commit to MattHag/Solaar that referenced this pull request Jan 2, 2025
Logger enabled checks clutter the code unnecessarily. The checks are
now handled in a custom logger class. Eventually they can be completely
removed in the future.

Related pwr-Solaar#2664
MattHag added a commit to MattHag/Solaar that referenced this pull request Jan 2, 2025
Logger enabled checks clutter the code unnecessarily. The checks are
now handled in a custom logger class. Eventually they can be completely
removed in the future.

Related pwr-Solaar#2664
MattHag added a commit to MattHag/Solaar that referenced this pull request Jan 2, 2025
Logger enabled checks clutter the code unnecessarily. The checks are
now handled in a custom logger class. Eventually they can be completely
removed in the future.

Related pwr-Solaar#2664
pfps pushed a commit that referenced this pull request Jan 2, 2025
Logger enabled checks clutter the code unnecessarily. The checks are
now handled in a custom logger class. Eventually they can be completely
removed in the future.

Related #2664
MattHag added a commit to MattHag/Solaar that referenced this pull request Jan 2, 2025
Logger enabled checks clutter the code unnecessarily. The checks are
now handled in a custom logger class. Eventually they can be completely
removed in the future.

Related pwr-Solaar#2664
MattHag added a commit to MattHag/Solaar that referenced this pull request Jan 2, 2025
Logger enabled checks clutter the code unnecessarily. The checks are
now handled in a custom logger class. Eventually they can be completely
removed in the future.

Related pwr-Solaar#2664
MattHag added a commit to MattHag/Solaar that referenced this pull request Jan 2, 2025
Logger enabled checks clutter the code unnecessarily. The checks are
now handled in a custom logger class. Eventually they can be completely
removed in the future.

Related pwr-Solaar#2664
pfps pushed a commit that referenced this pull request Jan 2, 2025
Logger enabled checks clutter the code unnecessarily. The checks are
now handled in a custom logger class. Eventually they can be completely
removed in the future.

Related #2664
pfps pushed a commit that referenced this pull request Jan 2, 2025
Logger enabled checks clutter the code unnecessarily. The checks are
now handled in a custom logger class. Eventually they can be completely
removed in the future.

Related #2664
pfps pushed a commit that referenced this pull request Jan 2, 2025
Logger enabled checks clutter the code unnecessarily. The checks are
now handled in a custom logger class. Eventually they can be completely
removed in the future.

Related #2664
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