From 9bf42f6458c59408cd809c54a72cba771427735a Mon Sep 17 00:00:00 2001 From: Manuel Richarz Date: Mon, 16 Jun 2014 15:03:13 +0200 Subject: [PATCH] Disabled creation of Logfile if debugToFile is false Added condition to check if debugToFile is true before creating Logfile. --- .../theholywaffle/teamspeak3/log/LogHandler.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/github/theholywaffle/teamspeak3/log/LogHandler.java b/src/main/java/com/github/theholywaffle/teamspeak3/log/LogHandler.java index 55726a65..bdaed39c 100644 --- a/src/main/java/com/github/theholywaffle/teamspeak3/log/LogHandler.java +++ b/src/main/java/com/github/theholywaffle/teamspeak3/log/LogHandler.java @@ -29,12 +29,14 @@ public class LogHandler extends Handler { public LogHandler(boolean debugToFile) { this.debugToFile = debugToFile; - log = new File("teamspeak.log"); - if (!log.exists()) { - try { - log.createNewFile(); - } catch (IOException e) { - e.printStackTrace(); + if(this.debugToFile) { + log = new File("teamspeak.log"); + if (!log.exists()) { + try { + log.createNewFile(); + } catch (IOException e) { + e.printStackTrace(); + } } } }