set up the logging system with the configured (in pyemma.cfg) logging config (logging.yml)
    @param config: instance of pyemma.config module (wrapper)
199983
def setup_logging(config, D=None):
    
    if not D:
        import yaml

        args = config.logging_config
        default = False

        if args.upper() == 'DEFAULT':
            default = True
            src = config.default_logging_file
        else:
            src = args

        # first try to read configured file
        try:
            with open(src) as f:
                D = yaml.load(f)
        except EnvironmentError as ee:
            # fall back to default
            if not default:
                try:
                    with open(config.default_logging_file) as f2:
                        D = yaml.load(f2)
                except EnvironmentError as ee2:
                    raise LoggingConfigurationError('Could not read either configured nor '
                                                    'default logging configuration!\n%s' % ee2)
            else:
                raise LoggingConfigurationError('could not handle default logging '
                                                'configuration file\n%s' % ee)

        if D is None:
            raise LoggingConfigurationError('Empty logging config! Try using default config by'
                                            ' setting logging_conf=DEFAULT in pyemma.cfg')
    assert D

    # this has not been set in PyEMMA version prior 2.0.2+
    D.setdefault('version', 1)
    # if the user has not explicitly disabled other loggers, we (contrary to Pythons
    # default value) do not want to override them.
    D.setdefault('disable_existing_loggers', False)

    # configure using the dict
    try:
        dictConfig(D)
    except ValueError as ve:
        # issue with file handler?
        if 'files' in str(ve) and 'rotating_files' in D['handlers']:
            print("cfg dir", config.cfg_dir)
            new_file = os.path.join(config.cfg_dir, 'pyemma.log')
            warnings.warn("set logfile to %s, because there was"
                          " an error writing to the desired one" % new_file)
            D['handlers']['rotating_files']['filename'] = new_file
        else:
            raise
        dictConfig(D)

    # get log file name of pyemmas root logger
    logger = logging.getLogger('pyemma')
    log_files = [getattr(h, 'baseFilename', None) for h in logger.handlers]

    import atexit
    @atexit.register
    def clean_empty_log_files():
        # gracefully shutdown logging system
        logging.shutdown()
        for f in log_files:
            if f is not None and os.path.exists(f):
                try:
                    if os.stat(f).st_size == 0:
                        os.remove(f)
                except OSError as o:
                    print("during removal of empty logfiles there was a problem: ", o)
171043
def configure_logging(conf):
    """"""
    logging.config.dictConfig({
        'version': 1,
        'disable_existing_loggers': False,
        'formatters': {
            'standard': {
                'format': '%(asctime)s [%(name)s] %(levelname)s '
                          '%(processName)s: %(message)s'
            }
        },
        'handlers': {
            'file': {
                'level': conf.LOG_FILE_LEVEL,
                'filename': conf.LOG_FILE,
                'class': 'logging.FileHandler',
                'formatter': 'standard',
            },
            'stdout': {
                'level': conf.LOG_STDOUT_LEVEL,
                'class': 'pyphi.log.TqdmHandler',
                'formatter': 'standard',
            }
        },
        'root': {
            'level': 'DEBUG',
            'handlers': (['file'] if conf.LOG_FILE_LEVEL else []) +
                        (['stdout'] if conf.LOG_STDOUT_LEVEL else [])
        }
    })
539856
public function configure(Config $config)
    {
        $this->log_format    = $config->getString('log_format',self::DEFAULT_LOG_FORMAT);
        $this->log_encoding  = $config->getString('log_encoding','utf8');
        $this->log_levels    = $config->getList('log_levels',['T','D','I','W','E','F']);
    }
844014
public function configure(Config $config)
    {
        parent::configure($config);

        $this->file_name = $this->processMacro($config->getString( 'file_name', '' ));
        $this->logs_dir  = $this->processMacro($config->getString( 'logs_dir', '%SYS_TEMP_DIR%/logs' ));
        $this->line_end  = $this->processMacro($config->getString( 'line_end', self::CRLF ));
    }
1217120
def configure_logging(cfg, custom_level=None):
    """"""
    import itertools as it
    import operator as op

    if custom_level is None:
        custom_level = logging.WARNING
    for entity in it.chain.from_iterable(it.imap(op.methodcaller('viewvalues'),
                                                 [cfg] + [cfg.get(k, dict()) for k in ['handlers', 'loggers']])):
        if isinstance(entity, Mapping) and entity.get('level') == 'custom':
            entity['level'] = custom_level
    logging.config.dictConfig(cfg)
    logging.captureWarnings(cfg.warnings)
703209
def config_logging(level):
    

    logger = logging.getLogger('')
    logger.setLevel(level)
    if level < logging.DEBUG:
        log_format = "%(asctime)s %(message)s"
    else:
        log_format = "%(asctime)s %(module)s : %(lineno)d  %(message)s"
    sh = logging.StreamHandler()
    sh.formatter = logging.Formatter(fmt=log_format)
    logger.handlers = []
    logger.addHandler(sh)
