Skip to content

Commit 7c178d2

Browse files
committed
Add mozlog logger that goes via a queue,
This allows subprocesses to log to a shared stream via a queue, so that we avoid the overhead of a multiprocessing Lock around all log access, but still avoid races where two processes try to log simultaneously. It's mostly useful where one process is responsible for the majority of logging, but some messages will be generated in child processes. MozReview-Commit-ID: ABl6cvpb6qI Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1368342 [ci skip]
1 parent 621b47b commit 7c178d2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/wptrunner/wptrunner/environment.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import sys
77
import time
88

9-
from mozlog import get_default_logger, handlers
9+
from mozlog import get_default_logger, handlers, proxy
1010

1111
from wptlogging import LogLevelRewriter
1212

@@ -168,6 +168,8 @@ def setup_server_logging(self):
168168
log_filter = LogLevelRewriter(log_filter, ["error"], "warning")
169169
server_logger.component_filter = log_filter
170170

171+
server_logger = proxy.QueuedProxyLogger(server_logger)
172+
171173
try:
172174
#Set as the default logger for wptserve
173175
serve.set_logger(server_logger)

0 commit comments

Comments
 (0)