diff options
Diffstat (limited to 'buildscripts/resmokelib/logging/formatters.py')
-rw-r--r-- | buildscripts/resmokelib/logging/formatters.py | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/buildscripts/resmokelib/logging/formatters.py b/buildscripts/resmokelib/logging/formatters.py index 058c6d512c8..450d5d29cd8 100644 --- a/buildscripts/resmokelib/logging/formatters.py +++ b/buildscripts/resmokelib/logging/formatters.py @@ -1,22 +1,20 @@ -""" -Custom formatters for the logging handlers. -""" +"""Custom formatters for the logging handlers.""" from __future__ import absolute_import import logging -import sys import time class ISO8601Formatter(logging.Formatter): - """ - An ISO 8601 compliant formatter for log messages. It formats the - timezone as an hour/minute offset and uses a period as the + """An ISO 8601 compliant formatter for log messages. + + It formats the timezone as an hour/minute offset and uses a period as the millisecond separator in order to match the log messages of MongoDB. """ def formatTime(self, record, datefmt=None): + """Return formatted time.""" converted_time = self.converter(record.created) if datefmt is not None: @@ -28,10 +26,7 @@ class ISO8601Formatter(logging.Formatter): @staticmethod def _format_timezone_offset(converted_time): - """ - Returns the timezone as an hour/minute offset in the form - "+HHMM" or "-HHMM". - """ + """Return the timezone as an hour/minute offset in the form "+HHMM" or "-HHMM".""" # Windows treats %z in the format string as %Z, so we compute the hour/minute offset # manually. |