diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2019-09-14 06:55:07 +0200 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2019-09-14 06:55:07 +0200 |
commit | e978c7da8609dd75260471d5ed65d5191af94a46 (patch) | |
tree | 2950c54743f0418bd69ae43424dc4102f0f62413 /vespa-maven-plugin | |
parent | d69f89b2aca9925aee37225da0d201e3a895690b (diff) |
Indent multi-line entries and strip all trailing whitespace
Diffstat (limited to 'vespa-maven-plugin')
-rw-r--r-- | vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java | 9 |
1 files changed, 6 insertions, 3 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 7deffd37a79..8ef1e9d94db 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 @@ -78,13 +78,16 @@ public class DeployMojo extends AbstractVespaDeploymentMojo { } private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss").withZone(ZoneOffset.UTC); + private static final String padding = "\n" + " ".repeat(23); private void print(DeploymentLog.Entry entry) { String timestamp = formatter.format(entry.at()); + String message = String.join(padding, entry.message().split("\n")) + .replaceAll("\\s*\n", "\n").trim(); switch (entry.level()) { - case "warning" : getLog().warn(" [" + timestamp + "] " + entry.message()); break; - case "error" : getLog().error("[" + timestamp + "] " + entry.message()); break; - default: getLog().info(" [" + timestamp + "] " + entry.message()); break; + case "warning" : getLog().warn(" [" + timestamp + "] " + message); break; + case "error" : getLog().error(" [" + timestamp + "] " + message); break; + default: getLog().info(" [" + timestamp + "] " + message); break; } } |