Given a list or tuple of logging levels,
            add a logger instance to each.
1094
def add(self, levels, logger):
        
        if isinstance(levels, (list, tuple)):
            for lvl in levels:
                self.config[lvl].add(logger)
        else:
            self.config[levels].add(logger)
250962
def setup_logging(loglevel):
    
    logformat = "[%(asctime)s] %(levelname)s:%(name)s:%(message)s"
    logging.basicConfig(level=loglevel, stream=sys.stdout,
                        format=logformat, datefmt="%Y-%m-%d %H:%M:%S")
490152
def add_log_level(value, name):
    
    logging.addLevelName(value, name)
    setattr(logging, name, value)
1209620
public static void addDeepLogger(Object object, Level level)
    {
        addDeepLogger(object, m -> logger.log(level, m));
    }
788244
def _setup_logger(self, logging_level: int, log_to_console: bool):
        
        self.logger = logging.getLogger('discord')
        self.logger.handlers = []
        self.logger.setLevel(logging_level)
        formatter = logging.Formatter(style='{', fmt='{asctime} [{levelname}] {message}', datefmt='%Y-%m-%d %H:%M:%S')
        file_handler = logging.FileHandler('pycord.log')
        file_handler.setFormatter(formatter)
        file_handler.setLevel(logging_level)
        self.logger.addHandler(file_handler)
        if log_to_console:
            stream_handler = logging.StreamHandler(sys.stdout)
            stream_handler.setFormatter(formatter)
            stream_handler.setLevel(logging_level)
            self.logger.addHandler(stream_handler)
87117
def add_arguments(parser, default_level=logging.INFO):
	
	adder = (
		getattr(parser, 'add_argument', None)
		or getattr(parser, 'add_option')
	)
	adder(
		'-l', '--log-level', default=default_level, type=log_level,
		help="Set log level (DEBUG, INFO, WARNING, ERROR)")
579809
def log_init(level):
    
    log = logging.getLogger()
    hdlr = logging.StreamHandler()
    formatter = logging.Formatter('%(asctime)s %(name)s %(levelname)s %(message)s')
    hdlr.setFormatter(formatter)
    log.addHandler(hdlr)
    log.setLevel(level)
1047265
def add_handler(cls, level, fmt, colorful, **kwargs):
    """"""
    global g_logger
 
    if isinstance(level, str):
        level = getattr(logging, level.upper(), logging.DEBUG)
 
    handler = cls(**kwargs)
    handler.setLevel(level)
 
    if colorful:
        formatter = ColoredFormatter(fmt, datefmt='%Y-%m-%d %H:%M:%S')
    else:
        formatter = logging.Formatter(fmt, datefmt='%Y-%m-%d %H:%M:%S')
 
    handler.setFormatter(formatter)
    g_logger.addHandler(handler)
 
    return handler
540644
public void addItemForLogger(Logger logger) {

        Item item = m_container.addItem(logger);
        if (item != null) {
            item.getItemProperty(TableColumn.Channel).setValue(logger.getName());
            Logger parent = logger.getParent();
            item.getItemProperty(TableColumn.ParentChannel).setValue(parent != null ? parent.getName() : "none");
            item.getItemProperty(TableColumn.File).setValue(getLogFiles(logger));
            item.getItemProperty(TableColumn.Level).setValue(LoggerLevel.fromLogger(logger));
        }
    }
575558
def add_loghandler (handler):
    """"""
    format = "%(levelname)s %(name)s %(asctime)s %(threadName)s %(message)s"
    handler.setFormatter(logging.Formatter(format))
    logging.getLogger(LOG_ROOT).addHandler(handler)
    logging.getLogger().addHandler(handler)
1095976
def add_log_callback(callback):
    """"""
    global _log_callbacks

    if not callable(callback):
        raise ValueError("Callback must be callable")

    _log_callbacks.add(callback)
    return callback
888749
def init_logger
      log = Log4r::Logger.new(STANDARD_LOGGER)
      log.trunc = true

      # sanity checks since we defined log4r's dynamic levels statically
      unless (Log4r::DEBUG == DEBUG) &&
             (Log4r::INFO == INFO) &&
             (Log4r::WARN == WARN) &&
             (Log4r::ERROR == ERROR) &&
             (Log4r::FATAL == FATAL)
        raise "Logger levels do not match Log4r levels, levels may have been customized"
      end

      Log4r::Logger[STANDARD_LOGGER].level = WARN
      Log4r::Logger[STANDARD_LOGGER].trace = true

      Log4r::StderrOutputter.new :console
      Log4r::Outputter[:console].formatter = Log4r::PatternFormatter.new(:pattern => "[%l] %m")
      log.add(:console)
    end
4888
def log(*args, **kwargs):
    """"""
    level = kwargs.pop('level', logging.INFO)
    logger.log(level, *args, **kwargs)
218130
def setLoggerLevel(self, logger, level):
        
        if level == logging.NOTSET:
            self.removeLogger(logger)
            self.handler().setLoggerLevel(logger, level)
            return
            
        if isinstance(logger, logging.Logger):
            logger = logger.name
        
        if not logger in self._loggers:
            self.addLogger(logger, level)
        else:
            self.handler().setLoggerLevel(logger, level)
545228
def setup_logger(log_dir=None, loglevel=logging.DEBUG):
    

    create_home_dir()
    create_dir(os.path.join(get_default_home_dir(), 'log'))

    if log_dir is None:
        log_dir = os.path.join(get_default_home_dir(), 'log')

    logger = logging.getLogger('ding0') # use filename as name in log
    logger.setLevel(loglevel)

    # create a file handler
    handler = logging.FileHandler(os.path.join(log_dir, 'ding0.log'))
    handler.setLevel(logging.DEBUG)
    formatter = logging.Formatter(
        '%(asctime)s-%(funcName)s-%(message)s (%(levelname)s)')
    handler.setFormatter(formatter)

    # create a stream handler (print to prompt)
    stream = logging.StreamHandler()
    stream.setLevel(logging.INFO)
    stream_formatter = logging.Formatter(
        '%(message)s (%(levelname)s)')
    stream.setFormatter(stream_formatter)

    # add the handlers to the logger
    logger.addHandler(handler)
    logger.addHandler(stream)

    logger.info('########## New run of Ding0 issued #############')

    return logger
268037
function appendToLogs(level, args) {
      if (!args) return;

      var message = toDebugString(args);
      if (message.length <= 2) return;

      _logs.push(
        [level, formatDateStamp(), message]
      );
    }
169988
def _create_logger_(name):
    """"""
    logger = logging.getLogger(name)
    handler = logging.StreamHandler()
    handler.setFormatter(logging.Formatter('%(levelname)s %(message)s'))
    logger.addHandler(handler)
    logger.setLevel(logging.INFO)
    return logger