org.gradle.api.logging.Logger.error()方法的使用及代码示例

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

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

Logger.error介绍

暂无

代码示例

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

  1. if ( file.delete() ) {
  2. if ( !file.createNewFile() ) {
  3. logger.error( "Unable to recreate class file [" + file.getName() + "]" );
  4. logger.error( "Unable to delete class file [" + file.getName() + "]" );

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

  1. @Override
  2. public void error(String msg) {
  3. log.error(msg);
  4. }
  5. };

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

  1. /**
  2. * Setup generated sources folder if missing.
  3. */
  4. private void prepareGeneratedSourcesFolder() {
  5. if (!generatedSourcesDirectory.exists() && !generatedSourcesDirectory.mkdirs()) {
  6. log.error("Could not create " + generatedSourcesDirectory);
  7. }
  8. }

代码示例来源:origin: btkelly/gnag

  1. private static void deleteCssFileFromDirectory(@NotNull final File directory,
  2. @NotNull final Logger logger) {
  3. final File gnagCssOutputFile = new File(directory, CSS_FILE_NAME);
  4. if (gnagCssOutputFile.exists()) {
  5. try {
  6. FileUtils.forceDelete(gnagCssOutputFile);
  7. } catch (final IOException e) {
  8. logger.error("Error deleting CSS file for local Gnag report.");
  9. }
  10. }
  11. }

代码示例来源:origin: btkelly/gnag

  1. private static void copyCssFileToDirectory(@NotNull final File directory,
  2. @NotNull final Logger logger) {
  3. try {
  4. //TODO fix this
  5. final InputStream resourceAsStream = ReportWriter.class.getClassLoader()
  6. .getResourceAsStream(CSS_FILE_NAME);
  7. final File gnagCssOutputFile = new File(directory, CSS_FILE_NAME);
  8. FileUtils.copyInputStreamToFile(resourceAsStream, gnagCssOutputFile);
  9. } catch (final Exception e) {
  10. logger.error("Error copying CSS file for local Gnag report.", e);
  11. }
  12. }

代码示例来源:origin: gradle.plugin.org.shipkit/shipkit

  1. private String getOriginGitRepo() {
  2. try {
  3. return gitOriginRepoProvider.getOriginGitRepo();
  4. } catch(Exception e){
  5. LOG.error("Failed to get url of git remote origin. Using fallback '" + FALLBACK_GITHUB_REPO + "' instead.\n" +
  6. "You can change GitHub repository manually in " + configFile, e);
  7. return FALLBACK_GITHUB_REPO;
  8. }
  9. }

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

  1. public void writeImplementation(String name, String data) {
  2. logger.debug("writing Implementatio data : {}", data);
  3. try {
  4. Files.write(this.internalPath.resolve(name), data.getBytes());
  5. } catch (IOException e) {
  6. logger.error("error writing Implementatio ", e);
  7. }
  8. }

代码示例来源:origin: gradle.plugin.com.s390x/gogradle

  1. private void reportErrorIfNecessary(List<TestClassResult> results, File reportDir) {
  2. int totalFailureCount = results.stream().mapToInt(TestClassResult::getFailuresCount).sum();
  3. String message = "There are " + totalFailureCount + " failed tests. Please see "
  4. + toUnixString(new File(reportDir, "index.html"))
  5. + " for more details.";
  6. if (continueOnFailure) {
  7. LOGGER.error(message);
  8. } else if (totalFailureCount > 0) {
  9. throw new IllegalStateException(message);
  10. }
  11. }

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

  1. public void writeInterface(String name, String data) {
  2. logger.debug("writing Interface data : {}", data);
  3. try {
  4. Files.write(this.capi.resolve(name), data.getBytes());
  5. } catch (IOException e) {
  6. logger.error("error writing Interface ", e);
  7. }
  8. }

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

  1. public void writeFactory(String name, String data) {
  2. logger.debug("writing Factory data : {}", data);
  3. try {
  4. Files.write(this.internalPath.resolve(name), data.getBytes());
  5. } catch (IOException e) {
  6. logger.error("error writing Factory ", e);
  7. }
  8. }

代码示例来源:origin: gradle.plugin.org.kiirun/joda-beans-gradle-plugin

  1. public JodaBeansGenerator() {
  2. final ClassLoader classLoader = obtainClassLoader();
  3. try {
  4. toolClass = classLoader.loadClass(JODA_BEANS_CODE_GEN_CLASS);
  5. version = Version.from(Arrays.asList(
  6. toolClass.getPackage().getImplementationVersion().replaceAll("-SNAPSHOT", "").split("\\.")));
  7. } catch (final Exception ex) {
  8. getLogger().error("Skipping as Joda-Beans is not in the project compile classpath");
  9. }
  10. }

代码示例来源:origin: MinecraftForge/ForgeGradle

  1. private void error(String error)
  2. {
  3. if (dieWithError)
  4. {
  5. throw new RuntimeException(error);
  6. }
  7. else
  8. {
  9. this.setDidWork(false);
  10. getLogger().error(error);
  11. }
  12. }

代码示例来源:origin: gradle.plugin.org.openftc.ftcresourcesplugin/ftcExternalResources

  1. private void waitForCompletionOf(List<Thread> taskThreads) throws InterruptedException {
  2. for(Thread taskThread : taskThreads) {
  3. try {
  4. taskThread.join();
  5. } catch(InterruptedException ie) {
  6. getProject().getLogger().error("Error waiting for completion of task thread.");
  7. throw ie;
  8. }
  9. }
  10. }
  11. }

