Skip to content

[Gecko Bug 2047805] Make logger owner call shutdown() - #60846

Merged
moz-wptsync-bot merged 1 commit into
masterfrom
gecko/2047805
Jun 24, 2026
Merged

moz-wptsync-bot merged 1 commit into
masterfrom
gecko/2047805

Conversation

@moz-wptsync-bot

Copy link
Copy Markdown
Collaborator

Instead of providing setup_logging functions that return a logger but
don't handle any cleanup, provide context managers that clean up the
logging configuration.

In particular wptlogging.LoggingManager will call shutdown on the
logger iff it created the logger in the first place.

Where we store the logger as a global variable we wrap in a
GlobalLogger class that knows how to set the global state and unsets
it at the end. Rather inelegantly, the interaction with globals means
we end up copying a lot of code around.

Differential Revision: https://phabricator.services.mozilla.com/D306960

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=2047805
gecko-commit: 9710b7ec0bf1ce280a6109d24ab107c09fa748c9
gecko-commit-git: b4375e893697bf45fcb5f15884b6c9d064a99e30
gecko-reviewers: Sasha

Instead of providing setup_logging functions that return a logger but
don't handle any cleanup, provide context managers that clean up the
logging configuration.

In particular wptlogging.LoggingManager will call shutdown on the
logger iff it created the logger in the first place.

Where we store the logger as a global variable we wrap in a
GlobalLogger class that knows how to set the global state and unsets
it at the end. Rather inelegantly, the interaction with globals means
we end up copying a lot of code around.

Differential Revision: https://phabricator.services.mozilla.com/D306960

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=2047805
gecko-commit: 9710b7ec0bf1ce280a6109d24ab107c09fa748c9
gecko-commit-git: b4375e893697bf45fcb5f15884b6c9d064a99e30
gecko-reviewers: Sasha
@wpt-pr-bot wpt-pr-bot added infra wpt wptrunner The automated test runner, commonly called through ./wpt run labels Jun 24, 2026

@wpt-pr-bot wpt-pr-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The review process for this patch is being conducted in the Firefox project.

@moz-wptsync-bot
moz-wptsync-bot merged commit 3ef5a05 into master Jun 24, 2026
32 of 34 checks passed
@moz-wptsync-bot
moz-wptsync-bot deleted the gecko/2047805 branch June 24, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infra mozilla:gecko-sync wpt wptrunner The automated test runner, commonly called through ./wpt run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants