當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。