代码示例来源:origin: io.freefair.gradle/jsass-gradle-plugin

  1. @ErrorFunction
  2. @SuppressWarnings("unused")
  3. public void error(String message) {
  4. getLogger().error(message);
  5. }

代码示例来源:origin: avianey/androidsvgdrawable-plugin

  1. @Override
  2. public void execute(Project project) {
  3. Set<Task> preBuildTasks = project.getTasksByName("preBuild", false);
  4. if (preBuildTasks.isEmpty()) {
  5. project.getLogger().error("The Android plugin 'preBuild' task could not be found. Skipping SVG generation...");
  6. } else {
  7. preBuildTasks.iterator().next().dependsOn(project.getTasks().withType(SvgDrawableTask.class));
  8. }
  9. }
  10. });

代码示例来源:origin: io.freefair.gradle/jsass-plugin

  1. @ErrorFunction
  2. @SuppressWarnings("unused")
  3. public void error(String message) {
  4. getLogger().error(message);
  5. }

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

  1. @TaskAction
  2. public void scan() {
  3. try (Scanner scanner = new Scanner(classpath)) {
  4. for (File source : sources) {
  5. scanner.scan(source);
  6. }
  7. } catch (IOException e) {
  8. getLogger().error("Failed to write API file", e);
  9. }
  10. }

代码示例来源:origin: de.carne.common/java-gradle-plugins

  1. private void checkPrerequisites(Project project) {
  2. try {
  3. project.getPlugins().getPlugin("java");
  4. } catch (UnknownPluginException e) {
  5. String message = "Unable to apply plugin " + JAVA_TOOLS_PLUGIN_NAME
  6. + "; please apply java or java-library plugin first";
  7. project.getLogger().error(message);
  8. throw new GradleException(message, e);
  9. }
  10. }

代码示例来源:origin: com.amazon.device.tools.build/gradle-core

  1. public static void setThreadPoolSize(Project project) {
  2. if (!project.hasProperty(THREAD_POOL_SIZE_PROPERTY)) {
  3. return;
  4. }
  5. String threadPoolSizeProperty = project.property(THREAD_POOL_SIZE_PROPERTY).toString();
  6. try {
  7. ExecutorSingleton.setThreadPoolSize(Integer.parseInt(threadPoolSizeProperty));
  8. } catch (NumberFormatException e) {
  9. project.getLogger().error("com.android.threadPoolSize should be an integer.");
  10. }
  11. }
  12. }

代码示例来源:origin: gradle.plugin.com.github.honourednihilist/gradle-postgresql-embedded

  1. private void sleepBeforeStop() {
  2. PostgresqlEmbeddedExtension extension = getProject().getExtensions().getByType(PostgresqlEmbeddedExtension.class);
  3. if (extension.getTimeoutMillisBeforeStop() > 0) {
  4. getLogger().info("Sleeping {} millis before stopping postgres", extension.getTimeoutMillisBeforeStop());
  5. try {
  6. Thread.sleep(extension.getTimeoutMillisBeforeStop());
  7. } catch (InterruptedException e) {
  8. getLogger().error("", e);
  9. }
  10. }
  11. }
  12. }

相关文章