本文整理了Java中org.gradle.api.Task.getLogger()
方法的一些代码示例,展示了Task.getLogger()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Task.getLogger()
方法的具体详情如下:
包路径:org.gradle.api.Task
类名称:Task
方法名:getLogger
暂无
代码示例来源:origin: gradle.plugin.com.glonk.gradle/gradle-eclipse-checkstyle
public EclipseCheckstyle(Task task) {
this.project = task.getProject();
this.log = task.getLogger();
}
代码示例来源:origin: gradle.plugin.mpern.sap.commerce/commerce-gradle-plugin
private void setupBootstrap(Project p, Task bootstrap, PackagingExtension extension) {
bootstrap.doLast(tsk -> {
try {
Path configurationFolder = extension.getConfigurationFolder().getAsFile().get().toPath();
Set<String> environments = new HashSet<>(extension.getEnvironments().get());
environments.add(COMMON_CONFIG);
for (String environment : environments) {
Path hybrisConfigFolder = configurationFolder.resolve(environment).resolve("hybris");
if (!Files.exists(hybrisConfigFolder)) {
Files.createDirectories(hybrisConfigFolder);
}
if (extension.getDatahub().getOrElse(Boolean.FALSE)) {
Path datahubConfigFolder = configurationFolder.resolve(environment).resolve("datahub");
if (!Files.exists(datahubConfigFolder)) {
Files.createDirectories(datahubConfigFolder);
}
}
if (extension.getSolr().getOrElse(Boolean.FALSE)) {
Path solrConfigFolder = configurationFolder.resolve(environment).resolve("solr");
if (!Files.exists(solrConfigFolder)) {
Files.createDirectories(solrConfigFolder);
}
}
}
} catch (IOException e) {
tsk.getLogger().error("could not setup config folders", e);
}
});
}
代码示例来源:origin: gradle.plugin.de.esoco.gwt/gwt-gradle-plugin
@Override
public void execute(Task task) {
try {
task.getLogger().info(javaCommand);
process = Runtime.getRuntime().exec(javaCommand);
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
kill();
}
});
} catch (IOException e) {
throw new RuntimeException(e);
}
errorLogger.setStream(process.getErrorStream());
errorLogger.setLevel(LogLevel.ERROR);
errorLogger.start();
infoLogger.setStream(process.getInputStream());
errorLogger.setLevel(LogLevel.INFO);
infoLogger.start();
}
代码示例来源:origin: Putnami/putnami-gradle-plugin
@Override
public void execute(Task task) {
try {
task.getLogger().info(javaCommand);
process = Runtime.getRuntime().exec(javaCommand);
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
kill();
}
});
} catch (IOException e) {
throw new RuntimeException(e);
}
errorLogger.setStream(process.getErrorStream());
errorLogger.setLevel(LogLevel.ERROR);
errorLogger.start();
infoLogger.setStream(process.getInputStream());
errorLogger.setLevel(LogLevel.INFO);
infoLogger.start();
}
代码示例来源:origin: gradle.plugin.org.openstreetmap.josm/gradle-josm-plugin
});
localDist.doLast(task -> {
task.getLogger().lifecycle("Local JOSM update-site for plugin version {} has been written to {}", task.getProject().getVersion(), localDistListFile.toURI());
});
});
dist.doLast(task -> {
task.getLogger().lifecycle("Distribution *.jar (version {}) has ben written into {}", task.getProject().getVersion(), outDir.getAbsolutePath());
});
pro.getTasks().getByName("jar").finalizedBy(dist, localDist);
代码示例来源:origin: MinecraftForge/ForgeGradle
public static AntBuilder setupAnt(Task task)
{
AntBuilder ant = task.getAnt();
LogLevel startLevel = task.getProject().getGradle().getStartParameter().getLogLevel();
if (startLevel.compareTo(LogLevel.LIFECYCLE) >= 0)
{
GradleVersion v2_14 = GradleVersion.version("2.14");
if (GradleVersion.current().compareTo(v2_14) >= 0)
{
ant.setLifecycleLogLevel(AntMessagePriority.ERROR);
}
else
{
try {
LoggingManager.class.getMethod("setLevel", LogLevel.class).invoke(task.getLogging(), LogLevel.ERROR);
} catch (Exception e) {
//Couldn't find it? We are on some weird version oh well.
task.getLogger().info("Could not set log level:", e);
}
}
}
return ant;
}
代码示例来源:origin: gradle.plugin.mpern.sap.commerce/commerce-gradle-plugin
t.onlyIf(o -> versionMismatch(extension, t.getLogger()));
});
unpackPlatform.mustRunAfter(cleanOnVersionChange);
boolean configPresent = project.file("hybris/config").exists();
if (configPresent) {
t.getLogger().lifecycle("hybris/config folder found, nothing to do");
内容来源于网络,如有侵权,请联系作者删除!