third_party/blink/tools/blinkpy/common/system/log_utils.py
def _default_handlers(stream, logging_level, include_time):
    """Return a list of the default logging handlers to use.

    Args:
      stream: See the configure_logging() docstring.
      include_time: See the configure_logging() docstring.
    """

    # Create the filter.
    def should_log(record):
        """Return whether a logging.LogRecord should be logged."""
        if record.name.startswith('blinkpy.third_party'):
            return False
        return True

    logging_filter = logging.Filter()
    logging_filter.filter = should_log

    # Create the handler.
    handler = logging.StreamHandler(stream)
    if include_time:
        prefix = '%(asctime)s - '
    else:
        prefix = ''

    if logging_level == logging.DEBUG:
        formatter = logging.Formatter(prefix +
                                      '%(name)s: [%(levelname)s] %(message)s')
    else:
        formatter = logging.Formatter(prefix + '%(message)s')

    handler.setFormatter(formatter)
    handler.addFilter(logging_filter)

    return [handler]
Return a list of the default logging handlers to use.

    Args:
      stream: See the configure_logging() docstring.
      include_time: See the configure_logging() docstring.
    
Return a list of the default logging handlers to use.
Return a list of the default logging handlers to use .
def _default_handlers(stream, logging_level, include_time):
    def should_log(record):
        if record.name.startswith('blinkpy.third_party'):
            return False
        return True
    logging_filter = logging.Filter()
    logging_filter.filter = should_log
    handler = logging.StreamHandler(stream)
    if include_time:
        prefix = '%(asctime)s - '
    else:
        prefix = ''
    if logging_level == logging.DEBUG:
        formatter = logging.Formatter(prefix +
                                      '%(name)s: [%(levelname)s] %(message)s')
    else:
        formatter = logging.Formatter(prefix + '%(message)s')
    handler.setFormatter(formatter)
    handler.addFilter(logging_filter)
    return [handler]
def _default_handlers ( stream , logging_level , include_time ) : def should_log ( record ) : """Return whether a logging.LogRecord should be logged.""" if record . name . startswith ( 'blinkpy.third_party' ) : return False return True logging_filter = logging . Filter ( ) logging_filter . filter = should_log handler = logging . StreamHandler ( stream ) if include_time : prefix = '%(asctime)s - ' else : prefix = '' if logging_level == logging . DEBUG : formatter = logging . Formatter ( prefix + '%(name)s: [%(levelname)s] %(message)s' ) else : formatter = logging . Formatter ( prefix + '%(message)s' ) handler . setFormatter ( formatter ) handler . addFilter ( logging_filter ) return [ handler ]
Return a list of the default logging handlers to use.
Return a list of the default logging handlers to use .
"""Return a list of the default logging handlers to use.

    Args:
      stream: See the configure_logging() docstring.
      include_time: See the configure_logging() docstring.
    """ # Create the filter. """Return whether a logging.LogRecord should be logged.""" # Create the handler.
stream
See the configure_logging() docstring.
See the configure_logging () docstring .
logging_level
include_time
See the configure_logging() docstring.
See the configure_logging () docstring .