Make App logging customizable

This commit is contained in:
James Agnew 2019-02-08 17:14:22 -05:00
parent 37fc432fed
commit 7adb14c754

View File

@ -63,7 +63,7 @@ public abstract class BaseApp {
private void logAppHeader() { private void logAppHeader() {
System.out.flush(); System.out.flush();
System.out.println("------------------------------------------------------------"); System.out.println("------------------------------------------------------------");
System.out.println("\ud83d\udd25 " + ansi().bold() + " " + provideProductName() + ansi().boldOff() + " " + provideProductVersion() + " - Command Line Tool"); logProductName();
System.out.println("------------------------------------------------------------"); System.out.println("------------------------------------------------------------");
System.out.println("Process ID : " + ManagementFactory.getRuntimeMXBean().getName()); System.out.println("Process ID : " + ManagementFactory.getRuntimeMXBean().getName());
System.out.println("Max configured JVM memory (Xmx) : " + FileHelper.getFileSizeDisplay(Runtime.getRuntime().maxMemory(), 1)); System.out.println("Max configured JVM memory (Xmx) : " + FileHelper.getFileSizeDisplay(Runtime.getRuntime().maxMemory(), 1));
@ -71,6 +71,10 @@ public abstract class BaseApp {
System.out.println("------------------------------------------------------------"); System.out.println("------------------------------------------------------------");
} }
protected void logProductName() {
System.out.println("\ud83d\udd25 " + ansi().bold() + " " + provideProductName() + ansi().boldOff() + " " + provideProductVersion() + " - Command Line Tool");
}
private void logCommandUsage(BaseCommand theCommand) { private void logCommandUsage(BaseCommand theCommand) {
logAppHeader(); logAppHeader();