From: David ‘Bombe’ Roden Date: Sat, 9 Nov 2024 16:48:15 +0000 (+0100) Subject: 🔊 Log options on startup X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=834ea18e3b7892eca35258a7e87459e60e7e3eb0;p=rhynodge.git 🔊 Log options on startup --- diff --git a/src/main/java/net/pterodactylus/rhynodge/engine/Options.java b/src/main/java/net/pterodactylus/rhynodge/engine/Options.java index 2914aa0..2803a83 100644 --- a/src/main/java/net/pterodactylus/rhynodge/engine/Options.java +++ b/src/main/java/net/pterodactylus/rhynodge/engine/Options.java @@ -2,6 +2,8 @@ package net.pterodactylus.rhynodge.engine; import net.pterodactylus.util.envopt.Option; +import java.util.StringJoiner; + /** * Options for Rhynodge which must be set as environment variables. * @@ -24,4 +26,15 @@ public class Options { @Option(name = "CHAIN_DIRECTORY", defaultValue = "chains") public final String chainDirectory = null; + @Override + public String toString() { + return new StringJoiner(", ", Options.class.getSimpleName() + "[", "]") + .add("smtpHostname='" + smtpHostname + "'") + .add("errorEmailSender='" + errorEmailSender + "'") + .add("errorEmailRecipient='" + errorEmailRecipient + "'") + .add("stateDirectory='" + stateDirectory + "'") + .add("chainDirectory='" + chainDirectory + "'") + .toString(); + } + } diff --git a/src/main/java/net/pterodactylus/rhynodge/engine/Starter.java b/src/main/java/net/pterodactylus/rhynodge/engine/Starter.java index 2908ddd..3bcde3d 100644 --- a/src/main/java/net/pterodactylus/rhynodge/engine/Starter.java +++ b/src/main/java/net/pterodactylus/rhynodge/engine/Starter.java @@ -19,6 +19,7 @@ package net.pterodactylus.rhynodge.engine; import java.io.IOException; import java.util.Arrays; +import java.util.logging.Logger; import net.pterodactylus.rhynodge.actions.EmailAction; import net.pterodactylus.rhynodge.loader.ChainWatcher; @@ -45,6 +46,7 @@ public class Starter { */ public static void main(String... arguments) throws IOException { Options options = Parser.fromSystemEnvironment().parseEnvironment(Options::new); + logger.info("Options: " + options); EmailAction errorEmailAction = createErrorEmailAction(options.smtpHostname, options.errorEmailSender, options.errorEmailRecipient); @@ -63,4 +65,6 @@ public class Starter { return new EmailAction(smtpHostname, errorEmailSender, errorEmailRecipient); } + private static final Logger logger = Logger.getLogger(Starter.class.getName()); + }