Constructor
@param options - Command line options
@param logger - Instance of BaseLogger
@param LevelController - Class derived from BaseLevelController used for storing the current level
515043
function(options, logger, LevelController) {
    this.config = null;
    this.options = options;
    this.logger = logger;
    this.LevelController = LevelController;
}
909985
function Logger(options)
{
  var common;
  var winstonLogger;

  /**
   * Logs a message at a given level.
   *
   * @param {String} levelTag the tag associated with the level at which to log
   *   the message.
   * @param {String} message the message to log.
   * @param {Number} bufferMaxLength the maximum size to which the message
   *   buffer can grow.
   */
  var logMessage = function(levelTag, message, bufferMaxLength)
  {
    // initialize the winston logger if needed
    if (!winstonLogger)
    {
      winstonLogger = new winston.createLogger(
      {
        transports:
        [
          new (winston.transports.Console)(),
          new (winston.transports.File)({ filename: 'snowflake.log' })
        ],
        level: common.getLevelTag(),
        levels: common.getLevelTagsMap()
      });
    }

    // get the appropriate logging method using the level tag and use this
    // method to log the message
    winstonLogger[levelTag](message);
  };

  // create an inner implementation to which all our methods will be forwarded
  common = Core.createLogger(options, logMessage);

  /**
   * Configures this logger.
   *
   * @param {Object} options
   */
  this.configure = function(options)
  {
    common.configure(options);
  };

  /**
   * Returns the current log level.
   *
   * @returns {Number}
   */
  this.getLevel = function()
  {
    return common.getLevelNumber();
  };

  /**
   * Logs a given message at the error level.
   *
   * @param {String} message
   */
  this.error = function(message)
  {
    common.error.apply(common, arguments);
  };

  /**
   * Logs a given message at the warning level.
   *
   * @param {String} message
   */
  this.warn = function(message)
  {
    common.warn.apply(common, arguments);
  };

  /**
   * Logs a given message at the info level.
   *
   * @param {String} message
   */
  this.info = function(message)
  {
    common.info.apply(common, arguments);
  };

  /**
   * Logs a given message at the debug level.
   *
   * @param {String} message
   */
  this.debug = function(message)
  {
    common.debug.apply(common, arguments);
  };

  /**
   * Logs a given message at the trace level.
   *
   * @param {String} message
   */
  this.trace = function(message)
  {
    common.trace.apply(common, arguments);
  };

  /**
   * Returns the log buffer.
   *
   * @returns {String[]}
   */
  this.getLogBuffer = function()
  {
    return common.getLogBuffer();
  };
}
38894
function setupLogger() {
  "use strict";
  var options = require('./config');

  if (options.v.length == 3) {
    Logger.level = Logger.levels.verbose;
  } else if (options.v.length == 2) {
    Logger.level = Logger.levels.debug;
  } else if (options.v.length == 1) {
    Logger.level = Logger.levels.info;
  } else if (options.s) {
    Logger.level = Logger.levels.noLog;
  }
}
944581
function handleLogger (config) {
  const configOptions = (config.logger || {}).options
  let Logger
  if (config.logger == null || config.logger.name === 'default') {
    Logger = DefaultLogger
  } else {
    Logger = resolvePluginClass(config.logger, 'logger')
  }

  if (configOptions instanceof Array) {
    // Note: This will not work on options without filename, and
    // is biased against for the winston logger
    let options
    for (let i = 0; i < configOptions.length; i++) {
      options = configOptions[i].options
      if (options && options.filename) {
        options.filename = fileUtils.lookupConfRequirePath(options.filename)
      }
    }
  }

  config.logger = new Logger(configOptions)
  if (!config.logger.info) {
    config.logger.debug = config.logger.log.bind(config.logger, C.LOG_LEVEL.DEBUG)
    config.logger.info = config.logger.log.bind(config.logger, C.LOG_LEVEL.INFO)
    config.logger.warn = config.logger.log.bind(config.logger, C.LOG_LEVEL.WARN)
    config.logger.error = config.logger.log.bind(config.logger, C.LOG_LEVEL.ERROR)
  }
  if (LOG_LEVEL_KEYS.indexOf(config.logLevel) !== -1) {
    // NOTE: config.logLevel has highest priority, compare to the level defined
    // in the nested logger object
    config.logLevel = C.LOG_LEVEL[config.logLevel]
    config.logger.setLogLevel(config.logLevel)
  }
}
190946
public static void log(Logger logger,
                           Level level,
                           String message) {
        log(logger, level, message, NO_PARAMETERS);
    }
37299
private static void setJULLevel( java.util.logging.Logger logger, String log4jLevelConfig )
    {
        java.util.logging.Level level = log4jLevelToJULLevel( log4jLevelConfig );
        logger.setLevel( level );
    }
477193
function Logger(level, opts) {
	if (!(this instanceof Logger)) return new Logger(level)

	var addTimestamp, name

	if (typeof(level) === 'object') {
		opts = level
		level = opts.level		
	}

	if (typeof(opts) === 'object') {
		addTimestamp = opts.addTimestamp
		name = opts.name
	} else {
		addTimestamp = opts
	}

	if (addTimestamp === undefined)
		addTimestamp = true

	if (name) 
		this.name = '[' + name + '] '
	else 
		this.name = ''

	level = level || LogLevel.INFO
	this.outputs = []
	this.setLevel(level)
	this.addOutput(Logger.consoleLogOutput, addTimestamp)
}
798222
public void changeLogger(final String name, final String levelStr, boolean parent) throws IllegalArgumentException
	{
		Level level = getLevel(levelStr);
		changeLogger(name, level, parent);
	}
719565
def setup_logging(level, logger_name=None, handler=None, log_formatter=None):
    
    root_logger = logging.getLogger()

    if logger_name is None:
        logger = root_logger
        root_logger.info("Set %i level to root logger", level)
    else:
        logger = logging.getLogger(logger_name)
        root_logger.info("Set %i level to logger %r", level, logger_name)

    if level == 100:
        # Remove all existing handlers and set only NullHandler():
        set_handler(logger, logging.NullHandler())
        logger.disabled = True
        return

    logger.setLevel(level=level)

    if log_formatter is None:
        log_formatter = "%(relativeCreated)-5d %(levelname)8s %(module)13s %(lineno)d %(message)s"
    formatter = logging.Formatter(log_formatter)

    if handler is None:
        handler = logging.StreamHandler()
    handler.setFormatter(formatter)

    if hasattr(handler, "baseFilename"):
        root_logger.debug("Log to file: %s (%s)", handler.baseFilename, repr(handler))
    else:
        root_logger.debug("Log to handler: %s", repr(handler))

    # Remove all existing handlers and set only the given handler:
    set_handler(logger, handler)

    log.log(level, "Set logging to level %i %s", level, logging.getLevelName(level))
876488
function Logger() {
  this._level = LEVELS.NOTICE;
  this._out = process.stdout;
  this._err = process.stderr;

  /* istanbul ignore next: allow server to suppress logs */
  if(process.env.NODE_ENV === Constants.TEST && !process.env.TEST_DEBUG) {
    this.log = function noop(){};
  }
}
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)
562189
def logger_level=(level)
      logger.level = LOGGER_LEVEL[level] if LOGGER_LEVEL.key?(level)
      logger
    end
733222
def addLogger(self, logger, level=logging.INFO):
        
        if isinstance(logger, logging.Logger):
            logger = logger.name
        
        if logger in self._loggers:
            return
        
        # allow the handler to determine the level for this logger
        if logger == 'root':
            _log = logging.getLogger()
        else:
            _log = logging.getLogger(logger)
        
        _log.addHandler(self.handler())
        
        self._loggers.add(logger)
        self.handler().setLoggerLevel(logger, level)
891965
public static void log(final Level level, final Throwable exception) {
		String nameOfException = exception.getClass().getName();
		String messageOfException = exception.getMessage();

		if (messageOfException == null || messageOfException.isEmpty()) {
			System.err.println("LOGGER " + level + ": " + nameOfException);
		} else {
			System.err.println("LOGGER " + level + ": " + messageOfException + " (" + nameOfException + ")");
		}
	}
22110
function(logger, LevelController, moduleDir) {
    if(logger === null) {
        this.logger = new ConsoleLogger(false);
    } else if(logger instanceof BaseLogger) {
        this.logger = logger;
    } else {
        throw Errors.invalidParameter('logger', 'BaseLogger');
    }
    
    this.commandLineParser = null;
    this.moduleDir = moduleDir;
    this.LevelController = LevelController;
}
362685
function Logger (level, name) {
  if (name) {
    debug = require('debug')(typeof name === 'string' ? name : 'vxx');
  }
  this.level = level;
  this.debug('Logger started');
}
1015616
public static void setStandaloneLogging(Level level) {
        LOGGER.setUseParentHandlers(false);
        for (Handler h : LOGGER.getHandlers()) {
            LOGGER.removeHandler(h);
        }
        StdoutHandler handler = new StdoutHandler();
        handler.setFormatter(new InlineFormatter());
        LOGGER.addHandler(handler);
        
        final UncaughtExceptionHandler ueh = Thread.getDefaultUncaughtExceptionHandler();
        Thread.setDefaultUncaughtExceptionHandler((t, e) -> {
            LOGGER.log(Level.SEVERE, "Uncaught Exception in thread " + t.getName(), e);
            if (ueh != null) {
                ueh.uncaughtException(t, e);
            }
        });
        
        setLogLevel(level);
    }