From 388f306f687211682bc38c66c1f95fc52e173b04 Mon Sep 17 00:00:00 2001 From: Hammy Date: Fri, 6 Aug 2021 06:26:19 +0100 Subject: [PATCH] Use logger instead of printing stacktrace --- src/main/java/me/goudham/MacClipboardListener.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/me/goudham/MacClipboardListener.java b/src/main/java/me/goudham/MacClipboardListener.java index 8e62c6d..ed391bb 100644 --- a/src/main/java/me/goudham/MacClipboardListener.java +++ b/src/main/java/me/goudham/MacClipboardListener.java @@ -113,7 +113,7 @@ class MacClipboardListener extends ClipboardListener implements Runnable { try { sleep(200); } catch (InterruptedException ie) { - ie.printStackTrace(); + logger.error("Exception Thrown As Thread Cannot Sleep", ie); } listening = false; @@ -140,7 +140,7 @@ class MacClipboardListener extends ClipboardListener implements Runnable { try { sleep(200); } catch (InterruptedException ie) { - ie.printStackTrace(); + logger.error("Exception Thrown As Thread Cannot Sleep", ie); } clipboard.setContents(new StringSelection(stringContent), null); @@ -151,7 +151,7 @@ class MacClipboardListener extends ClipboardListener implements Runnable { try { sleep(200); } catch (InterruptedException ie) { - ie.printStackTrace(); + logger.error("Exception Thrown As Thread Cannot Sleep", ie); } clipboard.setContents(new TransferableImage(imageContent), null); @@ -162,7 +162,7 @@ class MacClipboardListener extends ClipboardListener implements Runnable { try { sleep(200); } catch (InterruptedException ie) { - ie.printStackTrace(); + logger.error("Exception Thrown As Thread Cannot Sleep", ie); } clipboard.setContents(new TransferableFileList(fileContent), null); @@ -176,7 +176,7 @@ class MacClipboardListener extends ClipboardListener implements Runnable { checkImages(newClipboardContents, myClipboardContents); checkFiles(newClipboardContents, myClipboardContents); } catch (IllegalStateException ise) { - ise.printStackTrace(); + logger.error("Exception Thrown As Clipboard Cannot Be Accessed", ise); } }