Repository navigation
Conversation
mozlog's StructuredLogger bypasses the stdlib logging module. Switch to plain `logging` loggers, formatted as mozlog JSON on stdout by a MozLogFormatter adapted from Lando. Loggers are now named after their module (`git_hg_sync.*`), and the name is reported in the `source`/`Type` fields; previously `source` was always "service" and the per-module name was in `component`. The mozlog command line options are replaced by a single `--log-level`.
…t captures Now that we log through the stdlib logging module, sentry's default LoggingIntegration turns ERROR records into events, so most explicit capture_exception calls are redundant: - repo_synchronizer: the wrapping RepoSyncError was already reported again by Application. - cli: sentry is never initialised in git-hg-cli, so this was a no-op. - retry: every failed attempt was reported, even when a later one succeeded or the caller handled the error. The final failure is now logged as a warning (with traceback); callers report it if fatal. - application: log the sync failure with logger.exception, so it becomes the single sentry event for a failed push, carrying the destination and operations. Also downgrade pulse connection errors to a warning: kombu retries them, and they'd otherwise create one sentry event per reconnection attempt.
jcristau
marked this pull request as ready for review
October 15, 2026 16:51
shtrom
requested changes
Oct 16, 2026
| sentry_sdk.capture_exception(exc) | ||
| action_text = f" {action}" if action else "" | ||
| if attempt < tries: | ||
| logger.warning( |
Member
There was a problem hiding this comment.
Suggested change
| logger.warning( | |
| logger.info( |
| if TYPE_CHECKING: | ||
| import argparse | ||
|
|
||
| # Adapted from Lando's lando/main/logging.py. |
Member
There was a problem hiding this comment.
It might be worth noting the actual SHA of the commit you got it from.
shtrom
requested changes
Oct 16, 2026
|
|
||
| args = parser.parse_args() | ||
| logger = commandline.setup_logging("service", args) | ||
| setup_logging(args.log_level) |
Member
There was a problem hiding this comment.
Ah, I don't think we want the MozLog format for the CLI, because that's used manually, and JSON is harder to parse with one's eyes.
Suggested change
| setup_logging(args.log_level) | |
| logging.basicConfig(args.log_level.upper()) |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.