Set the configuration for the Logger
975661
def _parse_input_parameters(self):
        
        Global.LOGGER.debug("define and parsing command line arguments")
        parser = argparse.ArgumentParser(
            description='A workflow engine for Pythonistas', formatter_class=argparse.RawTextHelpFormatter)
        parser.add_argument('FILENAME', nargs='+',help='name of the recipe file(s)')
        parser.add_argument('-i', '--INTERVAL', type=int, default=500,
                            metavar=('MS'),
                            help='perform a cycle each [MS] milliseconds. (default = 500)')

        parser.add_argument('-m', '--MESSAGEINTERVAL', type=int, 
                            metavar=('X'),
                            help='dequeue a message each [X] tenth of milliseconds. (default = auto)')
        parser.add_argument('-s', '--STATS', type=int, default=0,
                            metavar=('SEC'),
                            help='show stats each [SEC] seconds. (default = NO STATS)')
        parser.add_argument('-t', '--TRACE', action='store_true',help='enable super verbose output, only useful for tracing')                            
        parser.add_argument('-v', '--VERBOSE', action='store_true',help='enable verbose output')
        parser.add_argument('-V', '--VERSION',
                            action="version", version=__version__)

        args = parser.parse_args()
        return args
46053
def configure(conf, default_config=None):
    
    if conf.logconfig and os.path.isfile(conf.logconfig):
        logging.config.fileConfig(conf.logconfig,
                                  disable_existing_loggers=False)
    elif default_config and os.path.isfile(default_config):
        logging.config.fileConfig(default_config,
                                  disable_existing_loggers=False)
    else:
        init_console_logging(conf)
1339905
public void configureLogging(final LoggingSettings loggingSettings) {

        final Logger root = (Logger)LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
        final LoggerContext context = root.getLoggerContext();

        // Reset prior configuration
        context.reset();

        // Propagate level changes to java.util.logging
        final LevelChangePropagator propagator = new LevelChangePropagator();
        propagator.setContext(context);
        propagator.setResetJUL(true);

        // Set base threshold for all other loggers.
        root.setLevel(loggingSettings.getLevel());

        // Loop through explicitly configured loggers and set the levels
        for (final Map.Entry<String, Level> entry : loggingSettings.getLoggers().entrySet()) {
            ((Logger)LoggerFactory.getLogger(entry.getKey())).setLevel(entry.getValue());
        }

        if (loggingSettings.getLogFile().isEnabled()) {
            root.addAppender(getFileAppender(loggingSettings.getLogFile(), context));
        }

        if (loggingSettings.getConsole().isEnabled()) {
            root.addAppender(getConsoleAppender(loggingSettings.getConsole(), context));
        }
    }
1227899
def log_config(self, logger):
        """'"""

        logger.info("app_name: %s", self.app_name)
        logger.info("app_version: %s", self.app_version)
        logger.info("current configuration:")
        config = [(key, self.option_definitions[key].value)
                  for key in self.option_definitions.keys_breadth_first()
                  if key not in self.keys_blocked_from_output]
        config.sort()
        for key, val in config:
            if (
                self.option_definitions[key].secret
                or 'password' in key.lower()
            ):
                logger.info('%s: *********', key)
            else:
                try:
                    logger.info('%s: %s', key,
                                to_string_converters[type(key)](val))
                except KeyError:
                    logger.info('%s: %s', key, val)
183831
def configure_logging(args):
    """"""
    log_format = logging.Formatter('%(levelname)s:%(name)s:line %(lineno)s:%(message)s')
    log_level = logging.INFO if args.verbose else logging.WARN
    log_level = logging.DEBUG if args.debug else log_level
    console = logging.StreamHandler()
    console.setFormatter(log_format)
    console.setLevel(log_level)
    root_logger = logging.getLogger()
    if len(root_logger.handlers) == 0:
        root_logger.addHandler(console)
    root_logger.setLevel(log_level)
    root_logger.handlers[0].setFormatter(log_format)
    logging.getLogger(__name__)
1348700
def configure(**kwargs):
        """"""
        for key in kwargs:
            if key == 'is_logging_enabled':
                Event.is_logging_enabled = kwargs[key]
            elif key == 'collector_queue':
                Event.collector_queue = kwargs[key]
            else:
                Logger.get_logger(__name__).error("Unknown key %s in configure or bad type %s",
                                                  key, type(kwargs[key]))
392036
def configure():
    """"""
    log_levels = {
        5: logging.NOTSET,
        4: logging.DEBUG,
        3: logging.INFO,
        2: logging.WARNING,
        1: logging.ERROR,
        0: logging.CRITICAL
    }

    logging.captureWarnings(True)
    root_logger = logging.getLogger()
    if settings.CFG["debug"]:
        details_format = logging.Formatter(
            '%(name)s (%(filename)s:%(lineno)s) [%(levelname)s] %(message)s')
        details_hdl = logging.StreamHandler()
        details_hdl.setFormatter(details_format)
        root_logger.addHandler(details_hdl)
    else:
        brief_format = logging.Formatter('%(message)s')
        console_hdl = logging.StreamHandler()
        console_hdl.setFormatter(brief_format)
        root_logger.addHandler(console_hdl)
    root_logger.setLevel(log_levels[int(settings.CFG["verbosity"])])

    configure_plumbum_log()
    configure_migrate_log()
    configure_parse_log()
