Create QS Logger for command context AutoLoadCommandContext or ResourceCommandContext
        :param logger_name:
        :type logger_name: str
        :param context:
        :return:
356971
def create_logger_for_context(self, logger_name, context):
        

        if self._is_instance_of(context, 'AutoLoadCommandContext'):
            reservation_id = 'Autoload'
            handler_name = context.resource.name
        elif self._is_instance_of(context, 'UnreservedResourceCommandContext'):
            reservation_id = 'DeleteArtifacts'
            handler_name = context.resource.name
        else:
            reservation_id = self._get_reservation_id(context)

            if self._is_instance_of(context, 'ResourceCommandContext'):
                handler_name = context.resource.name
            elif self._is_instance_of(context, 'ResourceRemoteCommandContext'):
                handler_name = context.remote_endpoints[0].name
            else:
                raise Exception(ContextBasedLoggerFactory.UNSUPPORTED_CONTEXT_PROVIDED, context)

        logger = get_qs_logger(log_file_prefix=handler_name,
                               log_group=reservation_id,
                               log_category=logger_name)
        return logger
527632
def configured_logger(self, name=None):
        
        log_handlers = self.log_handlers
        # logname
        if not name:
            # base name is always pulsar
            basename = 'pulsar'
            # the namespace name for this config
            name = self.name
            if name and name != basename:
                name = '%s.%s' % (basename, name)
            else:
                name = basename
        #
        namespaces = {}

        for log_level in self.log_level or ():
            bits = log_level.split('.')
            namespaces['.'.join(bits[:-1]) or ''] = bits[-1]

        for namespace in sorted(namespaces):
            if self.daemon:     # pragma    nocover
                handlers = []
                for hnd in log_handlers:
                    if hnd != 'console':
                        handlers.append(hnd)
                if not handlers:
                    handlers.append('file')
                log_handlers = handlers
            configured_logger(namespace,
                              config=self.log_config,
                              level=namespaces[namespace],
                              handlers=log_handlers)
        return logging.getLogger(name)
376058
def getLogger(name=None):
    

    if name:
        logger = SLogger.manager.getLogger(name)
        return logger
    else:
        return rootLogger
927755
def get_logger(name, level=None, fmt=':%(lineno)d: %(message)s'):
        
        if name not in Logger.loggers:
            if Logger.level is None and level is None:
                Logger.level = level = logging.ERROR
            elif Logger.level is None:
                Logger.level = level
            elif level is None:
                level = Logger.level
            logger = logging.getLogger(name)
            logger_handler = logging.StreamHandler()
            logger_handler.setFormatter(LoggingFormatter(fmt=name + fmt))
            logger.addHandler(logger_handler)
            logger.setLevel(level)
            Logger.loggers[name] = logger
        return Logger.loggers[name]
261454
def getLogger(cls, name=None):
        
        return logging.getLogger("{0}.{1}".format(cls.BASENAME, name) if name else cls.BASENAME)
1041682
def get_logger(name):
    

    log = logging.getLogger(name)
    if not log.handlers:
        log.addHandler(NullHandler())
    return log
176919
def getLogger(name, level = logging.INFO):
        
        # create logger
        logger = logging.getLogger(name) 
        logger.setLevel(level)
        # create console handler and set level to debug
        ch = logging.StreamHandler()
        ch.setLevel(level)
        # create formatter
        formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
        # add formatter to ch
        ch.setFormatter(formatter)
        # add ch to logger
        logger.addHandler(ch)
        return logger
169009
def get_logger(name):
        """"""
        if name is None:
            return NoLogger()

        logger = logging.getLogger(name)
        if Logger.use_external_configuration:
            logger.propagate = False
        return logger
628083
def capture_logger(name):
    
    import logging

    logger = logging.getLogger(name)
    try:
        import StringIO
        stream = StringIO.StringIO()
    except ImportError:
        from io import StringIO
        stream = StringIO()
    handler = logging.StreamHandler(stream)
    logger.addHandler(handler)
    try:
        yield stream
    finally:
        logger.removeHandler(handler)
305517
def set_logger(self):
        """"""
        logger = logging.getLogger(__name__)
        logger.setLevel(level=logging.INFO)
        logger_file = os.path.join(self.logs_path, 'dingtalk_sdk.logs')
        logger_handler = logging.FileHandler(logger_file)
        logger_handler.setLevel(logging.INFO)
        logger_formatter = logging.Formatter(
            '[%(asctime)s | %(name)s | %(levelname)s] %(message)s'
        )
        logger_handler.setFormatter(logger_formatter)
        logger.addHandler(logger_handler)
        return logger
772367
function Logger (context) {
    var loggerObj, i;

    if (!context || context.length === 0) {
        throw new Error("Invalid 'context' for Logger: " + context);
    }

    loggerObj = {
        debug   : function(scope, message) {
            console.debug(context + separator +
                scope +
                (message && message.length > 0 ? separator + message : "")
            );
        },
        info    : function(scope, message) {
            console.info(context + separator +
                scope +
                (message && message.length > 0 ? separator + message : "")
            );
        },
        warn    : function(scope, message) {
            console.warn(context + separator +
                scope +
                (message && message.length > 0 ? separator + message : "")
            );
        },
        error   : function(scope, message) {
            console.error(context + separator +
                scope +
                (message && message.length > 0 ? separator + message : "")
            );
        }
    };


    return loggerObj;
}
435705
def initLogger(name):  # pylint: disable=invalid-name
    '''
    
    '''
    logger = logging.getLogger(name)
    logger.setLevel(logging.INFO)
    # Skip attaching StreamHandler if one is already attached to logger
    if not getattr(logger, "streamhandler_set", None):
        consolehandler = logging.StreamHandler()
        formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
        consolehandler.setFormatter(formatter)
        consolehandler.setLevel(logging.INFO)
        logger.addHandler(consolehandler)
        logger.streamhandler_set = True
    return logger
583581
def get_logger(name):
    """"""
    if name in loggers:
        return loggers[name]
    logger = logging.getLogger(name)
    logger.propagate = False
    pre1, suf1 = hash_coloured_escapes(name) if supports_color() else ('', '')
    pre2, suf2 = hash_coloured_escapes(name + 'salt')  \
                 if supports_color() else ('', '')
    formatter = logging.Formatter(
        '%(levelname)s {}+{}+{} '
        '%(name)s: %(message)s'.format(pre1, pre2, suf1)
    )
    ch = logging.StreamHandler()
    ch.setFormatter(formatter)
    logger.addHandler(ch)
    loggers[name] = logger

    logger.once_dict = {}

    return logger
266735
public static ContextualLogger getLogger(String name, LoggerContext context) {
    return new ContextualLogger(LoggerFactory.getLogger(name), context);
  }
616068
public static Logger getL7dLogger(Class<?> cls,
                                      String resourcename,
                                      String loggerName) {
        return createLogger(cls, resourcename, loggerName);
    }
769309
public static ContextualLogger getLogger(Class clazz, LoggerContext context) {
    return new ContextualLogger(LoggerFactory.getLogger(clazz), context);
  }
333511
def make_default_logger(name=INTERNAL_LOGGER_NAME, level=logging.INFO,
                        fmt='%(asctime)s - %(name)s - %(levelname)s - %(message)s'):
    """"""
    logger = logging.getLogger(name)
    logger.setLevel(level)
    if not logger.handlers:
        handler = logging.StreamHandler(sys.stderr)
        handler.setLevel(level)
        formatter = logging.Formatter(fmt)
        handler.setFormatter(formatter)
        logger.addHandler(handler)

    return logger