From 7129e82038dcd5b6dac84b6719dfcf77798bda20 Mon Sep 17 00:00:00 2001 From: CyB3RC0nN0R Date: Sun, 16 Feb 2020 21:53:10 +0100 Subject: [PATCH 1/5] Appended timestamp to log file names --- src/main/java/envoy/client/util/EnvoyLog.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/envoy/client/util/EnvoyLog.java b/src/main/java/envoy/client/util/EnvoyLog.java index ae6c6e5..a6391c6 100644 --- a/src/main/java/envoy/client/util/EnvoyLog.java +++ b/src/main/java/envoy/client/util/EnvoyLog.java @@ -2,6 +2,8 @@ package envoy.client.util; import java.io.File; import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.Date; import java.util.logging.*; import envoy.client.data.Config; @@ -25,7 +27,8 @@ public class EnvoyLog { LogManager.getLogManager().reset(); // Configure log file - File logFile = new File(Config.getInstance().getHomeDirectory(), "log/envoy_user.log"); + File logFile = new File(Config.getInstance().getHomeDirectory(), + "log/envoy_user_" + new SimpleDateFormat("yyyy-MM-dd--hh-mm-mm").format(new Date()) + ".log"); logFile.getParentFile().mkdirs(); // Configure formatting From a7e9c70cfcb8a6ea939fc5de5b860b94ea32a4a3 Mon Sep 17 00:00:00 2001 From: CyB3RC0nN0R Date: Tue, 18 Feb 2020 07:16:35 +0100 Subject: [PATCH 2/5] Fixed logger level configuration, using logger hierarchy Loggers are now created with a class object --- src/main/java/envoy/client/data/Cache.java | 2 +- src/main/java/envoy/client/net/Client.java | 2 +- .../MessageStatusChangeEventProcessor.java | 2 +- .../client/net/ReceivedMessageProcessor.java | 4 +-- src/main/java/envoy/client/net/Receiver.java | 4 +-- .../java/envoy/client/net/WriteProxy.java | 2 +- src/main/java/envoy/client/ui/ChatWindow.java | 2 +- .../java/envoy/client/ui/LoginDialog.java | 2 +- src/main/java/envoy/client/ui/Startup.java | 2 +- .../ui/settings/GeneralSettingsPanel.java | 6 ++--- .../client/ui/settings/SettingsScreen.java | 2 +- .../ui/settings/ThemeCustomizationPanel.java | 2 +- src/main/java/envoy/client/util/EnvoyLog.java | 27 +++++++++++-------- 13 files changed, 32 insertions(+), 27 deletions(-) diff --git a/src/main/java/envoy/client/data/Cache.java b/src/main/java/envoy/client/data/Cache.java index 80ef26f..078c377 100644 --- a/src/main/java/envoy/client/data/Cache.java +++ b/src/main/java/envoy/client/data/Cache.java @@ -24,7 +24,7 @@ public class Cache implements Consumer, Serializable { private final Queue elements = new LinkedList<>(); private transient Consumer processor; - private static final Logger logger = EnvoyLog.getLogger(Cache.class.getSimpleName()); + private static final Logger logger = EnvoyLog.getLogger(Cache.class); private static final long serialVersionUID = 7343544675545545076L; /** diff --git a/src/main/java/envoy/client/net/Client.java b/src/main/java/envoy/client/net/Client.java index b404807..5cd1b15 100644 --- a/src/main/java/envoy/client/net/Client.java +++ b/src/main/java/envoy/client/net/Client.java @@ -46,7 +46,7 @@ public class Client implements Closeable { // Configuration and logging private static final Config config = Config.getInstance(); - private static final Logger logger = EnvoyLog.getLogger(Client.class.getSimpleName()); + private static final Logger logger = EnvoyLog.getLogger(Client.class); /** * Enters the online mode by acquiring a user ID from the server. As a diff --git a/src/main/java/envoy/client/net/MessageStatusChangeEventProcessor.java b/src/main/java/envoy/client/net/MessageStatusChangeEventProcessor.java index b81561c..774b06b 100644 --- a/src/main/java/envoy/client/net/MessageStatusChangeEventProcessor.java +++ b/src/main/java/envoy/client/net/MessageStatusChangeEventProcessor.java @@ -18,7 +18,7 @@ import envoy.event.MessageStatusChangeEvent; */ public class MessageStatusChangeEventProcessor implements Consumer { - private static final Logger logger = EnvoyLog.getLogger(MessageStatusChangeEventProcessor.class.getSimpleName()); + private static final Logger logger = EnvoyLog.getLogger(MessageStatusChangeEventProcessor.class); /** * Dispatches a {@link MessageStatusChangeEvent} if the status is diff --git a/src/main/java/envoy/client/net/ReceivedMessageProcessor.java b/src/main/java/envoy/client/net/ReceivedMessageProcessor.java index 5916950..5196402 100644 --- a/src/main/java/envoy/client/net/ReceivedMessageProcessor.java +++ b/src/main/java/envoy/client/net/ReceivedMessageProcessor.java @@ -13,13 +13,13 @@ import envoy.event.EventBus; * Project: envoy-client
* File: ReceivedMessageProcessor.java
* Created: 31.12.2019
- * + * * @author Kai S. K. Engelbart * @since Envoy v0.3-alpha */ public class ReceivedMessageProcessor implements Consumer { - private static final Logger logger = EnvoyLog.getLogger(ReceivedMessageProcessor.class.getSimpleName()); + private static final Logger logger = EnvoyLog.getLogger(ReceivedMessageProcessor.class); @Override public void accept(Message message) { diff --git a/src/main/java/envoy/client/net/Receiver.java b/src/main/java/envoy/client/net/Receiver.java index d8a0d45..1746f73 100644 --- a/src/main/java/envoy/client/net/Receiver.java +++ b/src/main/java/envoy/client/net/Receiver.java @@ -26,7 +26,7 @@ public class Receiver implements Runnable { private final InputStream in; private final Map, Consumer> processors = new HashMap<>(); - private static final Logger logger = EnvoyLog.getLogger(Receiver.class.getSimpleName()); + private static final Logger logger = EnvoyLog.getLogger(Receiver.class); /** * Creates an instance of {@link Receiver}. @@ -51,7 +51,7 @@ public class Receiver implements Runnable { try (ObjectInputStream oin = new ObjectInputStream(new ByteArrayInputStream(objBytes))) { Object obj = oin.readObject(); - logger.info("Received object " + obj); + logger.fine("Received object " + obj); // Get appropriate processor @SuppressWarnings("rawtypes") diff --git a/src/main/java/envoy/client/net/WriteProxy.java b/src/main/java/envoy/client/net/WriteProxy.java index 93e67d8..e06ae88 100644 --- a/src/main/java/envoy/client/net/WriteProxy.java +++ b/src/main/java/envoy/client/net/WriteProxy.java @@ -26,7 +26,7 @@ public class WriteProxy { private final Client client; private final LocalDb localDb; - private static final Logger logger = EnvoyLog.getLogger(WriteProxy.class.getSimpleName()); + private static final Logger logger = EnvoyLog.getLogger(WriteProxy.class); /** * Initializes a write proxy using a client and a local database. The diff --git a/src/main/java/envoy/client/ui/ChatWindow.java b/src/main/java/envoy/client/ui/ChatWindow.java index 045bf9c..3602283 100644 --- a/src/main/java/envoy/client/ui/ChatWindow.java +++ b/src/main/java/envoy/client/ui/ChatWindow.java @@ -72,7 +72,7 @@ public class ChatWindow extends JFrame { private final ComponentListModel contactsModel = new ComponentListModel<>(); private final ComponentList contactList = new ComponentList<>(contactRenderer); - private static final Logger logger = EnvoyLog.getLogger(ChatWindow.class.getSimpleName()); + private static final Logger logger = EnvoyLog.getLogger(ChatWindow.class); // GUI component spacing private final static int space = 4; diff --git a/src/main/java/envoy/client/ui/LoginDialog.java b/src/main/java/envoy/client/ui/LoginDialog.java index 09fd551..7b93bdf 100644 --- a/src/main/java/envoy/client/ui/LoginDialog.java +++ b/src/main/java/envoy/client/ui/LoginDialog.java @@ -60,7 +60,7 @@ public class LoginDialog extends JDialog { private final Cache receivedMessageCache; private static final Config config = Config.getInstance(); - private static final Logger logger = EnvoyLog.getLogger(LoginDialog.class.getSimpleName()); + private static final Logger logger = EnvoyLog.getLogger(LoginDialog.class); private static final long serialVersionUID = 352021600833907468L; /** diff --git a/src/main/java/envoy/client/ui/Startup.java b/src/main/java/envoy/client/ui/Startup.java index 5427fe1..a6c1aaa 100644 --- a/src/main/java/envoy/client/ui/Startup.java +++ b/src/main/java/envoy/client/ui/Startup.java @@ -34,7 +34,7 @@ public class Startup { private static ChatWindow chatWindow; - private static final Logger logger = EnvoyLog.getLogger(Startup.class.getSimpleName()); + private static final Logger logger = EnvoyLog.getLogger(Startup.class); /** * Loads the application by first loading the configuration, then acquiring a diff --git a/src/main/java/envoy/client/ui/settings/GeneralSettingsPanel.java b/src/main/java/envoy/client/ui/settings/GeneralSettingsPanel.java index a1b5966..fc91740 100644 --- a/src/main/java/envoy/client/ui/settings/GeneralSettingsPanel.java +++ b/src/main/java/envoy/client/ui/settings/GeneralSettingsPanel.java @@ -21,7 +21,7 @@ import envoy.client.util.EnvoyLog; * Project: envoy-client
* File: GeneralSettingsPanel.java
* Created: 21 Dec 2019
- * + * * @author Maximilian Käfer * @since Envoy v0.3-alpha */ @@ -30,13 +30,13 @@ public class GeneralSettingsPanel extends SettingsPanel { private Theme theme; private static final String[] items = { "onCloseMode", "enterToSend" }; - private static final Logger logger = EnvoyLog.getLogger(GeneralSettingsPanel.class.getSimpleName()); + private static final Logger logger = EnvoyLog.getLogger(GeneralSettingsPanel.class); private static final long serialVersionUID = -7470848775130754239L; /** * This is the constructor for the General class. Here the user can set general * settings for the client. - * + * * @param parent the {@link SettingsScreen} as a part of which this * {@link SettingsPanel} is displayed * @since Envoy v0.3-alpha diff --git a/src/main/java/envoy/client/ui/settings/SettingsScreen.java b/src/main/java/envoy/client/ui/settings/SettingsScreen.java index df2fa2c..a84085b 100644 --- a/src/main/java/envoy/client/ui/settings/SettingsScreen.java +++ b/src/main/java/envoy/client/ui/settings/SettingsScreen.java @@ -47,7 +47,7 @@ public class SettingsScreen extends JDialog { private SettingsPanel settingsPanel; - private static final Logger logger = EnvoyLog.getLogger(SettingsScreen.class.getSimpleName()); + private static final Logger logger = EnvoyLog.getLogger(SettingsScreen.class); /** * Initializes the settings screen. diff --git a/src/main/java/envoy/client/ui/settings/ThemeCustomizationPanel.java b/src/main/java/envoy/client/ui/settings/ThemeCustomizationPanel.java index ed4be4f..09a05e2 100644 --- a/src/main/java/envoy/client/ui/settings/ThemeCustomizationPanel.java +++ b/src/main/java/envoy/client/ui/settings/ThemeCustomizationPanel.java @@ -40,7 +40,7 @@ public class ThemeCustomizationPanel extends SettingsPanel { private final Insets insets = new Insets(5, 5, 5, 5); - private static final Logger logger = EnvoyLog.getLogger(ThemeCustomizationPanel.class.getSimpleName()); + private static final Logger logger = EnvoyLog.getLogger(ThemeCustomizationPanel.class); private static final long serialVersionUID = -8697897390666456624L; /** diff --git a/src/main/java/envoy/client/util/EnvoyLog.java b/src/main/java/envoy/client/util/EnvoyLog.java index a6391c6..451810f 100644 --- a/src/main/java/envoy/client/util/EnvoyLog.java +++ b/src/main/java/envoy/client/util/EnvoyLog.java @@ -19,6 +19,7 @@ import envoy.client.data.Config; */ public class EnvoyLog { + private static Logger root; private static FileHandler fileHandler; private static StreamHandler consoleHandler; @@ -26,6 +27,9 @@ public class EnvoyLog { // Remove default console handler LogManager.getLogManager().reset(); + // Get root logger + root = Logger.getLogger("envoy"); + // Configure log file File logFile = new File(Config.getInstance().getHomeDirectory(), "log/envoy_user_" + new SimpleDateFormat("yyyy-MM-dd--hh-mm-mm").format(new Date()) + ".log"); @@ -39,12 +43,16 @@ public class EnvoyLog { fileHandler = new FileHandler(logFile.getAbsolutePath()); fileHandler.setLevel(Config.getInstance().getFileLevelBarrier()); fileHandler.setFormatter(formatter); + root.addHandler(fileHandler); } catch (SecurityException | IOException e) { e.printStackTrace(); } consoleHandler = new StreamHandler(System.out, formatter); consoleHandler.setLevel(Config.getInstance().getConsoleLevelBarrier()); consoleHandler.setFormatter(formatter); + root.addHandler(consoleHandler); + + root.setLevel(Level.ALL); } private EnvoyLog() {} @@ -52,19 +60,13 @@ public class EnvoyLog { /** * Creates a {@link Logger} with a specified name * - * @param name the name of the {@link Logger} to create + * @param logClass the class in which the logger is used * @return the created {@link Logger} * @since Envoy v0.2-alpha */ - public static Logger getLogger(String name) { - // Get a logger with the specified name - Logger logger = Logger.getLogger(name); - - // Add handlers - if (fileHandler != null) logger.addHandler(fileHandler); - if (consoleHandler != null) logger.addHandler(consoleHandler); - - return logger; + public static Logger getLogger(Class logClass) { + // Get a logger with the specified class name + return Logger.getLogger(logClass.getCanonicalName()); } /** @@ -74,7 +76,10 @@ public class EnvoyLog { * from 0 - 1000 or with the according name of the level * @since Envoy v0.2-alpha */ - public static void setFileLevelBarrier(Level fileLevelBarrier) { if (fileHandler != null) fileHandler.setLevel(fileLevelBarrier); } + public static void setFileLevelBarrier(Level fileLevelBarrier) { + if (fileHandler != null) fileHandler.setLevel(fileLevelBarrier); + + } /** * @param consoleLevelBarrier the severity below which logRecords will not be From 6dd1b40130fec87e4e3cd3eed5b915e3b792ca95 Mon Sep 17 00:00:00 2001 From: CyB3RC0nN0R Date: Tue, 18 Feb 2020 08:14:04 +0100 Subject: [PATCH 3/5] Adder EnvoyLog#attach(String) method to log specific packages --- src/main/java/envoy/client/ui/Startup.java | 3 ++- src/main/java/envoy/client/util/EnvoyLog.java | 27 +++++++++++++------ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/main/java/envoy/client/ui/Startup.java b/src/main/java/envoy/client/ui/Startup.java index a6c1aaa..62d3f69 100644 --- a/src/main/java/envoy/client/ui/Startup.java +++ b/src/main/java/envoy/client/ui/Startup.java @@ -68,7 +68,8 @@ public class Startup { System.exit(1); } - // Set new logger levels loaded from config + // Setup logger for the envoy package + EnvoyLog.attach("envoy"); EnvoyLog.setFileLevelBarrier(config.getFileLevelBarrier()); EnvoyLog.setConsoleLevelBarrier(config.getConsoleLevelBarrier()); diff --git a/src/main/java/envoy/client/util/EnvoyLog.java b/src/main/java/envoy/client/util/EnvoyLog.java index 451810f..ac90cd2 100644 --- a/src/main/java/envoy/client/util/EnvoyLog.java +++ b/src/main/java/envoy/client/util/EnvoyLog.java @@ -19,17 +19,14 @@ import envoy.client.data.Config; */ public class EnvoyLog { - private static Logger root; private static FileHandler fileHandler; private static StreamHandler consoleHandler; static { + // Remove default console handler LogManager.getLogManager().reset(); - // Get root logger - root = Logger.getLogger("envoy"); - // Configure log file File logFile = new File(Config.getInstance().getHomeDirectory(), "log/envoy_user_" + new SimpleDateFormat("yyyy-MM-dd--hh-mm-mm").format(new Date()) + ".log"); @@ -43,20 +40,34 @@ public class EnvoyLog { fileHandler = new FileHandler(logFile.getAbsolutePath()); fileHandler.setLevel(Config.getInstance().getFileLevelBarrier()); fileHandler.setFormatter(formatter); - root.addHandler(fileHandler); } catch (SecurityException | IOException e) { e.printStackTrace(); } consoleHandler = new StreamHandler(System.out, formatter); consoleHandler.setLevel(Config.getInstance().getConsoleLevelBarrier()); consoleHandler.setFormatter(formatter); - root.addHandler(consoleHandler); - - root.setLevel(Level.ALL); } private EnvoyLog() {} + /** + * Configures all loggers that are contained within the hierarchy of a specific + * path + * + * @param path the path to the loggers to configure + */ + public static void attach(String path) { + // Get root logger + Logger logger = Logger.getLogger(path); + + // Add handlers + if (fileHandler != null) logger.addHandler(fileHandler); + logger.addHandler(consoleHandler); + + // Delegate logger level filtering to the handlers + logger.setLevel(Level.ALL); + } + /** * Creates a {@link Logger} with a specified name * From 353a6dd646774e50397bee5c420489304b02d8b9 Mon Sep 17 00:00:00 2001 From: CyB3RC0nN0R Date: Tue, 18 Feb 2020 16:10:33 +0100 Subject: [PATCH 4/5] Updated Javadoc in EnvoyLog --- src/main/java/envoy/client/util/EnvoyLog.java | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/main/java/envoy/client/util/EnvoyLog.java b/src/main/java/envoy/client/util/EnvoyLog.java index ac90cd2..c9ef8cd 100644 --- a/src/main/java/envoy/client/util/EnvoyLog.java +++ b/src/main/java/envoy/client/util/EnvoyLog.java @@ -9,6 +9,12 @@ import java.util.logging.*; import envoy.client.data.Config; /** + * Configures the {@link java.util.logging} API to output the log into the + * console and a log file.
+ *
+ * Call the {@link EnvoyLog#attach(String)} method to configure a part of the + * logger hierarchy.
+ *
* Project: envoy-client
* File: EnvoyLogger.java
* Created: 14 Dec 2019
@@ -52,9 +58,10 @@ public class EnvoyLog { /** * Configures all loggers that are contained within the hierarchy of a specific - * path - * + * path to use the console and file handlers. + * * @param path the path to the loggers to configure + * @since Envoy Client v0.4-alpha */ public static void attach(String path) { // Get root logger @@ -69,10 +76,11 @@ public class EnvoyLog { } /** - * Creates a {@link Logger} with a specified name + * Creates a logger for a specified class, which output will be displayed inside + * the console and written to the log file. * * @param logClass the class in which the logger is used - * @return the created {@link Logger} + * @return the created logger * @since Envoy v0.2-alpha */ public static Logger getLogger(Class logClass) { @@ -81,23 +89,17 @@ public class EnvoyLog { } /** - * @param fileLevelBarrier the severity below which logRecords will not be - * written to the log file. At or above they'll also be - * logged in a file. Can be written either in Digits - * from 0 - 1000 or with the according name of the level + * Defines the logger level required for a record to be written to the log file. + * + * @param fileLevelBarrier the log file level * @since Envoy v0.2-alpha */ - public static void setFileLevelBarrier(Level fileLevelBarrier) { - if (fileHandler != null) fileHandler.setLevel(fileLevelBarrier); - - } + public static void setFileLevelBarrier(Level fileLevelBarrier) { if (fileHandler != null) fileHandler.setLevel(fileLevelBarrier); } /** - * @param consoleLevelBarrier the severity below which logRecords will not be - * written to the console. At or above they'll also - * be logged in a file. Can be written either in - * digits from 0 - 1000 or with the according name of - * the level + * Defines the logger level required for a record to be written to the console. + * + * @param consoleLevelBarrier the console logger level * @since Envoy v0.2-alpha */ public static void setConsoleLevelBarrier(Level consoleLevelBarrier) { From 531b35f6b78f1640a4dd903ad41da4f134da0358 Mon Sep 17 00:00:00 2001 From: CyB3RC0nN0R Date: Tue, 18 Feb 2020 16:34:14 +0100 Subject: [PATCH 5/5] Adjusted logging locations and levels --- src/main/java/envoy/client/data/Cache.java | 2 +- src/main/java/envoy/client/net/Client.java | 6 +++--- .../envoy/client/net/MessageStatusChangeEventProcessor.java | 2 +- src/main/java/envoy/client/net/Receiver.java | 2 +- src/main/java/envoy/client/net/WriteProxy.java | 4 ++-- src/main/java/envoy/client/ui/ChatWindow.java | 1 - .../java/envoy/client/ui/settings/GeneralSettingsPanel.java | 2 +- src/main/java/envoy/client/util/EnvoyLog.java | 1 - 8 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/main/java/envoy/client/data/Cache.java b/src/main/java/envoy/client/data/Cache.java index 078c377..a727d01 100644 --- a/src/main/java/envoy/client/data/Cache.java +++ b/src/main/java/envoy/client/data/Cache.java @@ -35,7 +35,7 @@ public class Cache implements Consumer, Serializable { */ @Override public void accept(T element) { - logger.info(String.format("Adding element %s to cache", element)); + logger.fine(String.format("Adding element %s to cache", element)); elements.offer(element); } diff --git a/src/main/java/envoy/client/net/Client.java b/src/main/java/envoy/client/net/Client.java index 5cd1b15..7a7f960 100644 --- a/src/main/java/envoy/client/net/Client.java +++ b/src/main/java/envoy/client/net/Client.java @@ -77,8 +77,8 @@ public class Client implements Closeable { receiver = new Receiver(socket.getInputStream()); // Register user creation processor, contact list processor and message cache - receiver.registerProcessor(User.class, sender -> { logger.info("Acquired user object " + sender); this.sender = sender; }); - receiver.registerProcessor(Contacts.class, contacts -> { logger.info("Acquired contacts object " + contacts); this.contacts = contacts; }); + receiver.registerProcessor(User.class, sender -> this.sender = sender); + receiver.registerProcessor(Contacts.class, contacts -> this.contacts = contacts); receiver.registerProcessor(Message.class, receivedMessageCache); receiver.registerProcessor(HandshakeRejectionEvent.class, evt -> { rejected = true; EventBus.getInstance().dispatch(evt); }); @@ -88,7 +88,6 @@ public class Client implements Closeable { new Thread(receiver).start(); // Write login credentials - logger.finest("Sending login credentials..."); SerializationUtils.writeBytesWithLength(credentials, socket.getOutputStream()); // Wait for a maximum of five seconds to acquire the sender object @@ -225,6 +224,7 @@ public class Client implements Closeable { private void writeObject(Object obj) throws IOException { checkOnline(); + logger.fine("Sending object " + obj); SerializationUtils.writeBytesWithLength(obj, socket.getOutputStream()); } diff --git a/src/main/java/envoy/client/net/MessageStatusChangeEventProcessor.java b/src/main/java/envoy/client/net/MessageStatusChangeEventProcessor.java index 774b06b..8197d53 100644 --- a/src/main/java/envoy/client/net/MessageStatusChangeEventProcessor.java +++ b/src/main/java/envoy/client/net/MessageStatusChangeEventProcessor.java @@ -29,7 +29,7 @@ public class MessageStatusChangeEventProcessor implements Consumer { try { - logger.info("Sending cached " + msg); + logger.finer("Sending cached " + msg); client.sendMessage(msg); } catch (IOException e) { logger.log(Level.SEVERE, "Could not send cached message", e); } }); localDb.getStatusCache().setProcessor(evt -> { - logger.info("Sending cached " + evt); + logger.finer("Sending cached " + evt); try { client.sendEvent(evt); } catch (IOException e) { diff --git a/src/main/java/envoy/client/ui/ChatWindow.java b/src/main/java/envoy/client/ui/ChatWindow.java index 3602283..22ab504 100644 --- a/src/main/java/envoy/client/ui/ChatWindow.java +++ b/src/main/java/envoy/client/ui/ChatWindow.java @@ -390,7 +390,6 @@ public class ChatWindow extends JFrame { EventBus.getInstance().register(ContactSearchResult.class, evt -> { contactsModel.clear(); final java.util.List contacts = evt.get(); - logger.info("Received contact search result " + contacts); contacts.forEach(contactsModel::add); revalidate(); repaint(); diff --git a/src/main/java/envoy/client/ui/settings/GeneralSettingsPanel.java b/src/main/java/envoy/client/ui/settings/GeneralSettingsPanel.java index fc91740..f4537b3 100644 --- a/src/main/java/envoy/client/ui/settings/GeneralSettingsPanel.java +++ b/src/main/java/envoy/client/ui/settings/GeneralSettingsPanel.java @@ -89,5 +89,5 @@ public class GeneralSettingsPanel extends SettingsPanel { } @Override - public ActionListener getOkButtonAction() { return (evt) -> {}; } + public ActionListener getOkButtonAction() { return evt -> {}; } } \ No newline at end of file diff --git a/src/main/java/envoy/client/util/EnvoyLog.java b/src/main/java/envoy/client/util/EnvoyLog.java index c9ef8cd..3cbb856 100644 --- a/src/main/java/envoy/client/util/EnvoyLog.java +++ b/src/main/java/envoy/client/util/EnvoyLog.java @@ -84,7 +84,6 @@ public class EnvoyLog { * @since Envoy v0.2-alpha */ public static Logger getLogger(Class logClass) { - // Get a logger with the specified class name return Logger.getLogger(logClass.getCanonicalName()); }