Skip to content
This repository was archived by the owner on Dec 21, 2024. It is now read-only.

Commit 63f660b

Browse files
committed
Fix Custom Logic Adds Field test for Python 2.6
The Formatter class in the logging package of Python 2.6 is old style. To be able to still run the test on Python 2.6, this needs to be the old style "super".
1 parent 6425c16 commit 63f660b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/tests.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ class CustomJsonFormatter(jsonlogger.JsonFormatter):
147147

148148
def process_log_record(self, log_record):
149149
log_record["custom"] = "value"
150-
return super(CustomJsonFormatter, self).process_log_record(log_record)
150+
# Old Style "super" since Python 2.6's logging.Formatter is old
151+
# style
152+
return jsonlogger.JsonFormatter.process_log_record(self, log_record)
151153

152154
self.logHandler.setFormatter(CustomJsonFormatter())
153155
self.logger.info("message")

0 commit comments

Comments
 (0)