From 6745bbf9dfd6a06fd4f414d025e2a2ad6d763dcb Mon Sep 17 00:00:00 2001 From: akwizgran <akwizgran@users.sourceforge.net> Date: Sat, 5 Apr 2014 20:24:04 +0100 Subject: [PATCH] Skip a logging method if logging is disabled. --- .../src/org/briarproject/plugins/tor/TorPlugin.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/briar-android/src/org/briarproject/plugins/tor/TorPlugin.java b/briar-android/src/org/briarproject/plugins/tor/TorPlugin.java index 07160440c3..5b3a339b56 100644 --- a/briar-android/src/org/briarproject/plugins/tor/TorPlugin.java +++ b/briar-android/src/org/briarproject/plugins/tor/TorPlugin.java @@ -186,7 +186,7 @@ class TorPlugin implements DuplexPlugin, EventHandler { // Wait for the auth cookie file to be created/updated if(!latch.await(COOKIE_TIMEOUT, MILLISECONDS)) { LOG.warning("Auth cookie not created"); - listFiles(torDirectory); + if(LOG.isLoggable(INFO)) listFiles(torDirectory); return false; } } catch(InterruptedException e1) { @@ -337,8 +337,8 @@ class TorPlugin implements DuplexPlugin, EventHandler { } private void listFiles(File f) { - if(f.isDirectory()) for(File f1 : f.listFiles()) listFiles(f1); - else if(LOG.isLoggable(INFO)) LOG.info(f.getAbsolutePath()); + if(f.isDirectory()) for(File child : f.listFiles()) listFiles(child); + else LOG.info(f.getAbsolutePath()); } private byte[] read(File f) throws IOException { @@ -491,7 +491,7 @@ class TorPlugin implements DuplexPlugin, EventHandler { // Wait for the hostname file to be created/updated if(!latch.await(HOSTNAME_TIMEOUT, MILLISECONDS)) { LOG.warning("Hidden service not created"); - listFiles(torDirectory); + if(LOG.isLoggable(INFO)) listFiles(torDirectory); return; } if(!running) return; -- GitLab