Config the logging.
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)
645863
def config_logging(args):
    '''  '''
    if args.quiet:
        logging.getLogger().setLevel(logging.CRITICAL)
    elif args.verbose:
        logging.getLogger().setLevel(logging.DEBUG)
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)
817768
def _configure_root_logger(self):
        """"""
        root_logger = logging.getLogger()
        root_logger.setLevel(logging.DEBUG)
        if self.args.verbose:
            handler = logging.StreamHandler(sys.stdout)
        else:
            handler = logging.handlers.RotatingFileHandler(
                common.LOG_FILE,
                maxBytes=common.MAX_LOG_SIZE,
                backupCount=common.MAX_LOG_COUNT
            )
            handler.setLevel(logging.INFO)
        handler.setFormatter(logging.Formatter(common.LOG_FORMAT))
        root_logger.addHandler(handler)
200670
def logging_config(self):
        
        cfg = self._conf_values.get('pyemma', 'logging_config')
        if cfg == 'DEFAULT':
            cfg = os.path.join(self.cfg_dir, Config.DEFAULT_LOGGING_FILE_NAME)
        return cfg
1060582
def _default(cls, opts):
        """"""
        logging.basicConfig(level=logging.INFO, format=cls._log_format)
        return True
386659
def _set_log_level(self):
        
        # set log level on logger
        log_level = "INFO"
        if hasattr(self._config, "level") and self._config.level.upper() in ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]:
            log_level = self._config.level.upper()
        self._log_level = log_level
1222495
private function config()
    {
        $this->_library->setEnvironment();
        $this->_library->setCharset();
        $this->_library->setLog();
    }
13830
def init_logging():
    """"""
    with open(os.path.join(os.path.dirname(__file__),'logging.conf'), 'r') as yf:
        config = yaml.load(yf)
    logging.config.dictConfig(config)
375902
def start_logger(self):
        
        level = self.real_level(self.level)
        logging.basicConfig(level=level)
        self.set_logger(self.name, self.level)
        config.dictConfig(self.config)
        self.logger = logging.getLogger(self.name)
672216
def configure_logging
      Chef::Log.logger       = AuditLogger.new(sensitive_inputs)
      Chef::Log.logger.level = Log.level_from_sym(Log.level)
    end
611709
def log_config():
    """"""
    conf = '\n'.join(
            ['{}="{}"'.format(k, v) for k, v
             in sorted(options.as_dict().iteritems())])
    logging.info('Service started with the following settings:\n' + conf)
247301
public static void configureLogging() {
		// Create the appender that will write log messages to the console.
		ConsoleAppender consoleAppender = new ConsoleAppender();
		// Define the pattern of log messages.
		// Insert the string "%c{1}:%L" to also show class name and line.
		String pattern = "%d{yyyy-MM-dd HH:mm:ss} %-5p - %m%n";
		consoleAppender.setLayout(new PatternLayout(pattern));
		// Change to Level.ERROR for fewer messages:
		consoleAppender.setThreshold(Level.INFO);

		consoleAppender.activateOptions();
		Logger.getRootLogger().addAppender(consoleAppender);
	}
