當前位置: 首頁>>代碼示例>>Java>>正文


Java Log.warn方法代碼示例

本文整理匯總了Java中org.apache.maven.plugin.logging.Log.warn方法的典型用法代碼示例。如果您正苦於以下問題:Java Log.warn方法的具體用法?Java Log.warn怎麽用?Java Log.warn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.maven.plugin.logging.Log的用法示例。


在下文中一共展示了Log.warn方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testLog

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
public void testLog()
{
    Log log = new DependencySilentLog();
    String text = new String( "Text" );
    Throwable e = new RuntimeException();
    log.debug( text );
    log.debug( text, e );
    log.debug( e );
    log.info( text );
    log.info( text, e );
    log.info( e );
    log.warn( text );
    log.warn( text, e );
    log.warn( e );
    log.error( text );
    log.error( text, e );
    log.error( e );
    log.isDebugEnabled();
    log.isErrorEnabled();
    log.isWarnEnabled();
    log.isInfoEnabled();
}
 
開發者ID:kefik,項目名稱:Pogamut3,代碼行數:23,代碼來源:TestSilentLog.java

示例2: sendGetCommand

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
/**
 * sendGetCommand
 * 
 * @param url
 * @param log
 * @return
 * @throws MojoExecutionException
 * @throws CheckException
 */
public Map<String, String> sendGetCommand( String url, Log log )
    throws CheckException
{
    Map<String, String> response = new HashMap<String, String>();
    CloseableHttpClient httpclient = HttpClients.createDefault();
    HttpGet httpget = new HttpGet( url );
    try
    {
        CloseableHttpResponse httpResponse = httpclient.execute( httpget, localContext );
        ResponseHandler<String> handler = new ResponseErrorHandler();
        String body = handler.handleResponse( httpResponse );
        response.put( "body", body );
        httpResponse.close();

    }
    catch ( Exception e )
    {
        log.warn( "GET request failed!" );

        throw new CheckException( "Send GET to server failed!", e );
    }

    return response;
}
 
開發者ID:oncecloud,項目名稱:devops-cstack,代碼行數:34,代碼來源:RestUtils.java

示例3: buildDockerInfoJar

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
@Nonnull
protected File buildDockerInfoJar(@Nonnull Log log) throws MojoExecutionException {
  final File jarFile = getJarFile(buildDirectory, finalName, classifier);

  final MavenArchiver archiver = new MavenArchiver();
  archiver.setArchiver(jarArchiver);
  archiver.setOutputFile(jarFile);

  archive.setForced(forceCreation);

  if (dockerInfoDirectory.exists()) {
    final String prefix = getMetaSubdir();
    archiver.getArchiver().addDirectory(dockerInfoDirectory, prefix);
  } else {
    log.warn("Docker info directory not created - Docker info JAR will be empty");
  }

  try {
    archiver.createArchive(session, project, archive);
  } catch (Exception e) {
    throw new MojoExecutionException("Could not build Docker info JAR", e);
  }

  return jarFile;
}
 
開發者ID:spotify,項目名稱:dockerfile-maven,代碼行數:26,代碼來源:AbstractDockerMojo.java

示例4: delete

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
/**
 * Deletes a file or a directory
 * 
 * If the directory is not empty, it'll delete all files and sub-dirs before
 * 
 * @param log Maven logger to use
 * @param path of the file
 */
public static void delete(Log log, Path path) {
	if (log != null && path != null) {
		try {
			if (Files.isDirectory(path)) {
				Files.walkFileTree(path, new Deleter(log));
			}
			else if (Files.isWritable(path)) {
				Files.deleteIfExists(path);
			}
		}
		catch (IOException e) {
			log.warn("Can't delete " + path.toAbsolutePath() + " - "+ e.getMessage() + " (will try on exit)");
			log.debug(e);
		}
	}
}
 
開發者ID:BorisNaguet,項目名稱:solr-maven-plugin,代碼行數:25,代碼來源:FileUtil.java

