版本更新日志打印
@param name
@param opt
@param opt.localPkg
@param opt.lastPkg
@param opt.level
197912
function updateLog(name, opt) {
  const ulog = log[opt.level || 'success'];
  const intl = new Intl(message);
  let pre = '';
  let localVersion = '';
  const lastVersion = opt.lastPkg.version;

  if (opt.localPkg && opt.localPkg.version !== lastVersion) {
    localVersion = opt.localPkg.version;
    pre = intl.get('updateTo', { localVersion, lastVersion });
  } else {
    pre = intl.get('updateVersion', { lastVersion });
    localVersion = lastVersion;
  }

  if (opt.lastPkg.changeLog) {
    const changeLog = opt.lastPkg.changeLog.sort(
      (a, b) => (semver.lt(a.version, b.version) ? 1 : -1)
    );

    // 在警告模式下加重提示样式
    if (opt.level === 'warn') {
      const tool = getFieBin();
      const localVTip = localVersion ? intl.get('localVersion', { localVersion }) : '';
      const installTip = `${tool} install ${opt.lastPkg.name}`;

      console.log('\n');
      ulog(
        `******************** ${emoji.get('warning')} ${emoji.get('warning')}   ${intl.get(
          'updateTips'
        )}  ${emoji.get('warning')} ${emoji.get('warning')} **********************`
      );
      ulog(
        `${intl.get('recommendVersion', { name, version: chalk.green(lastVersion) })}${localVTip}`
      );
      ulog(
        intl.get('recommendInstall', {
          icon: emoji.get('point_right'),
          installTip: chalk.bgRed.bold(installTip),
        })
      );
    }

    ulog(`${name} ${pre}, ${intl.get('includeUpdate')}`);
    changeLog.forEach(item => {
      if (!item.log || !item.log.length) {
        return;
      }
      if (lastVersion === localVersion) {
        if (item.version !== lastVersion) {
          return;
        }
      } else if (!semver.lte(item.version, lastVersion) || !semver.gt(item.version, localVersion)) {
        return;
      }

      // 显示未更新的这几个版本log
      item.log.forEach(itemLog => {
        ulog(` --${itemLog}`);
      });
    });

    // 在警告模式下加重提示样式
    if (opt.level === 'warn') {
      ulog(
        `******************************${emoji.get('point_up_2')} ${emoji.get(
          'point_up_2'
        )} ******************************`
      );
      console.log('\n');
    }
  }
}
866848
@SuppressWarnings("unused")
  public void setAppInfo(String name, String version) {
    if (name == null || version == null) {
      // nothing to do
      return;
    }

    this.userAgent = DEFAULT_USER_AGENT + " " + name.trim() + "/" + version.trim();
  }
1079023
private static void checkLocalUpdatePolicy(String mapName, LocalUpdatePolicy localUpdatePolicy) {
        if (localUpdatePolicy != INVALIDATE) {
            throw new IllegalArgumentException(format("Wrong `local-update-policy` option is selected for `%s` map Near Cache."
                    + " Only `%s` option is supported but found `%s`", mapName, INVALIDATE, localUpdatePolicy));
        }
    }
1124492
public static final void setApplId(byte[] name)
    {
        if (tc.isDebugEnabled())
            Tr.debug(tc, "setApplId", name);

        // Store the applId.
        applId = name;
    }
740200
public void updateLastVersion(final String _userName,
                                  final String _password,
                                  final Set<Profile> _profiles)
        throws Exception
    {
        // reload cache (if possible)
        reloadCache();

        // load installed versions
        Context.begin();
        EFapsClassLoader.getOfflineInstance(getClass().getClassLoader());
        final Map<String, Integer> latestVersions = this.install.getLatestVersions();
        Context.rollback();
        final long latestVersion = latestVersions.get(this.application);

        final ApplicationVersion version = getLastVersion();
        if (version.getNumber() == latestVersion) {
            Application.LOG.info("Update version '{}' of application '{}' ", version.getNumber(), this.application);

            version.install(this.install, version.getNumber(), _profiles, _userName, _password);

            Application.LOG.info("Finished update of version '{}'", version.getNumber());
        } else {
            Application.LOG.error("Version {}' of application '{}'  not installed and could not updated!",
                            version.getNumber(), this.application);
        }
    }
