Skip to content

Commit 7d72354

Browse files
authored
Stop xctrunnertool from silencing exceptions (#2809)
If there is noise from this tool we can silence individual spots, but this ate all output which makes it harder to debug.
1 parent 7a4577d commit 7d72354

1 file changed

Lines changed: 1 addition & 24 deletions

File tree

tools/xctrunnertool/lib/logger.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,9 @@
22

33
import logging
44
import os
5-
import sys
65
from lib.model import Configuration
76

87

9-
class StreamToLogger(object):
10-
"""
11-
Fake file-like stream object that redirects writes to a logger instance.
12-
"""
13-
14-
def __init__(self, logger, level):
15-
self.logger = logger
16-
self.level = level
17-
self.linebuf = ""
18-
19-
def write(self, buf):
20-
"Writes to file"
21-
for line in buf.rstrip().splitlines():
22-
self.logger.log(self.level, line.rstrip())
23-
24-
def flush(self):
25-
"Flushes IO buffer"
26-
pass
27-
28-
298
class Logger:
309
"Logger class."
3110

@@ -52,6 +31,4 @@ def __init__(self, config: Configuration, level: int = logging.INFO):
5231

5332
def get(self, name: str) -> logging.Logger:
5433
"Returns logger with the given name."
55-
log = logging.getLogger(name)
56-
sys.stderr = StreamToLogger(log, logging.ERROR)
57-
return log
34+
return logging.getLogger(name)

0 commit comments

Comments
 (0)