示例5: isLibrary

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
/**
 * @param projectDirectory the (workspace) directory containing the project
 * @param log logger to be used if debugging information should be produced
 * @return true if the project is an IIB Application
 * @throws MojoFailureException if something went wrong
 */
public static boolean isLibrary(File projectDirectory, Log log) throws MojoFailureException {
    try
    {
        if (projectDirectory.getName().equalsIgnoreCase("BARFiles")) {
            return false;
        }

        List<String> natureList = getProjectDescription(projectDirectory).getNatures().getNature();
        if (natureList
                .contains("com.ibm.etools.msgbroker.tooling.libraryNature")) {
            log.debug(projectDirectory + " is an IIB Library");
            return true;
        } else {
            return false;
        }
    } catch (Exception e)
    {
        String message = "An error occurred trying to determine the nature of the eclipse project at " + projectDirectory.getAbsolutePath() + ".";
        message += "\n" + "The error was: " + e;
        message += "\n" + "Instead of allowing the build to fail, the EclipseProjectUtils.isLibrary() method is returning false";
        log.warn(message);
        return false;
    }
}
 
開發者ID:bretthshelley,項目名稱:Maven-IIB9-Plug-In,代碼行數:31,代碼來源:EclipseProjectUtils.java

示例6: sendPostCommand

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
/**
 * @param url
 * @param parameters
 * @return
 * @throws MojoExecutionException
 * @throws CheckException
 */
public Map<String, Object> sendPostCommand( String url, Map<String, String> parameters, Log log )
    throws CheckException
{
    Map<String, Object> response = new HashMap<String, Object>();
    CloseableHttpClient httpclient = HttpClients.createDefault();

    HttpPost httpPost = new HttpPost( url );
    httpPost.setHeader( "Accept", "application/json" );
    httpPost.setHeader( "Content-type", "application/json" );

    try
    {
        ObjectMapper mapper = new ObjectMapper();
        StringEntity entity = new StringEntity( mapper.writeValueAsString( parameters ) );
        httpPost.setEntity( entity );
        CloseableHttpResponse httpResponse = httpclient.execute( httpPost, localContext );
        ResponseHandler<String> handler = new ResponseErrorHandler();
        String body = handler.handleResponse( httpResponse );
        response.put( "body", body );
        httpResponse.close();
    }
    catch ( Exception e )
    {
        log.warn( "POST request failed!" );

        throw new CheckException( "Send POST to server failed!", e );
    }

    return response;
}
 
開發者ID:oncecloud,項目名稱:devops-cstack,代碼行數:38,代碼來源:RestUtils.java

示例7: execute

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
@Override
public void execute(DockerClient dockerClient)
    throws MojoExecutionException, MojoFailureException {
  final Log log = getLog();

  if (skipBuild) {
    log.info("Skipping execution because 'dockerfile.build.skip' is set");
    return;
  }

  final String imageId = buildImage(
      dockerClient, log, verbose, contextDirectory, repository, tag, pullNewerImage, noCache,
      buildArgs);

  if (imageId == null) {
    log.warn("Docker build was successful, but no image was built");
  } else {
    log.info(MessageFormat.format("Detected build of image with id {0}", imageId));
    writeMetadata(Metadata.IMAGE_ID, imageId);
  }

  // Do this after the build so that other goals don't use the tag if it doesn't exist
  if (repository != null) {
    writeImageInfo(repository, tag);
  }

  writeMetadata(log);

  if (repository == null) {
    log.info(MessageFormat.format("Successfully built {0}", imageId));
  } else {
    log.info(MessageFormat.format("Successfully built {0}", formatImageName(repository, tag)));
  }
}
 
開發者ID:spotify,項目名稱:dockerfile-maven,代碼行數:35,代碼來源:BuildMojo.java

示例8: JavaVersionResolver

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
public JavaVersionResolver(MavenSession session, LifecycleExecutor lifecycleExecutor, Log log) {
  this.session = session;
  this.log = log;
  this.mojoExecutions = new LinkedList<>();
  try {
    this.mojoExecutions = lifecycleExecutor.calculateExecutionPlan(session, true, COMPILE_GOAL).getMojoExecutions();
  } catch (Exception e) {
    log.warn(String.format("Failed to get mojo executions for goal '%s': %s", COMPILE_GOAL, e.getMessage()));
  }
}
 