422147
private static void printAndLogVersion(String[] arguments) {
    Log.init(ARGS.log_level, ARGS.quiet);
    Log.info("----- H2O started " + (ARGS.client?"(client)":"") + " -----");
    Log.info("Build git branch: " + ABV.branchName());
    Log.info("Build git hash: " + ABV.lastCommitHash());
    Log.info("Build git describe: " + ABV.describe());
    Log.info("Build project version: " + ABV.projectVersion());
    Log.info("Build age: " + PrettyPrint.toAge(ABV.compiledOnDate(), new Date()));
    Log.info("Built by: '" + ABV.compiledBy() + "'");
    Log.info("Built on: '" + ABV.compiledOn() + "'");

    if (ABV.isTooOld()) {
      Log.warn("\n*** Your H2O version is too old! Please download the latest version from http://h2o.ai/download/ ***");
      Log.warn("");
    }

    Log.info("Found H2O Core extensions: " + extManager.getCoreExtensions());
    Log.info("Processed H2O arguments: ", Arrays.toString(arguments));

    Runtime runtime = Runtime.getRuntime();
    Log.info("Java availableProcessors: " + runtime.availableProcessors());
    Log.info("Java heap totalMemory: " + PrettyPrint.bytes(runtime.totalMemory()));
    Log.info("Java heap maxMemory: " + PrettyPrint.bytes(runtime.maxMemory()));
    Log.info("Java version: Java "+System.getProperty("java.version")+" (from "+System.getProperty("java.vendor")+")");
    List<String> launchStrings = ManagementFactory.getRuntimeMXBean().getInputArguments();
    Log.info("JVM launch parameters: "+launchStrings);
    Log.info("OS version: "+System.getProperty("os.name")+" "+System.getProperty("os.version")+" ("+System.getProperty("os.arch")+")");
    long totalMemory = OSUtils.getTotalPhysicalMemory();
    Log.info ("Machine physical memory: " + (totalMemory==-1 ? "NA" : PrettyPrint.bytes(totalMemory)));
  }
991497
public boolean checkAndMaybeUpdate() throws IOException {
    try {
      File nativeLibDir = soSource.soDirectory;
      Context updatedContext =
          applicationContext.createPackageContext(applicationContext.getPackageName(), 0);
      File updatedNativeLibDir = new File(updatedContext.getApplicationInfo().nativeLibraryDir);
      if (!nativeLibDir.equals(updatedNativeLibDir)) {
        Log.d(
            SoLoader.TAG,
            "Native library directory updated from " + nativeLibDir + " to " + updatedNativeLibDir);
        // update flags to resolve dependencies since the system does not properly resolve
        // dependencies when the location has moved
        flags |= DirectorySoSource.RESOLVE_DEPENDENCIES;
        soSource = new DirectorySoSource(updatedNativeLibDir, flags);
        soSource.prepare(flags);
        applicationContext = updatedContext;
        return true;
      }
      return false;
    } catch (PackageManager.NameNotFoundException e) {
      throw new RuntimeException(e);
    }
  }
88767
public JSONObject optJSONObject(String name) {
		Object object = opt(name);
		return object instanceof JSONObject ? (JSONObject) object : null;
	}
790523
private static void logVersionInformation() {
		String version = JobManager.class.getPackage().getImplementationVersion();
		// if version == null, then the JobManager runs from inside the IDE (or somehow not from the maven build jar)
		String revision = "<unknown>";
		try {
			Properties properties = new Properties();
			InputStream propFile = JobManager.class.getClassLoader().getResourceAsStream(".version.properties");
			if (propFile != null) {
				properties.load(propFile);
				revision = properties.getProperty("git.commit.id.abbrev");
			}
		} catch (IOException e) {
			LOG.info("Cannot determine code revision. Unable ro read version property file.");
		}
		LOG.info("Starting Stratosphere JobManager (Version: " + version + ", Rev:" + revision + ")");
	}
