Skip to content

log_exception context manager avoids spamming by not logging every exception - #126

Merged
almarklein merged 1 commit into
mainfrom
log-exception
Nov 5, 2025
Merged

almarklein merged 1 commit into
mainfrom
log-exception

Conversation

@almarklein

@almarklein almarklein commented Nov 3, 2025 •

Copy link
Copy Markdown
Member

Every next exception that is the same as the first is shortened to a on-liner (we already had this).

After 5 messages we start to swallow messages, starting with an interval of 1 second, leading up to a max of 3 seconds between messages.

This helps avoid spamming the logger, which can also cause stalling on some systems. See #115 (comment)

@almarklein
almarklein merged commit 9bf502a into main Nov 5, 2025
12 checks passed
@almarklein
almarklein deleted the log-exception branch November 5, 2025 10:45
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.

1 participant