jenkins.model.Jenkins.getLog()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(186)

本文整理了Java中jenkins.model.Jenkins.getLog()方法的一些代码示例,展示了Jenkins.getLog()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jenkins.getLog()方法的具体详情如下:
包路径:jenkins.model.Jenkins
类名称:Jenkins
方法名:getLog

Jenkins.getLog介绍

[英]For binding LogRecorderManager to "/log". Everything below here is admin-only, so do the check here.
[中]用于将LogRecorderManager绑定到“/log”。下面的所有内容都是管理员专用的,所以请在此处进行检查。

代码示例

代码示例来源:origin: jenkinsci/jenkins

public LogRecorderManager getParent() {
  return Jenkins.getInstance().getLog();
}

代码示例来源:origin: jenkinsci/jenkins

@Initializer(before=PLUGINS_PREPARED)
public static void init(Jenkins h) throws IOException {
  h.getLog().load();
}

代码示例来源:origin: jenkinsci/jenkins

@Override public void preOnline(Computer c, Channel channel, FilePath root, TaskListener listener) throws IOException, InterruptedException {
    for (LogRecorder recorder : Jenkins.getInstance().getLog().logRecorders.values()) {
      for (Target t : recorder.targets) {
        channel.call(new SetLevel(t.name, t.getLevel()));
      }
    }
  }
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

public LogRecorderManager getParent() {
  return Jenkins.getInstance().getLog();
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

@Initializer(before=PLUGINS_PREPARED)
  public static void init(Jenkins h) throws IOException {
    h.getLog().load();
  }
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

@Override public void preOnline(Computer c, Channel channel, FilePath root, TaskListener listener) throws IOException, InterruptedException {
    for (LogRecorder recorder : Jenkins.getInstance().getLog().logRecorders.values()) {
      for (Target t : recorder.targets) {
        channel.call(new SetLevel(t.name, t.getLevel()));
      }
    }
  }
}

代码示例来源:origin: jenkinsci/azure-vm-agents-plugin

@Initializer(before = PLUGINS_STARTED)
public static void addLogRecorder(Jenkins h) throws IOException {
  // avoid the failure in dynamic loading.
  if (!h.hasPermission(h.ADMINISTER)) {
    return;
  }
  LogRecorderManager manager = h.getLog();
  Map<String, LogRecorder> logRecorders = manager.logRecorders;
  if (!logRecorders.containsKey(LOG_RECORDER_NAME)) {
    LogRecorder recorder = new LogRecorder(LOG_RECORDER_NAME);
    String packageName = AzureVMAgent.class.getPackage().getName();
    recorder.targets.add(new LogRecorder.Target(packageName, Level.WARNING));
    logRecorders.put(LOG_RECORDER_NAME, recorder);
    recorder.save();
  }
}

相关文章

Jenkins类方法