開發者ID:SonarSource,項目名稱:sonar-scanner-maven,代碼行數:11,代碼來源:JavaVersionResolver.java

示例9: cleanDataDir

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
public synchronized void cleanDataDir(Log log) {
	if(canDeleteDataDir) {
		clean(log, dataDir);
	}
	else {
		log.warn("Can't delete data dir: " + dataDir + " - content was already existing");
	}
}
 
開發者ID:BorisNaguet,項目名稱:solr-maven-plugin,代碼行數:9,代碼來源:SolrCloudManager.java

示例10: cleanConfDir

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
public synchronized void cleanConfDir(Log log) {
	if(canDeleteConfDir) {
		clean(log, confDir);
	}
	else {
		log.warn("Can't delete conf dir: " + confDir + " - content was already existing");
	}
}
 
開發者ID:BorisNaguet,項目名稱:solr-maven-plugin,代碼行數:9,代碼來源:SolrCloudManager.java

示例11: execute

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
public void execute() throws MojoExecutionException {
    Log log = getLog();
    if (configServerPort == null) {
        configServerPort = 19071;
    }
    if (!applicationFile.exists() || !applicationFile.canRead()) {
        log.warn("Cannot find or read '" + applicationFile + "', skipping");
    } else {
        log.info("Using application zip file '" + applicationFile + "'");
        deploy(applicationFile, log);
    }
}
 
開發者ID:vespa-engine,項目名稱:vespa,代碼行數:13,代碼來源:ApplicationDeployMojo.java

示例12: execute

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
public void execute() throws MojoExecutionException, MojoFailureException {
    final Log log = getLog();
    if (!integrationTestVerifyEnabled) {
        log.debug("Disabled, skipping");
        return;
    }

    final File file = new File(buildDir, DotnetIntegrationTestRunMojo.RESULT_FILENAME);
    if (file.exists()) {
        try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
            String line = reader.readLine();
            if (DotnetIntegrationTestRunMojo.RESULT_VALUE_SUCCESS.equals(line)) {
                // everything OK
                return;
            }

            while (line != null) {
                log.warn(line);
                line = reader.readLine();
            }
        } catch (Exception e) {
            throw new MojoExecutionException("Could not read from " + file, e);
        }
    }

    // error out with generic message (if successful we should have return'ed earlier)
    throw new MojoFailureException("Dotnet integration tests failed");
}
 
開發者ID:kaspersorensen,項目名稱:dotnet-maven-plugin,代碼行數:29,代碼來源:DotnetIntegrationTestVerifyMojo.java

示例13: logWarnBaseProblem

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
public static void logWarnBaseProblem(Log log, String[] messages) {
    log.warn("");
    log.warn("\tBASE PROBLEM:");
    for (String message : messages)
    {
        log.warn("\t" + message);
    }
}
 
開發者ID:bretthshelley,項目名稱:Maven-IIB9-Plug-In,代碼行數:9,代碼來源:AbstractValidator.java

示例14: logWarnInstructions

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
public static void logWarnInstructions(Log log, String[] messages) {
    log.warn("");
    log.warn("\tINSTRUCTIONS:");
    for (String message : messages)
    {
        log.warn("\t" + message);
    }
    log.warn("");
}
 
開發者ID:bretthshelley,項目名稱:Maven-IIB9-Plug-In,代碼行數:10,代碼來源:AbstractValidator.java

示例15: logWarnExample

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
public static void logWarnExample(Log log, String[] messages) {
    log.warn("");
    log.warn("\tEXAMPLE:");
    for (String message : messages)
    {
        log.warn("\t" + message);
    }
    log.warn("");
}
 
開發者ID:bretthshelley,項目名稱:Maven-IIB9-Plug-In,代碼行數:10,代碼來源:AbstractValidator.java


注:本文中的org.apache.maven.plugin.logging.Log.warn方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。