1075116
protected void configure() {
		String className = AsyncFileLogger.class.getName();
		ClassLoader cl = Thread.currentThread().getContextClassLoader();

		// Get configured log directory
		directory = getProperty(className + ".directory", "");
		if (directory.isEmpty()) {
			directory = getProperty("moleculer.log.directory", "");
		}

		// Automatic directory selection
		// services.moleculer.logger.AsyncFileLogger.directory = #AUTO
		if (directory.startsWith("#")) {
			String found = null;

			// Detect by "catalina.home" System Property
			String path = System.getProperty("catalina.home");
			if (path != null && path.length() > 0) {
				File test = new File(path, "logs");
				if (test.isDirectory()) {
					found = test.getAbsolutePath();
				}
			}

			// Detect by classpath
			if (found == null) {

				// Lehetséges útvonalak
				HashSet<String> paths = new HashSet<String>();
				paths.add("/moleculer");
				paths.add("/Program Files/moleculer");
				paths.add("/Program Files (x86)/moleculer");
				paths.add("/opt/moleculer");

				String cp = System.getProperty("java.class.path");
				if (paths != null) {
					String pathSeparator = System.getProperty("path.separator");
					if (pathSeparator == null || pathSeparator.length() == 0) {
						pathSeparator = ";:";
					}
					StringTokenizer st = new StringTokenizer(cp, pathSeparator);
					while (st.hasMoreTokens()) {
						path = st.nextToken().trim();
						if (path.length() > 0) {
							path = path.replace('\\', '/');
							int index = path.lastIndexOf('/');
							if (index > -1) {
								path = path.substring(0, index);
							}
							paths.add(path);
						}
					}
				}
				for (String test : paths) {
					found = findLogDirectory(new File(test));
					if (found != null) {
						found = found.replace('\\', '/');
						break;
					}
				}
			}
			if (found == null) {
				found = System.getProperty("user.home", "") + "/logs";
			}
			directory = found;
		}

		if (directory.isEmpty()) {
			logDirectory = null;
		} else {
			logDirectory = new File(directory);
			if (!logDirectory.isDirectory()) {
				logDirectory.mkdirs();
			}
		}

		if (prefix == null) {
			prefix = getProperty(className + ".prefix", "moleculer-");
		}

		// Set 'compress after days' property
		String day = getProperty(className + ".compressAfter", "");
		if (!day.isEmpty()) {
			if (!day.endsWith("days")) {
				throw new IllegalArgumentException("The \"compressAfter\" must be in days (eg. \"14 days\")!");
			}
			compressAfterDays = Integer.parseInt(day.substring(0, day.length() - 4).trim());
		}

		// Set "delete after days" property
		day = getProperty(className + ".deleteAfter", "");
		if (!day.isEmpty()) {
			if (!day.endsWith("days")) {
				throw new IllegalArgumentException("The \"deleteAfter\" must be in days (eg. \"14 days\")!");
			}
			deleteAfterDays = Integer.parseInt(day.substring(0, day.length() - 4).trim());
			if (deleteAfterDays < compressAfterDays || compressAfterDays < 2 || deleteAfterDays < 2) {
				throw new IllegalArgumentException("Invalid values (delete logs after " + deleteAfterDays
						+ " days, compress logs after " + compressAfterDays + " days)!");
			}
		}

		// Set formatter
		String formatterName = getProperty(className + ".formatter", null);
		if (formatterName != null && !formatterName.isEmpty()) {
			try {
				setFormatter((Formatter) cl.loadClass(formatterName).newInstance());
			} catch (Exception ignored) {
			}
		}
		if (getFormatter() == null) {
			setFormatter(new FastLogFormatter());
		}

		// Set file encoding
		fileEncoding = getProperty(className + ".encoding", "UTF8");

		// Log to console
		logToConsole = Boolean.parseBoolean(getProperty(className + ".logToConsole", "false"));

		// Enable colors
		enableColors = Boolean.parseBoolean(getProperty(className + ".enableColors", "true"));

		// Set level
		setLevel(Level.parse(getProperty(className + ".level", Level.INFO.toString())));

		// Print log directory
		if (logDirectory != null) {
			try {
				LogRecord record = new LogRecord(Level.INFO,
						"Directory of log files: " + logDirectory.getCanonicalPath());
				record.setSourceClassName(AsyncFileLogger.class.getName());
				publish(record);
			} catch (Exception cause) {
				cause.printStackTrace();
			}
		}
	}
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
1024516
def configure(self, config):
        
        self._level = LogLevelConverter.to_log_level(config.get_as_object("level"))
        self._source = config.get_as_string_with_default("source", self._source)
525010
def log_config(verbose=1):
    """"""
    # ENH:
    # - do print levelname before DEBUG and WARNING
    # - instead of %module, name the currently running script
    #   - make a subclass of logging.handlers.X instead?
    #   - tweak %root?
    #   - take __file__ as an argument?
    if verbose == 0:
        level = logging.WARNING
        fmt = "%(module)s: %(message)s"
    elif verbose == 1:
        level = logging.INFO
        fmt = "%(module)s [@%(lineno)s]: %(message)s"
    else:
        level = logging.DEBUG
        fmt = "%(module)s [%(lineno)s]: %(levelname)s: %(message)s"
    logging.basicConfig(format=fmt, level=level)