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


Java Log.debug方法代碼示例

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


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

示例1: 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

示例2: 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

示例3: haveResourcesChanged

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
public static boolean haveResourcesChanged(Log log, MavenProject project, BuildContext buildContext, String suffix) {
    String baseDir = project.getBasedir().getAbsolutePath();
    for (Resource r : project.getBuild().getResources()) {
        File file = new File(r.getDirectory());
        if (file.isAbsolute()) {
            file = new File(r.getDirectory().substring(baseDir.length() + 1));
        }
        String path = file.getPath() + "/" + suffix;
        log.debug("checking  if " + path + " (" + r.getDirectory() + "/" + suffix + ") has changed.");
        if (buildContext.hasDelta(path)) {
            log.debug("Indeed " + suffix + " has changed.");
            return true;
        }
    }
    return false;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:17,代碼來源:PackageHelper.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: downloadHttpResource

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
private boolean downloadHttpResource(Log log, String remote, File local) throws MojoExecutionException {
  local.getParentFile().mkdirs();
  InputStream stream = null;
  CloseableHttpClient httpclient = HttpClients.custom().disableContentCompression().build();
  try {
    HttpEntity entity = httpclient.execute(new HttpGet(remote)).getEntity();
    if (entity != null) {
      stream = entity.getContent();
      Files.copy(stream, local.toPath());
      return true;
    }
  } catch (Exception exception) {
    if (log.isDebugEnabled()) {
      log.debug("Error downloading resource [" + remote + "]", exception);
    }
  } finally {
    IOUtils.closeQuietly(stream);
    IOUtils.closeQuietly(httpclient);
  }
  return false;
}
 
開發者ID:ggear,項目名稱:cloudera-parcel,代碼行數:22,代碼來源:Parcel.java

示例6: getClassLoader

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
/**
 * Provides a class loader that can be used to load classes from this
 * project classpath.
 * 
 * @param project
 *            the maven project currently being built
 * @param parent
 *            a classloader which should be used as the parent of the newly
 *            created classloader.
 * @param log
 *            object to which details of the found/loaded classpath elements
 *            can be logged.
 * 
 * @return a classloader that can be used to load any class that is
 *         contained in the set of artifacts that this project classpath is
 *         based on.
 * @throws DependencyResolutionRequiredException
 *             if maven encounters a problem resolving project dependencies
 */
public ClassLoader getClassLoader(MavenProject project, final ClassLoader parent, Log log) throws DependencyResolutionRequiredException {

    @SuppressWarnings("unchecked")
    List<String> classpathElements = project.getCompileClasspathElements();

    final List<URL> classpathUrls = new ArrayList<URL>(classpathElements.size());

    for (String classpathElement : classpathElements) {

        try {
            log.debug("Adding project artifact to classpath: " + classpathElement);
            classpathUrls.add(new File(classpathElement).toURI().toURL());
        } catch (MalformedURLException e) {
            log.debug("Unable to use classpath entry as it could not be understood as a valid URL: " + classpathElement, e);
        }

    }

    return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
        @Override
        public ClassLoader run() {
            return new URLClassLoader(classpathUrls.toArray(new URL[classpathUrls.size()]), parent);
        }
    });

}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:46,代碼來源:ProjectClasspath.java

