当前位置: 首页>>代码示例>>Java>>正文


Java TaskListener.getLogger方法代码示例

本文整理汇总了Java中hudson.model.TaskListener.getLogger方法的典型用法代码示例。如果您正苦于以下问题:Java TaskListener.getLogger方法的具体用法?Java TaskListener.getLogger怎么用?Java TaskListener.getLogger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hudson.model.TaskListener的用法示例。


在下文中一共展示了TaskListener.getLogger方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: perform

import hudson.model.TaskListener; //导入方法依赖的package包/类
@Override
public void perform(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) {
    /*
    // This also shows how you can consult the global configuration of the builder
    if (getDescriptor().getUseFrench()) {
        listener.getLogger().println("Bonjour, " + oFile + "!");
    } else {
        listener.getLogger().println("Hello, " + oFile + "!");
    }
     */

    listener.getLogger().println("[Cppchecker] " + "Starting the cppcheck.");
    try {
        ArgumentListBuilder args = getArgs();
        OutputStream out = listener.getLogger();
        FilePath of = new hudson.FilePath(workspace.getChannel(), workspace + "/" + this.oFile.trim());

        launcher.launch().cmds(args).stderr(of.write()).stdout(out).pwd(workspace).join();
    } catch (IOException | InterruptedException ex) {
        Logger.getLogger(Cppchecker.class.getName()).log(Level.SEVERE, null, ex);
    }

    listener.getLogger().println("[Cppchecker] " + "Ending the cppcheck.");
}
 
开发者ID:TommyLin,项目名称:cppchecker,代码行数:25,代码来源:Cppchecker.java

示例2: verifyCommon

import hudson.model.TaskListener; //导入方法依赖的package包/类
/**
 * Verifies the common input for all the stesp.
 * 
 * @param step
 * @param listener
 *            taskListener
 * @param envVars
 *            environment vars.
 * @return response if JIRA_SITE is empty or if there is no site configured with JIRA_SITE.
 * @throws AbortException
 *             when failOnError is true and JIRA_SITE is missing.
 */
@SuppressWarnings("hiding")
protected <T> ResponseData<T> verifyCommon(final BasicJiraStep step, final TaskListener listener, final EnvVars envVars, final Run<?, ?> run) throws AbortException {

	logger = listener.getLogger();

	String errorMessage = null;
	siteName = empty(step.getSite()) ? envVars.get("JIRA_SITE") : step.getSite();
	final Site site = Site.get(siteName);
	final String failOnErrorStr = Util.fixEmpty(envVars.get("JIRA_FAIL_ON_ERROR"));

	if (failOnErrorStr == null) {
		failOnError = step.isFailOnError();
	} else {
		failOnError = Boolean.parseBoolean(failOnErrorStr);
	}

	if (empty(siteName)) {
		errorMessage = "JIRA_SITE is empty or null.";
	}

	if (site == null) {
		errorMessage = "No JIRA site configured with " + siteName + " name.";
	} else {
		jiraService = getJiraService(site);
	}

	if (errorMessage != null) {
		return buildErrorResponse(new RuntimeException(errorMessage));
	}

	buildUser = prepareBuildUser(run.getCauses());
	buildUrl = envVars.get("BUILD_URL");

	return null;
}
 
开发者ID:ThoughtsLive,项目名称:jira-steps,代码行数:48,代码来源:JiraStepExecution.java

示例3: verifyCommon

import hudson.model.TaskListener; //导入方法依赖的package包/类
@SuppressWarnings("hiding")
protected <T> ResponseData<T> verifyCommon(final BasicHubotStep step, final TaskListener listener, final EnvVars envVars) throws AbortException {

	logger = listener.getLogger();
	String errorMessage = null;

	final String url = Util.fixEmpty(step.getUrl()) == null ? envVars.get("HUBOT_URL") : step.getUrl();
	final String room = Util.fixEmpty(step.getRoom()) == null ? envVars.get("HUBOT_DEFAULT_ROOM") : step.getRoom();
	final String message = step.getMessage();
	final String failOnErrorStr = Util.fixEmpty(envVars.get("HUBOT_FAIL_ON_ERROR"));
	
	if (failOnErrorStr == null) {
		failOnError = step.isFailOnError();
	} else {
		failOnError = Boolean.parseBoolean(failOnErrorStr);
	}
	
	if (Util.fixEmpty(url) == null) {
		errorMessage = "Hubot: HUBOT_URL is empty or null.";
	}

	if (Util.fixEmpty(room) == null) {
		errorMessage = "Hubot: Room is empty or null.";
	}

	if (Util.fixEmpty(message) == null) {
		errorMessage = "Hubot: Message is empty or null.";
	}

	if (errorMessage != null) {
		return buildErrorResponse(new RuntimeException(errorMessage));
	}

	hubotService = getHubotService(url);
	return null;

}
 
开发者ID:ThoughtsLive,项目名称:hubot-steps,代码行数:38,代码来源:HubotAbstractSynchronousNonBlockingStepExecution.java

示例4: performInstallation

import hudson.model.TaskListener; //导入方法依赖的package包/类
public FilePath performInstallation(ToolInstallation tool, Node node, TaskListener log) throws IOException, InterruptedException {
    FilePath expectedLocation = preferredLocation(tool, node);
    PrintStream out = log.getLogger();
    try {
        if(!acceptLicense) {
            out.println(Messages.JDKInstaller_UnableToInstallUntilLicenseAccepted());
            return expectedLocation;
        }
        // already installed?
        FilePath marker = expectedLocation.child(".installedByHudson");
        if (marker.exists() && marker.readToString().equals(id)) {
            return expectedLocation;
        }
        expectedLocation.deleteRecursive();
        expectedLocation.mkdirs();

        JDKInstaller.Platform p = JDKInstaller.Platform.of(node);
        URL url = locate(log, p, JDKInstaller.CPU.of(node), true);

        FilePath file = expectedLocation.child(p.bundleFileName);
        file.copyFrom(url);

        // JDK6u13 on Windows doesn't like path representation like "/tmp/foo", so make it a strict platform native format by doing 'absolutize'
        installer.install(node.createLauncher(log), p, new ClientFilePathFileSystem(node), log, expectedLocation.absolutize().getRemote(), file.getRemote());

        // successfully installed
        file.delete();
        marker.write(id, null);

    } catch (Exception e) {
        out.println("JDK installation skipped: "+e.getMessage());
        if (e instanceof IOException) {
            throw (IOException)e;
        }
        if (e instanceof InterruptedException) {
            throw (InterruptedException)e;
        }
    }

    return expectedLocation;
}
 
开发者ID:jenkinsci,项目名称:apache-httpcomponents-client-4-api-plugin,代码行数:42,代码来源:Client4JDKInstaller.java


注:本文中的hudson.model.TaskListener.getLogger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。