667102
protected void setupLogback() {

        // Check for Logback config file System Property
        // http://logback.qos.ch/manual/configuration.html
        //     -Dlogback.configurationFile=logback_prod.xml
        if (System.getProperty(LOGBACK_CONFIGURATION_FILE_PROPERTY) != null) {
            // Logback already configured
            return;
        }

        // Check for a logback configuration file declared in Fathom settings
        URL configFileUrl = settings.getFileUrl(LOGBACK_CONFIGURATION_FILE_PROPERTY, "classpath:conf/logback.xml");

        if (configFileUrl == null) {
            throw new FathomException("Failed to find Logback config file '{}'",
                    settings.getString(LOGBACK_CONFIGURATION_FILE_PROPERTY, "classpath:conf/logback.xml"));
        }

        LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();

        try (InputStream is = configFileUrl.openStream()) {
            JoranConfigurator configurator = new JoranConfigurator();
            configurator.setContext(context);
            context.reset();
            configurator.doConfigure(is);
            log.info("Configured Logback from '{}'", configFileUrl);
        } catch (IOException | JoranException je) {
            // StatusPrinter will handle this
        }

        StatusPrinter.printInCaseOfErrorsOrWarnings(context);
    }
44339
public void setLogger(Logger logger) {
        this.logger = logger;
        if (compiler instanceof AbstractCompiler) {
            ((AbstractCompiler) compiler).setLogger(logger);
        }
    }
1054580
public void configure(Config config) {
    LOGGER.debug("Reloading configuration.");
    this.configWriteLock.lock();
    try {
      this.config = config;
      processAppPackages(config);
    } finally {
      this.configWriteLock.unlock();
    }
  }
569932
def setup_logging():
    
    global console_handler

    # make sure logging is setup only once
    if console_handler:
        return

    # set the handler of the law root logger
    console_handler = logging.StreamHandler()
    console_handler.setFormatter(LogFormatter())
    logging.getLogger("law").addHandler(console_handler)

    # set levels for all loggers
    for name, level in Config.instance().items("logging"):
        level = level.upper()
        if hasattr(logging, level):
            logger = logging.getLogger(name)
            logger.setLevel(getattr(logging, level))
            logger.debug("registered logger with level '{}'".format(level))
492480
def logging_config(logpath=None,
                   level=logging.DEBUG,
                   console_level=logging.INFO,
                   no_console=False):
    
    logger = logging.getLogger('nli')
    # Remove all the current handlers
    for handler in logger.handlers:
        logger.removeHandler(handler)
    logger.handlers = []
    logger.propagate = False
    logger.setLevel(logging.DEBUG)

    formatter = logging.Formatter('%(filename)s:%(funcName)s: %(message)s')

    if logpath is not None:
        print('All Logs will be saved to {}'.format(logpath))
        logfile = logging.FileHandler(logpath, mode='w')
        logfile.setLevel(level)
        logfile.setFormatter(formatter)
        logger.addHandler(logfile)

    if not no_console:
        # Initialze the console logging
        logconsole = logging.StreamHandler()
        logconsole.setLevel(console_level)
        logconsole.setFormatter(formatter)
        logger.addHandler(logconsole)
135102
def configure_logging(self, verbosity_lvl=None, format='%(message)s'):
        
        if not verbosity_lvl:
            verbosity_lvl = logging.INFO
        logging.basicConfig(format=format)
        self.logger.setLevel(verbosity_lvl)
394847
public void setConfig(CompilerConfiguration config) {
        if (config == null) throw new NullPointerException("configuration cannot be null");
        this.config = config;
        this.groovyLoader = initGroovyLoader();
    }
4182
def setup_logging(default_path='logging.yaml', env_key='LOG_CFG'):
    
    path = default_path
    value = os.getenv(env_key, None)
    if value:
        path = value
    if os.path.exists(path):
        with open(path, 'rt') as f:
            configs = yaml.safe_load(f.read())
        logging.config.dictConfig(configs)
    else:
        logging.config.dictConfig(config)
23181
private void parseLoggingConfig(final Node node, final ConfigSettings config)
	{

		String name;
		String value;
		Node nnode;
		NodeList list = node.getChildNodes();

		int length = list.getLength();
		for (int i = 0; i < length; i++) {
			nnode = list.item(i);

			name = nnode.getNodeName().toUpperCase();
			if (name.equals(KEY_ROOT_FOLDER)) {

				value = nnode.getChildNodes().item(0).getNodeValue();
				value = value.substring(1, value.length() - 1);

				config.setConfigParameter(
						ConfigurationKeys.LOGGING_PATH_DIFFTOOL, value);

			}
			else if (name.equals(SUBSUBSECTION_DIFF_TOOL)) {

				parseLoggerConfig(nnode, config, null,
						ConfigurationKeys.LOGGING_LOGLEVEL_DIFFTOOL);

			}
		}
	}
186527
def set_config(self, config):
        
        self._config = config
        self._config.dump_to_sdb("botoConfigs", self.id)
473869
def configure_logging():
    

    if not parse_boolean(os.environ.get('DISABLE_TRUSTAR_LOGGING')):

        # configure
        dictConfig(DEFAULT_LOGGING_CONFIG)

        # construct error logger
        error_logger = logging.getLogger("error")

        # log all uncaught exceptions
        def log_exception(exc_type, exc_value, exc_traceback):
            error_logger.error("Uncaught exception", exc_info=(exc_type, exc_value, exc_traceback))

        # register logging function as exception hook
        sys.excepthook = log_exception