Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit a28b1b5

Browse files
committed
Fix slogging module
This reverts the slogging.py module back to the version of commit 273158e, since the changes of bc59edb broke many logging tests. @vub if this revert breaks any functionality you rely on, let us find a way to implement it without crashing the tests!
1 parent ce9ecf4 commit a28b1b5

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

ethereum/slogging.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
known_loggers = set()
1717

1818
log_listeners = []
19-
print_logs=True
2019

2120

2221
# add level trace into logging
@@ -39,17 +38,12 @@ class LogRecorder(object):
3938
def __init__(self):
4039
self._records = []
4140
log_listeners.append(self._add_log_record)
42-
global print_logs
43-
self.prev_print_logs = print_logs
44-
print_logs = False
4541

4642
def pop_records(self):
4743
# can only be called once
4844
r = self._records[:]
4945
self._records = None
5046
log_listeners.remove(self._add_log_record)
51-
global print_logs
52-
print_logs = self.prev_print_logs
5347
return r
5448

5549
def _add_log_record(self, msg):
@@ -132,17 +126,13 @@ def bind(self, **kwargs):
132126
return BoundLogger(self, kwargs)
133127

134128
def _log(self, level, msg, args, **kwargs):
135-
for listener in log_listeners:
136-
kwargs['event'] = msg
137-
listener(kwargs)
138129
exc_info = kwargs.pop('exc_info', None)
139130
extra = kwargs.pop('extra', {})
140131
highlight = kwargs.pop('highlight', False)
141132
extra['kwargs'] = kwargs
142133
extra['original_msg'] = msg
143134
msg = self.format_message(msg, kwargs, highlight)
144-
if print_logs:
145-
super(SLogger, self)._log(level, msg, args, exc_info, extra)
135+
super(SLogger, self)._log(level, msg, args, exc_info, extra)
146136

147137
def DEV(self, msg, *args, **kwargs):
148138
"""Shortcut to output highlighted log text"""

0 commit comments

Comments
 (0)