'Override format to add thread information.'

def format(self, record):

    log_str = logging.Formatter.format(self, record)
    t_name = record.threadName
    if (t_name == 'MainThread'):
        return log_str
    if (t_name != self._last_log_thread):
        self._last_log_thread = t_name
        log_str = ('%s:\n    %s' % (t_name, log_str))
    else:
        log_str = ('    %s' % log_str)
    return log_str