示例7: expandProjects

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
@Override
public Set<MavenProject> expandProjects ( final Collection<MavenProject> projects, final Log log, final MavenSession session )
{
    try
    {
        final Set<MavenProject> result = new HashSet<MavenProject> ();

        final Queue<MavenProject> queue = new LinkedList<MavenProject> ( projects );
        while ( !queue.isEmpty () )
        {
            final MavenProject project = queue.poll ();
            log.debug ( "Checking project: " + project );
            if ( project.getFile () == null )
            {
                log.info ( "Skipping non-local project: " + project );
                continue;
            }
            if ( !result.add ( project ) )
            {
                // if the project was already in our result, there is no need to process twice
                continue;
            }
            // add all children to the queue
            queue.addAll ( loadChildren ( project, log, session ) );
            if ( hasLocalParent ( project ) )
            {
                // if we have a parent, add the parent as well
                queue.add ( project.getParent () );
            }
        }
        return result;
    }
    catch ( final Exception e )
    {
        throw new RuntimeException ( e );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:38,代碼來源:DefaultPomHelper.java

示例8: execute

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
public int execute(@Nullable String customCommand, @Nonnull final Log logger, @Nonnull final File cvsFolder, @Nonnull @MustNotContainNull final String... args) {
    final List<String> cli = new ArrayList<>();
    cli.add(GetUtils.findFirstNonNull(customCommand, this.command));
    for (final String s : args) {
        cli.add(s);
    }

    if (logger.isDebugEnabled()) {
        logger.debug("Executing repo command : " + cli);
    }

    final ByteArrayOutputStream errorStream = new ByteArrayOutputStream();
    final ByteArrayOutputStream outStream = new ByteArrayOutputStream();

    final ProcessExecutor executor = new ProcessExecutor(cli);

    int result = -1;

    try {
        final ProcessResult processResult = executor.directory(cvsFolder).redirectError(errorStream).redirectOutput(outStream).executeNoTimeout();
        result = processResult.getExitValue();

        if (logger.isDebugEnabled()) {
            logger.debug("Exec.out.........................................");
            logger.debug(new String(errorStream.toByteArray(), Charset.defaultCharset()));
            logger.debug(".................................................");
        }

        if (result != 0) {
            logger.error(new String(errorStream.toByteArray(), Charset.defaultCharset()));
        }

    } catch (Exception ex) {
        logger.error("Unexpected error", ex);
    }

    return result;
}
 
開發者ID:raydac,項目名稱:mvn-golang,代碼行數:39,代碼來源:AbstractRepo.java

示例9: isApplication

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 isApplication(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.applicationNature")) {
            log.debug(
                    projectDirectory + " is an IIB Application");
            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.isApplication() method is returning false";
        log.warn(message);
        return false;
    }
}
 
開發者ID:bretthshelley,項目名稱:Maven-IIB9-Plug-In,代碼行數:33,代碼來源:EclipseProjectUtils.java

示例10: HttpClient

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
/**
 * Create a new client instance
 *
 * @param host gateway host
 * @param port gateway port
 */
public HttpClient(String host, int port, Log log) {
    this.host = host;
    this.port = port;
    this.log = log;
    this.urlPrefix = "http://" + host + ":" + port;
    this.userAgent = getClass().getSimpleName() + "/" + "1.0";
    log.debug("Set user agent string to '" + userAgent + "'");
}
 
開發者ID:vespa-engine,項目名稱:vespa,代碼行數:15,代碼來源:ApplicationDeployMojo.java

示例11: createCollection

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
/**
 * Creates a collection
 * 
 * @param log maven log
 * @param colName collection name to create
 * @throws MojoExecutionException Exception
 */
public synchronized void createCollection(Log log, String colName) throws MojoExecutionException {
	log.debug("About to create collection " + colName);

	try {
		solrCloud.createCollection(colName, 1, 1, configName, null);
	}
	catch (SolrServerException | IOException e) {
		throw new MojoExecutionException("Can't create solr collection " + colName, e);
	}
	log.debug("Collection " + colName + " created");
}
 
開發者ID:BorisNaguet,項目名稱:solr-maven-plugin,代碼行數:19,代碼來源:SolrCloudManager.java

示例12: upToBranch

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
private boolean upToBranch(@Nonnull final Log logger, @Nullable final ProxySettings proxy, @Nullable final String customCommand, @Nonnull final File cvsFolder, @Nonnull final String branchId) {
    logger.debug("upToBranch: " + branchId);
    return checkResult(logger, execute(customCommand, logger, cvsFolder, "update", "--clean", branchId));
}
 
開發者ID:raydac,項目名稱:mvn-golang,代碼行數:5,代碼來源:CvsHG.java

示例13: upToTag

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
private boolean upToTag(@Nonnull final Log logger, @Nullable final ProxySettings proxy, @Nullable final String customCommand, @Nonnull final File cvsFolder, @Nonnull final String tagId) {
    logger.debug("upToTag: " + tagId);
    return checkResult(logger, execute(customCommand, logger, cvsFolder, "update", "--clean", tagId));
}
 
開發者ID:raydac,項目名稱:mvn-golang,代碼行數:5,代碼來源:CvsHG.java

示例14: upToRevision

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
private boolean upToRevision(@Nonnull final Log logger, @Nullable final ProxySettings proxy, @Nullable final String customCommand, @Nonnull final File cvsFolder, @Nonnull final String revisionId) {
    logger.debug("upToRevision: " + revisionId);
    return checkResult(logger, execute(customCommand, logger, cvsFolder, "update", "--clean", "--rev", revisionId));
}
 
開發者ID:raydac,項目名稱:mvn-golang,代碼行數:5,代碼來源:CvsHG.java

示例15: upToBranch

import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
private boolean upToBranch(@Nonnull final Log logger, @Nullable final ProxySettings proxy, @Nullable final String customCommand, @Nonnull final File cvsFolder, @Nonnull final String branchId) {
    logger.debug("upToBranch : " + branchId);
    return checkResult(logger, execute(customCommand, logger, cvsFolder, "switch", "--force", branchId));
}
 
開發者ID:raydac,項目名稱:mvn-golang,代碼行數:5,代碼來源:CvsBZR.java


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