946295
def logger(self, logger):
        """"""
        if logger is None or not isinstance(logger, Logger):
            raise ValueError("Logger can not be set to None, and must be of type logging.Logger")

        self._logger = logger
949212
public void configure(Configuration config) throws ConfigurationException
    {
        LoggingConfiguration lc = (LoggingConfiguration) config;
        String levelName = lc.getLogLevel(name);
        setLevel(levelName);
    }
93846
def configure_logging(verbose, logger):
    """"""
    if not verbose:
        log_level = logging.WARNING
    elif verbose == 1:
        log_level = logging.INFO
    else:
        log_level = logging.DEBUG
    logger.setLevel(log_level)
    ch = colorlog.StreamHandler()
    ch.setLevel(log_level)
    formatter = colorlog.ColoredFormatter(
        '%(log_color)s%(asctime)s %(name)s %(levelname)s: %(message)s')
    ch.setFormatter(formatter)
    logger.addHandler(ch)
1032229
def configure(self):
        """"""
        if self.debug is not None and not self.debug:
            self._remove_debug_handlers()
        self._remove_debug_only()
        logging.config.dictConfig(self.config)
        try:
            logging.captureWarnings(True)
        except AttributeError:
            pass
492694
def _set_defaults(self, log_level=logging.INFO, redirect_stdout=False):
        """"""

        # Remove all previous handlers
        for handler in self.handlers[:]:
            self.removeHandler(handler)

        # Set levels
        self.setLevel(logging.DEBUG)

        # Set up the stdout handler
        self.fh = None
        self.sh = logging.StreamHandler()
        self.sh.emit = colored_formatter
        self.addHandler(self.sh)

        self.sh.setLevel(log_level)

        # warnings.showwarning = self._show_warning

        # Redirects all stdout to the logger
        if redirect_stdout:
            sys.stdout = LoggerStdout(self._print)

        # Catches exceptions
        sys.excepthook = self._catch_exceptions
832627
def setup_logging(config=None):
    """"""
    # TODO: integrate in general config file
    print(__name__)
    if config and config.get('logging'):
        logging.config.dictConfig(config.get('logging'))
    else:
        logging.basicConfig(format='%(asctime)s %(levelname)s:%(message)s',
                            level=logging.DEBUG)
101339
void changeLoggerLevel(LoggerLevel clickedLevel, Set<Logger> clickedLogger) {

        for (Logger logger : clickedLogger) {
            @SuppressWarnings("resource")
            LoggerContext context = logger.getContext();
            Configuration config = context.getConfiguration();
            LoggerConfig loggerConfig = config.getLoggerConfig(logger.getName());
            LoggerConfig specificConfig = loggerConfig;
            if (!loggerConfig.getName().equals(logger.getName())) {
                specificConfig = new LoggerConfig(logger.getName(), clickedLevel.getLevel(), true);
                specificConfig.setParent(loggerConfig);
                config.addLogger(logger.getName(), specificConfig);
            }
            specificConfig.setLevel(clickedLevel.getLevel());
            context.updateLoggers();
        }
        updateLevel();
    }
109997
def set_logger(self):
        
        self.logger = logging.getLogger(self.logger_name)
        self.logger.setLevel(self.logger_level)
1305681
def setup_logging(logging_config, debug=False):
    """"""

    if logging_config is not None:
        logging.config.fileConfig(logging_config)

    else:
        logging.basicConfig(level=debug and logging.DEBUG or logging.ERROR)
894556
def setup_logging(home, verbose):
    """"""
    logging.setLoggerClass(MyLogger)
    logging.config.dictConfig({
        "version": 1,
        "disable_existing_loggers": False,
        "formatters": {
            "console": {
                "format": "%(levelname)-8s [%(asctime)s %(name)s] %(filename)s:%(lineno)s %(funcName)s: %(message)s",
            },
            "json": {
                "()": jsonlogger.JsonFormatter,
                "format": "%(levelname)s %(asctime)s %(name)s %(filename)s %(lineno)s %(funcName)s %(message)s",
            },
        },
        "handlers": {
            "default": {
                "level": "DEBUG" if verbose else "INFO",
                "class": "logging.StreamHandler",
                "formatter": "console",
            },
            "file": {
                "level": "DEBUG",
                "class": "logging.handlers.WatchedFileHandler",
                "filename": os.path.join(home, DEBUG_LOG_FILE),
                "formatter": "json",
            },
        },
        "loggers": {
            "": {
                "handlers": ["default", "file"],
                "level": "DEBUG",
                "propagate": True,
            },
        }
    })