1048147
def setup_log(name):
    '''
    '''
    _log = logging.getLogger(name)
    _log.setLevel(GLOBAL_LOG_LEVEL)
    handler = logging.StreamHandler()
    formatter = logging.Formatter(
        '%(asctime)s - %(levelname)s - [%(name)s] %(message)s')
    handler.setFormatter(formatter)
    _log.addHandler(handler)
    _log.addFilter(XBMCFilter('[%s] ' % name))
    return _log
661353
function(opts) {
  if(!opts) opts = {};
  var libpath = opts['path'];

  this._emitter = new events.EventEmitter();
  this._library = this.createLibrary(libpath);
  this._initCrypto(opts);
  this._options = this._createToxOptions(opts);
  this._initNew(this._options);
  this._initCallbacks();

  // Create a child ToxOld if specified for old groupchat functionality
  if(opts.old === true) {
    this._toxold = new ToxOld({ path: libpath, tox: this });
  }
}
387314
def new_log_level(level, name, logger_name=None):
    
    @CustomLogLevel(level, name, logger_name)
    def _default_template(logger, msg, *args, **kwargs):
        return msg, args, kwargs
282489
function ChildBench(name, file, opts){
  opts || (opts = {})
  var args = [file]
  var options = {}
  // extra process arguments
  if (opts.args) args.push.apply(args, opts.args)
  // bench subject
  if (opts.subject) options.env = { subject: opts.subject }
  var reqs = this.requests = {}

  this.child = fork(runner, args, options)
    .on('message', function(msg){
      var result = reqs[msg.id]
      msg.value.name = name
      switch (msg.type) {
        case 'result': result.write(msg.value); break
        case 'error':
          var err = new Error(msg.value.message)
          err.stack = msg.value.stack
          result.error(err)
          break
        default:
          throw new Error('unknown message ' + JSON.stringify(msg))
      }
    })
    // clean up
    .on('exit', function(code){
      if (code > 0) process.exit(code)
    })
}
872168
private void updateLastMapLocalityLevel(JobInProgress job,
      Task mapTaskLaunched, TaskTrackerStatus tracker) {
    JobInfo info = infos.get(job);
    LocalityLevel localityLevel = localManager.taskToLocalityLevel(
        job, mapTaskLaunched, tracker);
    info.lastMapLocalityLevel = localityLevel;
    info.timeWaitedForLocalMap = 0;
  }
103258
function changeLog() {
			// Generate change log for release using all messages since last
			// tag/release
			if (!options.chgLog) {
				if (options.chgLogRequired) {
					throw new Error('Invalid "options.chgLog": "' + options.chgLog + '" ("options.chgLogRequired": '
							+ options.chgLogRequired + '"');
				}
				return;
			}
			var chgLogPath = path.join(options.distDir, options.chgLog);
			var lastGitLog = commit.prev && !commit.prev.versionVacant() ? commit.prev.versionTag + '..HEAD' : 'HEAD';
			chgLogRtn = cmd('git --no-pager log ' + lastGitLog + ' --pretty=format:"' + options.chgLogLineFormat
					+ '" > ' + chgLogPath, null, false, chgLogPath, options.chgLogSkipRegExps, '<!-- Commit '
					+ commit.hash + ' -->\n')
					|| '';
			utils.validateFile(chgLogPath, rollCall);
		}
211701
public static synchronized void updateLog(Map<String, Object> newConfig) {
        if (newConfig == null)
            throw new NullPointerException("Updated config must not be null");

        HpelTraceServiceConfig config = loggingConfig.get();
        if (config != null) {
            config.updateLog(newConfig);
            config.getTrDelegate().update(config);
        }
    }
1036538
def set_log_level_command(opts)
      Log.level = opts[:level] if [ :debug, :info, :warn, :error, :fatal ].include?(opts[:level])
      CommandIO.instance.reply(opts[:conn], Log.level)
    end