Skip to content
Snippets Groups Projects
Commit 6745bbf9 authored by akwizgran's avatar akwizgran
Browse files

Skip a logging method if logging is disabled.

parent 6a0e7f8a
No related branches found
No related tags found
No related merge requests found
...@@ -186,7 +186,7 @@ class TorPlugin implements DuplexPlugin, EventHandler { ...@@ -186,7 +186,7 @@ class TorPlugin implements DuplexPlugin, EventHandler {
// Wait for the auth cookie file to be created/updated // Wait for the auth cookie file to be created/updated
if(!latch.await(COOKIE_TIMEOUT, MILLISECONDS)) { if(!latch.await(COOKIE_TIMEOUT, MILLISECONDS)) {
LOG.warning("Auth cookie not created"); LOG.warning("Auth cookie not created");
listFiles(torDirectory); if(LOG.isLoggable(INFO)) listFiles(torDirectory);
return false; return false;
} }
} catch(InterruptedException e1) { } catch(InterruptedException e1) {
...@@ -337,8 +337,8 @@ class TorPlugin implements DuplexPlugin, EventHandler { ...@@ -337,8 +337,8 @@ class TorPlugin implements DuplexPlugin, EventHandler {
} }
private void listFiles(File f) { private void listFiles(File f) {
if(f.isDirectory()) for(File f1 : f.listFiles()) listFiles(f1); if(f.isDirectory()) for(File child : f.listFiles()) listFiles(child);
else if(LOG.isLoggable(INFO)) LOG.info(f.getAbsolutePath()); else LOG.info(f.getAbsolutePath());
} }
private byte[] read(File f) throws IOException { private byte[] read(File f) throws IOException {
...@@ -491,7 +491,7 @@ class TorPlugin implements DuplexPlugin, EventHandler { ...@@ -491,7 +491,7 @@ class TorPlugin implements DuplexPlugin, EventHandler {
// Wait for the hostname file to be created/updated // Wait for the hostname file to be created/updated
if(!latch.await(HOSTNAME_TIMEOUT, MILLISECONDS)) { if(!latch.await(HOSTNAME_TIMEOUT, MILLISECONDS)) {
LOG.warning("Hidden service not created"); LOG.warning("Hidden service not created");
listFiles(torDirectory); if(LOG.isLoggable(INFO)) listFiles(torDirectory);
return; return;
} }
if(!running) return; if(!running) return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment