Sets global logging options for ADAL.
@param {LoggingOptions} options
429603
function(options) {
    if (!options) {
      options = {};
    }

    if (options.log) {
      if (!_.isFunction(options.log)) {
        throw new Error('setLogOptions expects the log key in the options parameter to be a function');
      }
    } else {
      // if no log function was passed set it to a default no op function.
      options.log = function() {};
    }

    if (options.level) {
      var level = options.level;
      if (level < 0 || level > 3) {
        throw new Error('setLogOptions expects the level key to be in the range 0 to 3 inclusive');
      }
    } else {
      options.level = this.LOGGING_LEVEL.ERROR;
    }

    if (options.loggingWithPII != true) {
      options.loggingWithPII = false;
    }
    
    this.LogOptions = options;
  }
645269
function addOptions(queryOptions, options) {
	const {transaction, logging} = options;
	if (transaction !== undefined) queryOptions.transaction = transaction;
	if (logging !== undefined) queryOptions.logging = logging;
	return queryOptions;
}
450133
def try_to_set_up_global_logging():
    
    root = logging.getLogger()
    root.setLevel(logging.DEBUG)
    formatter = logging.Formatter(
        '%(asctime)s %(levelname)-7s %(threadName)-10s:%(process)d [%(filename)s:%(funcName)s():%(lineno)s] %(message)s')

    if env.is_debug():
        handler = logging.StreamHandler()
        handler.setLevel(logging.DEBUG)
        handler.setFormatter(formatter)

        root.addHandler(handler)

    try:
        handler = logging.FileHandler(GLOBAL_LOG_FNAME, mode='w')
        handler.setLevel(logging.DEBUG)
        handler.setFormatter(formatter)

        root.addHandler(handler)
    except IOError as e:  # eg. in case wandb directory isn't writable
        termerror('Failed to set up logging: {}'.format(e))
        return False

    return True
650546
function App(options) {
	const logPrefix = topLogPrefix + 'App() - ';
	const that      = this;

	that.options = options || {};

	if (! that.options.log) {
		const lUtils = new LUtils();

		that.options.log = new lUtils.Log();
	}
	that.log = that.options.log;

	that.log.debug(logPrefix + 'Started with options: ' + JSON.stringify(options));

	// Backwards compatible with 2.0 and 2.1
	if (that.options.middleware) {
		that.options.middlewares = that.options.middleware;
	}

	that.middlewares = that.options.middlewares;
}
516306
function(options)
    {
      var logTag = options.logLevel;
      if (Util.exists(logTag))
      {
        // check that the specified value is a valid tag
        Errors.checkArgumentValid(LoggerCore.isValidLogTag(logTag),
            ErrorCodes.ERR_GLOGAL_CONFIGURE_INVALID_LOG_LEVEL);

        Logger.getInstance().configure(
        {
          level: LoggerCore.logTagToLevel(logTag)
        });
      }

      var insecureConnect = options.insecureConnect;
      if (Util.exists(insecureConnect))
      {
        // check that the specified value is a boolean
        Errors.checkArgumentValid(Util.isBoolean(insecureConnect),
            ErrorCodes.ERR_GLOBAL_CONFIGURE_INVALID_INSECURE_CONNECT);

        GlobalConfig.setInsecureConnect(insecureConnect);
      }
    }
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;
  }
}
321372
def _set_global_defaults(xmlglobals):
    """"""
    for key, val in xmlglobals.items():
        if key != "defaults":
            for name, tag in val.items():
                _update_from_globals(tag, xmlglobals, None)
697992
function Logger(options) {
  if (!(this instanceof Logger))
    return new Logger(options);

  this.level = Logger.levels.NONE;
  this.colors = Logger.HAS_TTY;
  this.console = true;
  this.shrink = true;
  this.closed = true;
  this.closing = false;
  this.filename = null;
  this.stream = null;
  this.contexts = Object.create(null);
  this.locker = new Lock();

  if (options)
    this.set(options);
}
505404
function Option(handler, options, desc) {
  Option.super_.apply(this, [handler, options, desc]);

  if (options.params && options.params.hasOwnProperty('optional')) {
    throw new Error('optional parameter is not allowed for options');
  }
}
460360
def configure(self, options, conf):
        
        super(S3Logging, self).configure(options, conf)
        self.options = options
270102
def setLoggingFromOptions(options):
    
    #We can now set up the logging info.
    if options.logLevel is not None:
        setLogLevel(options.logLevel) #Use log level, unless flags are set..

    if options.logOff:
        setLogLevel("OFF")
    elif options.logInfo:
        setLogLevel("INFO")
    elif options.logDebug:
        setLogLevel("DEBUG")

    logger.info("Logging set at level: %s" % logLevelString)

    if options.logFile is not None:
        addLoggingFileHandler(options.logFile, options.logRotating)

    logger.info("Logging to file: %s" % options.logFile)
984083
function applyLoggingOptions(config) {
  if (config.color === false) {
    logger.transports.console.colorize = false;
    reporterOutputLogger.transports.console.colorize = false;
  }

  // TODO https://github.com/apiaryio/dredd/issues/1346
  if (config.loglevel) {
    const loglevel = config.loglevel.toLowerCase();
    if (loglevel === 'silent') {
      logger.transports.console.silent = true;
    } else if (loglevel === 'warning') {
      logger.transports.console.level = 'warn';
    } else if (loglevel === 'debug') {
      logger.transports.console.level = 'debug';
      logger.transports.console.timestamp = true;
    } else if (['warn', 'error'].includes(loglevel)) {
      logger.transports.console.level = loglevel;
    } else {
      logger.transports.console.level = 'warn';
      throw new Error(`The logging level '${loglevel}' is unsupported, `
        + 'supported are: silent, error, warning, debug');
    }
  } else {
    logger.transports.console.level = 'warn';
  }
}
1084002
function(opt) {
        if ( typeof(Logger.initialized) != "undefined" ) {
            console.debug("Logger instance already exists. Loading it.");
            return getInstance(opt)
        } else {
            Logger.initialized = true;
            Logger.instance = self;
            setDefaultLevels();
        }
    }
1057998
function getOptions(grunt, task) {
    var globalOpts = grunt.config(task.name).options;
    var localOpts = grunt.config([task.name, task.target]).options;
    var opts = _.merge({}, DEFAULT_OPTIONS, globalOpts, localOpts);

    // Set logging options
    log4js.setGlobalLogLevel(log4js.levels[opts.logLevel]);
    log4js.configure(LOG_OPTIONS);

    opts.code = expandFiles(opts.code, opts.basePath);
    opts.specs = expandFiles(opts.specs, opts.basePath);
    opts.mutate = expandFiles(opts.mutate, opts.basePath);

    if (opts.karma) {
        opts.karma.notIncluded = expandFiles(opts.karma.notIncluded, opts.basePath);
    }

    var requiredOptionsSetErr = areRequiredOptionsSet(opts);
    if(requiredOptionsSetErr !== null) {
        grunt.warn('Not all required options have been set properly. ' + requiredOptionsSetErr);
        return null;
    }

    ensureReportersConfig(opts);
    ensureIgnoreConfig(opts);

    return opts;
}
1374761
def addOptions(parser, config=Config()):
    
    # Wrapper function that allows toil to be used with both the optparse and
    # argparse option parsing modules
    addLoggingOptions(parser)  # This adds the logging stuff.
    if isinstance(parser, ArgumentParser):
        def addGroup(headingString, bodyString):
            return parser.add_argument_group(headingString, bodyString).add_argument

        parser.register("type", "bool", lambda v: v.lower() == "true")  # Custom type for arg=True/False.
        _addOptions(addGroup, config)
    else:
        raise RuntimeError("Unanticipated class passed to addOptions(), %s. Expecting "
                           "argparse.ArgumentParser" % parser.__class__)
1351163
function setConfig (options) {
  Object.keys(options).forEach((option) => {
    if (config[option] !== undefined) {
      config[option] = options[option]
    }
  })
}
979245
function(options) {
            options = _.defaults(options || {}, {
                silent: false
            });
            this.attributes = {};
            if (!options.silent) {
                this.trigger("clear");
                this.trigger("change");
            }
            return this;
        }