def _create_logger(name='did', level=None):
        """ Create did logger """
        # Create logger, handler and formatter
        logger = logging.getLogger(name)
        handler = logging.StreamHandler()
        handler.setFormatter(Logging.ColoredFormatter())
        logger.addHandler(handler)
        # Save log levels in the logger itself (backward compatibility)
        for level in Logging.LEVELS:
            setattr(logger, level, getattr(logging, level))
        # Additional logging constants and methods for details and data
        logger.DATA = LOG_DATA
        logger.DETAILS = LOG_DETAILS
        logger.ALL = LOG_ALL
        logger.details = lambda message: logger.log(
            LOG_DETAILS, message) # NOQA
        logger.data = lambda message: logger.log(
            LOG_DATA, message) # NOQA
        logger.all = lambda message: logger.log(
            LOG_ALL, message) # NOQA
        return logger
def _create_logger ( name = 'did' , level = None ) : logger = logging . getLogger ( name ) handler = logging . StreamHandler ( ) handler . setFormatter ( Logging . ColoredFormatter ( ) ) logger . addHandler ( handler ) for level in Logging . LEVELS : setattr ( logger , level , getattr ( logging , level ) ) logger . DATA = LOG_DATA logger . DETAILS = LOG_DETAILS logger . ALL = LOG_ALL logger . details = lambda message : logger . log ( LOG_DETAILS , message ) logger . data = lambda message : logger . log ( LOG_DATA , message ) logger . all = lambda message : logger . log ( LOG_ALL , message ) return logger
Create did logger