Skip to content

Move test runner logger to mozlog.proxy.QueuedProxyLogger? #55268

@gsnedders

Description

@gsnedders

We currently rely on our own log messages:

# Ensure that when we start this in a new process we have the global lock
# in the logging module unlocked
release_mozlog_lock()
proc_name = mpcontext.get_context().current_process().name
logger = structuredlog.StructuredLogger(proc_name)
logger.add_handler(LogMessageHandler(send_message))

However, mozlog actually provides its own multiprocessing logger support which we could use:

class QueuedProxyLogger(StructuredLogger):
"""Logger that logs via a queue.
This is intended for multiprocessing use cases where there are
some subprocesses which want to share a log handler with the main thread,
without the overhead of having a multiprocessing lock for all logger
access."""

This was added by @jgraham back in 2017: mozilla-firefox/firefox@995f6ab, and used in the server from 7c178d2 until 8a2f868.

I don't know if there was any reason why the test runner itself never used this, rather reimplementing it itself?

Metadata

Metadata

Assignees

No one assigned

    Labels

    infrawptrunnerThe automated test runner, commonly called through ./wpt run

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions