Display the daemon id and shorten it a bit, fixes #314

This commit is contained in:
Guillaume Nodet
2021-01-08 13:55:03 +01:00
committed by Peter Palaga
parent 3eb9d8d41b
commit 143f4f13ab
8 changed files with 64 additions and 2 deletions

View File

@@ -24,6 +24,8 @@ import org.mvndaemon.mvnd.common.Message;
*/
public interface ClientOutput extends AutoCloseable {
void setDaemonId(String uid);
void setDaemonDispatch(Consumer<Message> sink);
void setDaemonReceive(Consumer<Message> sink);

View File

@@ -89,6 +89,7 @@ public class TerminalOutput implements ClientOutput {
* Therefore, these fields do not need to be volatile
*/
private String name;
private String daemonId;
private int totalProjects;
/** String format for formatting the number of projects done with padding based on {@link #totalProjects} */
private String projectsDoneFomat;
@@ -142,6 +143,11 @@ public class TerminalOutput implements ClientOutput {
}
}
@Override
public void setDaemonId(String daemonId) {
this.daemonId = daemonId;
}
@Override
public void setDaemonDispatch(Consumer<Message> daemonDispatch) {
this.daemonDispatch = daemonDispatch;
@@ -630,6 +636,13 @@ public class TerminalOutput implements ClientOutput {
.append('%')
.style(AttributedStyle.DEFAULT);
/* DaemonId */
asb
.append(" daemon: ")
.style(AttributedStyle.BOLD)
.append(daemonId)
.style(AttributedStyle.DEFAULT);
} else if (buildStatus != null) {
asb
.style(AttributedStyle.BOLD)