Skip to content

Commit

Permalink
fix (cli): Fix bad logging of initial greeting message
Browse files Browse the repository at this point in the history
  • Loading branch information
vorburger committed Jun 27, 2024
1 parent 541c507 commit 0c335b4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 1 addition & 4 deletions java/dev/enola/cli/EnolaCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ public class EnolaCLI {
boolean[] verbosity = {};

static CLI cli(String... args) {
// TODO This runs "too early" (before parameter parsing and logging initialization of it)...
// see https://stackoverflow.com/q/78679524/421602
Lifecycle.start();

// Add any "initialization" to class Lifecycle#start(), instead of here!
var enola = new EnolaCLI();
return new CLI(
args,
Expand Down
4 changes: 2 additions & 2 deletions java/dev/enola/cli/Lifecycle.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ final class Lifecycle {

static void start() {
LOG.info(
"Hi! \uD83D\uDC4B I'm https://Enola.dev v{}. "
+ "\uD83D\uDC7D \uD83D\uDC7E Resistance is futile. We are ONE. "
"Hi! \uD83D\uDC4B I'm https://Enola.dev {}. "
+ "\uD83D\uDC7D Resistance \uD83D\uDC7E is futile. We are ONE. "
+ "What's your goal, today?\n",
Version.get());
}
Expand Down
2 changes: 2 additions & 0 deletions java/dev/enola/cli/LoggingMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public static int executionStrategy(CommandLine.ParseResult parseResult) {

configureJUL(level);

Lifecycle.start();

// And now back to and onwards with the default execution strategy
return new CommandLine.RunLast().execute(parseResult);
}
Expand Down

0 comments on commit 0c335b4

Please sign in to comment.