org.gradle.api.logging.Logger类的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(243)

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

Logger介绍

[英]An extension to the SLF4J Logger interface, which adds the quiet and lifecycle log levels.

You can obtain a Logger instance using Logging#getLogger(Class) or Logging#getLogger(String). A Logger instance is also available through org.gradle.api.Project#getLogger(), org.gradle.api.Task#getLogger() and org.gradle.api.Script#getLogger().
[中]SLF4J记录器接口的扩展,增加了静默和生命周期日志级别。
您可以使用Logging#getLogger(类)或Logging#getLogger(字符串)获取记录器实例。记录器实例也可通过org获得。格拉德尔。应用程序编程接口。项目#getLogger(),org。格拉德尔。应用程序编程接口。任务#getLogger()和组织。格拉德尔。应用程序编程接口。脚本#getLogger()。

代码示例

代码示例来源:origin: linkedin/rest.li

@TaskAction
public void checkFilesForChanges(IncrementalTaskInputs inputs)
 getLogger().lifecycle("Checking idl and snapshot files for changes...");
 getLogger().info("idlFiles: " + idlFiles.getAsPath());
 getLogger().info("snapshotFiles: " + snapshotFiles.getAsPath());
   getLogger().lifecycle(
     "The following files have been removed, be sure to remove them from source control: {}", files);
   getLogger().lifecycle("The following files have been added, be sure to add them to source control: {}", files);
   getLogger().lifecycle(
     "The following files have been changed, be sure to commit the changes to source control: {}", files);

代码示例来源:origin: hibernate/hibernate-orm

@Override
public void execute(Task task) {
  project.getLogger().debug( "Starting Hibernate enhancement on SourceSet.{}", sourceSet.getName() );
    logger.warn("Extended enhancement is enabled. Classes other than entities may be modified. You should consider access the entities using getter/setter methods and disable this property. Use at your own risk." );
      if ( enhancedBytecode != null ) {
        writeOutEnhancedClass( enhancedBytecode, file );
        logger.info( "Successfully enhanced class [" + file + "]" );
        logger.info( "Skipping class [" + file.getAbsolutePath() + "], not an entity nor embeddable" );

代码示例来源:origin: hibernate/hibernate-orm

if ( file.delete() ) {
  if ( !file.createNewFile() ) {
    logger.error( "Unable to recreate class file [" + file.getName() + "]" );
  logger.error( "Unable to delete class file [" + file.getName() + "]" );
logger.warn( "Problem preparing class file for writing out enhancements [" + file.getName() + "]" );

代码示例来源:origin: jooby-project/jooby

output.mkdirs();
logger.debug("claspath: " + loader);
logger.debug("assets.conf: " + assetConf.getConfig("assets"));
CharSequence summary = compiler
  .summary(fileset, output.toPath(), env, end - start, "        " + assemblyOutput, "Assets: " + distFile);
logger.info(summary.toString());
   .toFile();
 to.getParentFile().mkdirs();
 logger.debug("copying file to: " + to);
 Files.copy(from, to);

代码示例来源:origin: org.gradle/gradle-core

private void setState(ExecHandleState state) {
  lock.lock();
  try {
    LOGGER.debug("Changing state to: {}", state);
    this.state = state;
    this.stateChanged.signalAll();
  } finally {
    lock.unlock();
  }
}

代码示例来源:origin: linkedin/rest.li

LOG.info("Compiling Scala resource classes. Disabling pathing jar for " + taskName + " to avoid breaking Scala compilation");
return classpath;

代码示例来源:origin: gradle.plugin.com.we.intershop.gradleplugin/icm-code-generator

public void writeImplementation(String name, String data) {
  logger.debug("writing Implementatio data : {}", data);
  try {
    Files.write(this.internalPath.resolve(name), data.getBytes());
  } catch (IOException e) {
    logger.error("error writing Implementatio ", e);
  }
}

代码示例来源:origin: hibernate/hibernate-orm

private ClassLoader toClassLoader(FileCollection runtimeClasspath) {
  List<URL> urls = new ArrayList<URL>();
  for ( File file : runtimeClasspath ) {
    try {
      urls.add( file.toURI().toURL() );
      logger.debug( "Adding classpath entry for " + file.getAbsolutePath() );
    }
    catch (MalformedURLException e) {
      throw new GradleException( "Unable to resolve classpath entry to URL : " + file.getAbsolutePath(), e );
    }
  }
  return new URLClassLoader( urls.toArray( new URL[urls.size()] ), Enhancer.class.getClassLoader() );
}

代码示例来源:origin: diffplug/spotless

/** Makes it possible to remove a format which was created earlier. */
public void removeFormat(String name) {
  requireNonNull(name);
  FormatExtension toRemove = formats.remove(name);
  if (toRemove == null) {
    project.getLogger().warn("Called removeFormat('" + name + "') but there was no such format.");
  }
}

代码示例来源:origin: junkdog/artemis-odb

@Override
  public void error(String msg) {
    log.error(msg);
  }
};

代码示例来源:origin: net.corda.plugins/api-scanner

void scan(File source) {
  File target = toTarget(source);
  getLogger().info("API file: {}", target.getAbsolutePath());
  try (
    URLClassLoader appLoader = new URLClassLoader(new URL[]{toURL(source)}, classpathLoader);
    ApiPrintWriter writer = new ApiPrintWriter(target, "UTF-8")
  ) {
    scan(writer, appLoader);
  } catch (IOException e) {
    getLogger().error("API scan has failed", e);
  }
}

代码示例来源:origin: palantir/gradle-baseline

private static File rootVersionsPropsFile(Project project) {
  File file = project.getRootProject().file("versions.props");
  if (!file.canRead()) {
    try {
      log.info("Could not find 'versions.props' file, creating...");
      Files.createFile(file.toPath());
    } catch (IOException e) {
      log.warn("Unable to create empty versions.props file, please create this manually", e);
    }
  }
  return file;
}

代码示例来源:origin: org.gradle/gradle-core

public void buildStarted(Gradle gradle) {
  StartParameter startParameter = gradle.getStartParameter();
  logger.info("Starting Build");
  if (logger.isDebugEnabled()) {
    logger.debug("Gradle user home: {}", startParameter.getGradleUserHomeDir());
    logger.debug("Current dir: {}", startParameter.getCurrentDir());
    logger.debug("Settings file: {}", startParameter.getSettingsFile());
    logger.debug("Build file: {}", startParameter.getBuildFile());
  }
}

代码示例来源:origin: linkedin/rest.li

@Override
public void write(int b)
  throws IOException
{
 wholeTextBuilder.append((char) b);
 if (b == '\n')
 {
  LOG.lifecycle("[checker] {}", lineTextBuilder.toString());
  processLine(lineTextBuilder.toString());
  lineTextBuilder = new StringBuilder();
 }
 else
 {
  lineTextBuilder.append((char) b);
 }
}

代码示例来源:origin: gradle.plugin.de.heinrichmarkus.gradle/dbp

@TaskAction
public void compile() {
  if (!msbuildConfiguration.getItems().isEmpty()) {
    getLogger().lifecycle("Compiling with BDS " + bds.get());
    for (MsbuildItem p : msbuildConfiguration.getItems()) {
      getLogger().lifecycle(String.format("\t- %s", p.toString()));
      compileProject(p);
    }
  } else {
    getLogger().warn("Nothing to compile! Add project files to project.dproj property.");
  }
}

代码示例来源:origin: hibernate/hibernate-orm

private void applyEnhancement(final Project project, final HibernateExtension hibernateExtension) {
  if ( !hibernateExtension.enhance.shouldApply() ) {
    project.getLogger().warn( "Skipping Hibernate bytecode enhancement since no feature is enabled" );
    return;
    project.getLogger().debug( "Applying Hibernate enhancement action to SourceSet.{}", sourceSet.getName() );

代码示例来源:origin: org.gradle/gradle-core

public IsolatedAntBuilder withClasspath(Iterable<File> classpath) {
  if (LOG.isDebugEnabled()) {
    LOG.debug("Forking a new isolated ant builder for classpath : {}", classpath);
  }
  return new DefaultIsolatedAntBuilder(this, classpath);
}

代码示例来源:origin: org.gradle/gradle-core

public void projectsLoaded(Gradle gradle) {
  if (logger.isInfoEnabled()) {
    ProjectInternal projectInternal = (ProjectInternal) gradle.getRootProject();
    logger.info("Projects loaded. Root project using {}.",
      projectInternal.getBuildScriptSource().getDisplayName());
    logger.info("Included projects: {}", projectInternal.getAllprojects());
  }
}

代码示例来源:origin: org.gradle/gradle-core

protected BuildOperationLogInfo createLogInfo(String taskName, File outputFile, int maximumFailures) {
    final BuildOperationLogInfo configuration;
    if (logger.isDebugEnabled()) {
      // show all operation output when debug is enabled
      configuration = new BuildOperationLogInfo(taskName, outputFile, Integer.MAX_VALUE);
    } else {
      configuration = new BuildOperationLogInfo(taskName, outputFile, maximumFailures);
    }
    return configuration;
  }
}

代码示例来源:origin: org.gradle/gradle-core

public void abortProcess() {
  lock.lock();
  try {
    aborted = true;
    if (process != null) {
      LOGGER.debug("Abort requested. Destroying process: {}.", execHandle.getDisplayName());
      process.destroy();
    }
  } finally {
    lock.unlock();
  }
}

相关文章