summaryrefslogtreecommitdiffstats
path: root/vespa-maven-plugin
diff options
context:
space:
mode:
Diffstat (limited to 'vespa-maven-plugin')
-rw-r--r--vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java
index 74e13066964..e2d10316a21 100644
--- a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java
+++ b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java
@@ -31,8 +31,13 @@ public class DeployMojo extends AbstractVespaDeploymentMojo {
@Parameter(property = "follow", defaultValue = "true")
private boolean follow;
+ @Parameter(property = "vespaLogLevel", defaultValue = "error")
+ private String vespaLogLevel;
+ private DeploymentLog.Level loggable;
+
@Override
protected void doExecute() throws MojoFailureException, MojoExecutionException {
+ loggable = DeploymentLog.Level.valueOf(vespaLogLevel);
Deployment deployment = Deployment.ofPackage(Paths.get(firstNonBlank(applicationZip,
projectPathOf("target", "application.zip"))));
if (vespaVersion != null) deployment = deployment.atVersion(vespaVersion);
@@ -84,12 +89,13 @@ public class DeployMojo extends AbstractVespaDeploymentMojo {
String timestamp = formatter.format(entry.at());
String message = String.join(padding, entry.message().split("\n"))
.replaceAll("\\s*\n", "\n").trim();
- switch (entry.level()) {
- case "error" : getLog().error(" [" + timestamp + "] " + message); break;
- case "warning" : getLog().warn (" [" + timestamp + "] " + message); break;
- case "info" : getLog().info(" [" + timestamp + "] " + message); break;
- default : getLog().debug(" [" + timestamp + "] " + message); break;
- }
+ if ( ! entry.isVespaLogEntry() || loggable.compareTo(entry.level()) <= 0)
+ switch (entry.level()) {
+ case error : getLog().error(" [" + timestamp + "] " + message); break;
+ case warning : getLog().warn (" [" + timestamp + "] " + message); break;
+ case info : getLog().info(" [" + timestamp + "] " + message); break;
+ default : getLog().debug(" [" + timestamp + "] " + message); break;
+ }
}
}