diff options
author | Werner Dittmann <wernerd@java.net> | 2010-06-04 06:07:09 +0000 |
---|---|---|
committer | Werner Dittmann <wernerd@java.net> | 2010-06-04 06:07:09 +0000 |
commit | caf11ee51b2665f2ffa022522f502720a1b6b900 (patch) | |
tree | 75a378ed2e74ddf8935aee6fb03a263bb5f58bfc /src/net | |
parent | 238a7494c27f1a426c3fc24908e288ebf761fe75 (diff) | |
download | jitsi-caf11ee51b2665f2ffa022522f502720a1b6b900.zip jitsi-caf11ee51b2665f2ffa022522f502720a1b6b900.tar.gz jitsi-caf11ee51b2665f2ffa022522f502720a1b6b900.tar.bz2 |
Fix logger usage - seventh and last bunch
Diffstat (limited to 'src/net')
56 files changed, 350 insertions, 170 deletions
diff --git a/src/net/java/sip/communicator/impl/resources/ResourceManagementActivator.java b/src/net/java/sip/communicator/impl/resources/ResourceManagementActivator.java index 291e6a3..3a27701 100644 --- a/src/net/java/sip/communicator/impl/resources/ResourceManagementActivator.java +++ b/src/net/java/sip/communicator/impl/resources/ResourceManagementActivator.java @@ -39,7 +39,8 @@ public class ResourceManagementActivator resPackImpl, null); - logger.info("Resource manager ... [REGISTERED]"); + if (logger.isInfoEnabled()) + logger.info("Resource manager ... [REGISTERED]"); } public void stop(BundleContext bc) throws Exception diff --git a/src/net/java/sip/communicator/impl/resources/ResourceManagementServiceImpl.java b/src/net/java/sip/communicator/impl/resources/ResourceManagementServiceImpl.java index 8c7283a..45d27b5 100644 --- a/src/net/java/sip/communicator/impl/resources/ResourceManagementServiceImpl.java +++ b/src/net/java/sip/communicator/impl/resources/ResourceManagementServiceImpl.java @@ -176,7 +176,8 @@ public class ResourceManagementServiceImpl if (event.getType() == ServiceEvent.REGISTERED) { - logger.info("Resource registered " + resourcePack); + if (logger.isInfoEnabled()) + logger.info("Resource registered " + resourcePack); Map<String, String> resources = getResources(resourcePack); @@ -351,7 +352,8 @@ public class ResourceManagementServiceImpl if (path == null || path.length() == 0) { - logger.info("Missing resource for key: " + urlKey); + if (logger.isInfoEnabled()) + logger.info("Missing resource for key: " + urlKey); return null; } return getImageURLForPath(path); diff --git a/src/net/java/sip/communicator/impl/shutdowntimeout/ShutdownTimeout.java b/src/net/java/sip/communicator/impl/shutdowntimeout/ShutdownTimeout.java index 0fe80ab..dae13fe 100644 --- a/src/net/java/sip/communicator/impl/shutdowntimeout/ShutdownTimeout.java +++ b/src/net/java/sip/communicator/impl/shutdowntimeout/ShutdownTimeout.java @@ -49,7 +49,8 @@ public class ShutdownTimeout public void start(BundleContext context) throws Exception { - logger.debug("Starting the ShutdownTimeout service."); + if (logger.isDebugEnabled()) + logger.debug("Starting the ShutdownTimeout service."); } /** @@ -72,18 +73,21 @@ public class ShutdownTimeout synchronized(this) { try{ - logger.trace("Starting shutdown countdown of " + if (logger.isTraceEnabled()) + logger.trace("Starting shutdown countdown of " + SHUTDOWN_TIMEOUT + "ms."); wait(SHUTDOWN_TIMEOUT); logger.error("Failed to gently shutdown. Forcing exit."); System.exit(500); }catch (InterruptedException ex){ - logger.debug("Interrupted shutdown timer."); + if (logger.isDebugEnabled()) + logger.debug("Interrupted shutdown timer."); } } } }; - logger.trace("Created the shutdown timer thread."); + if (logger.isTraceEnabled()) + logger.trace("Created the shutdown timer thread."); shutdownTimeoutThread.setDaemon(true); shutdownTimeoutThread.start(); } diff --git a/src/net/java/sip/communicator/impl/sparkle/SparkleActivator.java b/src/net/java/sip/communicator/impl/sparkle/SparkleActivator.java index b3fbe5c..8a98b5f 100644 --- a/src/net/java/sip/communicator/impl/sparkle/SparkleActivator.java +++ b/src/net/java/sip/communicator/impl/sparkle/SparkleActivator.java @@ -73,7 +73,8 @@ public class SparkleActivator catch(Throwable t) { logger.warn("Couldn't load sparkle library."); - logger.debug("Couldn't load sparkle library.", t); + if (logger.isDebugEnabled()) + logger.debug("Couldn't load sparkle library.", t); return; } @@ -82,7 +83,8 @@ public class SparkleActivator initSparkle(System.getProperty("user.dir") + "/../../Frameworks/Sparkle.framework", updateAtStartup, checkInterval); - logger.info("Sparkle Plugin ...[Started]"); + if (logger.isInfoEnabled()) + logger.info("Sparkle Plugin ...[Started]"); } /** @@ -95,6 +97,7 @@ public class SparkleActivator */ public void stop(BundleContext bundleContext) throws Exception { - logger.info("Sparkle Plugin ...[Stopped]"); + if (logger.isInfoEnabled()) + logger.info("Sparkle Plugin ...[Stopped]"); } } diff --git a/src/net/java/sip/communicator/impl/swingnotification/SwingNotificationActivator.java b/src/net/java/sip/communicator/impl/swingnotification/SwingNotificationActivator.java index 12975bf..d9bc193 100644 --- a/src/net/java/sip/communicator/impl/swingnotification/SwingNotificationActivator.java +++ b/src/net/java/sip/communicator/impl/swingnotification/SwingNotificationActivator.java @@ -47,7 +47,8 @@ public class SwingNotificationActivator implements BundleActivator */ public void start(BundleContext bc) throws Exception { - logger.info("Swing Notification ...[ STARTING ]"); + if (logger.isInfoEnabled()) + logger.info("Swing Notification ...[ STARTING ]"); bundleContext = bc; @@ -61,7 +62,8 @@ public class SwingNotificationActivator implements BundleActivator , handler , null); - logger.info("Swing Notification ...[REGISTERED]"); + if (logger.isInfoEnabled()) + logger.info("Swing Notification ...[REGISTERED]"); } public void stop(BundleContext arg0) throws Exception diff --git a/src/net/java/sip/communicator/impl/version/VersionActivator.java b/src/net/java/sip/communicator/impl/version/VersionActivator.java index 32f0ee1..638f2e7 100644 --- a/src/net/java/sip/communicator/impl/version/VersionActivator.java +++ b/src/net/java/sip/communicator/impl/version/VersionActivator.java @@ -39,7 +39,8 @@ public class VersionActivator */ public void start(BundleContext context) throws Exception { - logger.debug("Started."); + if (logger.isDebugEnabled()) + logger.debug("Started."); VersionActivator.bundleContext = context; VersionServiceImpl versionServiceImpl = new VersionServiceImpl(); @@ -49,8 +50,10 @@ public class VersionActivator VersionService.class.getName(), versionServiceImpl, null); - logger.debug("SIP Protocol Provider Factory ... [REGISTERED]"); - logger.debug("SIP Communicator Version: sip-communicator-" + if (logger.isDebugEnabled()) + logger.debug("SIP Protocol Provider Factory ... [REGISTERED]"); + if (logger.isDebugEnabled()) + logger.debug("SIP Communicator Version: sip-communicator-" + VersionImpl.currentVersion().toString()); //register properties for those that would like to use them diff --git a/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java b/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java index 670b67a..a370e47 100644 --- a/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java +++ b/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java @@ -216,7 +216,8 @@ public class BrandingActivator Container.CONTAINER_HELP_MENU), helpMenuFilter); - logger.info("ABOUT WINDOW ... [REGISTERED]"); + if (logger.isInfoEnabled()) + logger.info("ABOUT WINDOW ... [REGISTERED]"); // Register the about window plugin component in the chat help menu. Hashtable<String, String> chatHelpMenuFilter @@ -229,7 +230,8 @@ public class BrandingActivator Container.CONTAINER_CHAT_HELP_MENU), chatHelpMenuFilter); - logger.info("CHAT ABOUT WINDOW ... [REGISTERED]"); + if (logger.isInfoEnabled()) + logger.info("CHAT ABOUT WINDOW ... [REGISTERED]"); } static BundleContext getBundleContext() diff --git a/src/net/java/sip/communicator/plugin/chatalerter/ChatAlerterActivator.java b/src/net/java/sip/communicator/plugin/chatalerter/ChatAlerterActivator.java index 8b0356b..2e82194 100644 --- a/src/net/java/sip/communicator/plugin/chatalerter/ChatAlerterActivator.java +++ b/src/net/java/sip/communicator/plugin/chatalerter/ChatAlerterActivator.java @@ -65,7 +65,8 @@ public class ChatAlerterActivator } catch (Exception exception) { - logger.info("The Alerter not supported or problem loading it!", + if (logger.isInfoEnabled()) + logger.info("The Alerter not supported or problem loading it!", exception); return; } @@ -99,7 +100,8 @@ public class ChatAlerterActivator // in case we found any if (protocolProviderRefs != null) { - logger.debug("Found " + if (logger.isDebugEnabled()) + logger.debug("Found " + protocolProviderRefs.length + " already installed providers."); for (ServiceReference protocolProviderRef : protocolProviderRefs) @@ -163,7 +165,8 @@ public class ChatAlerterActivator */ private void handleProviderAdded(ProtocolProviderService provider) { - logger.debug("Adding protocol provider " + provider.getProtocolName()); + if (logger.isDebugEnabled()) + logger.debug("Adding protocol provider " + provider.getProtocolName()); // check whether the provider has a basic im operation set OperationSetBasicInstantMessaging opSetIm @@ -176,7 +179,8 @@ public class ChatAlerterActivator } else { - logger.trace("Service did not have a im op. set."); + if (logger.isTraceEnabled()) + logger.trace("Service did not have a im op. set."); } // check whether the provider has a sms operation set @@ -189,7 +193,8 @@ public class ChatAlerterActivator } else { - logger.trace("Service did not have a sms op. set."); + if (logger.isTraceEnabled()) + logger.trace("Service did not have a sms op. set."); } OperationSetMultiUserChat opSetMultiUChat @@ -204,7 +209,8 @@ public class ChatAlerterActivator } else { - logger.trace("Service did not have a multi im op. set."); + if (logger.isTraceEnabled()) + logger.trace("Service did not have a multi im op. set."); } } @@ -328,14 +334,16 @@ public class ChatAlerterActivator Object sService = bundleContext.getService(serviceEvent.getServiceReference()); - logger.trace("Received a service event for: " + + if (logger.isTraceEnabled()) + logger.trace("Received a service event for: " + sService.getClass().getName()); // we don't care if the source service is not a protocol provider if (!(sService instanceof ProtocolProviderService)) return; - logger.debug("Service is a protocol provider."); + if (logger.isDebugEnabled()) + logger.debug("Service is a protocol provider."); switch (serviceEvent.getType()) { case ServiceEvent.REGISTERED: diff --git a/src/net/java/sip/communicator/plugin/contactinfo/ContactInfoActivator.java b/src/net/java/sip/communicator/plugin/contactinfo/ContactInfoActivator.java index 2b50db6..db3ec8e 100644 --- a/src/net/java/sip/communicator/plugin/contactinfo/ContactInfoActivator.java +++ b/src/net/java/sip/communicator/plugin/contactinfo/ContactInfoActivator.java @@ -41,7 +41,8 @@ public class ContactInfoActivator implements BundleActivator cinfoMenuItem,
containerFilter);
- logger.info("CONTACT INFO... [REGISTERED]");
+ if (logger.isInfoEnabled()) + logger.info("CONTACT INFO... [REGISTERED]");
}
public void stop(BundleContext bc) throws Exception
diff --git a/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultResourcePackActivator.java b/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultResourcePackActivator.java index 4affd6b..c14367b 100644 --- a/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultResourcePackActivator.java +++ b/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultResourcePackActivator.java @@ -89,7 +89,8 @@ public class DefaultResourcePackActivator sndPackImpl, sndProps); - logger.info("Default resources ... [REGISTERED]"); + if (logger.isInfoEnabled()) + logger.info("Default resources ... [REGISTERED]"); } public void stop(BundleContext bc) throws Exception diff --git a/src/net/java/sip/communicator/plugin/dictaccregwizz/ThreadManager.java b/src/net/java/sip/communicator/plugin/dictaccregwizz/ThreadManager.java index 64fd01e..5ec71d5 100755..100644 --- a/src/net/java/sip/communicator/plugin/dictaccregwizz/ThreadManager.java +++ b/src/net/java/sip/communicator/plugin/dictaccregwizz/ThreadManager.java @@ -82,7 +82,8 @@ public class ThreadManager } catch (InterruptedException e) { - logger.info(e); + if (logger.isInfoEnabled()) + logger.info(e); return false; } return true; diff --git a/src/net/java/sip/communicator/plugin/exampleplugin/ExamplePluginActivator.java b/src/net/java/sip/communicator/plugin/exampleplugin/ExamplePluginActivator.java index ca43530..bc9cc44 100644 --- a/src/net/java/sip/communicator/plugin/exampleplugin/ExamplePluginActivator.java +++ b/src/net/java/sip/communicator/plugin/exampleplugin/ExamplePluginActivator.java @@ -45,7 +45,8 @@ public class ExamplePluginActivator examplePlugin, containerFilter); - logger.info("CONTACT INFO... [REGISTERED]"); + if (logger.isInfoEnabled()) + logger.info("CONTACT INFO... [REGISTERED]"); } /** diff --git a/src/net/java/sip/communicator/plugin/facebookaccregwizz/FacebookAccRegWizzActivator.java b/src/net/java/sip/communicator/plugin/facebookaccregwizz/FacebookAccRegWizzActivator.java index eecfd72..cf34a45 100644 --- a/src/net/java/sip/communicator/plugin/facebookaccregwizz/FacebookAccRegWizzActivator.java +++ b/src/net/java/sip/communicator/plugin/facebookaccregwizz/FacebookAccRegWizzActivator.java @@ -60,7 +60,8 @@ public class FacebookAccRegWizzActivator */
public void start(BundleContext bc)
{
- logger.info("Loading facebook account wizard.");
+ if (logger.isInfoEnabled()) + logger.info("Loading facebook account wizard.");
bundleContext = bc;
@@ -86,7 +87,8 @@ public class FacebookAccRegWizzActivator facebookWizard,
containerFilter);
- logger.info("Facebook account registration wizard [STARTED].");
+ if (logger.isInfoEnabled()) + logger.info("Facebook account registration wizard [STARTED].");
}
/**
diff --git a/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigPluginActivator.java b/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigPluginActivator.java index 029ac4c..a178f1f 100644 --- a/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigPluginActivator.java +++ b/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigPluginActivator.java @@ -47,7 +47,8 @@ public class GeneralConfigPluginActivator implements BundleActivator 0), null); - logger.info("PREFERENCES PLUGIN... [REGISTERED]"); + if (logger.isInfoEnabled()) + logger.info("PREFERENCES PLUGIN... [REGISTERED]"); } public void stop(BundleContext bc) throws Exception diff --git a/src/net/java/sip/communicator/plugin/gibberishaccregwizz/GibberishAccRegWizzActivator.java b/src/net/java/sip/communicator/plugin/gibberishaccregwizz/GibberishAccRegWizzActivator.java index 88752ae..ce783eb 100644 --- a/src/net/java/sip/communicator/plugin/gibberishaccregwizz/GibberishAccRegWizzActivator.java +++ b/src/net/java/sip/communicator/plugin/gibberishaccregwizz/GibberishAccRegWizzActivator.java @@ -42,7 +42,8 @@ public class GibberishAccRegWizzActivator */ public void start(BundleContext bc) { - logger.info("Loading gibberish account wizard."); + if (logger.isInfoEnabled()) + logger.info("Loading gibberish account wizard."); bundleContext = bc; @@ -68,7 +69,8 @@ public class GibberishAccRegWizzActivator gibberishWizard, containerFilter); - logger.info("Gibberish account registration wizard [STARTED]."); + if (logger.isInfoEnabled()) + logger.info("Gibberish account registration wizard [STARTED]."); } /** diff --git a/src/net/java/sip/communicator/plugin/globalproxyconfig/GlobalProxyPluginActivator.java b/src/net/java/sip/communicator/plugin/globalproxyconfig/GlobalProxyPluginActivator.java index 3670205..a69bbac 100644 --- a/src/net/java/sip/communicator/plugin/globalproxyconfig/GlobalProxyPluginActivator.java +++ b/src/net/java/sip/communicator/plugin/globalproxyconfig/GlobalProxyPluginActivator.java @@ -60,7 +60,8 @@ public class GlobalProxyPluginActivator implements BundleActivator initProperties(); - logger.info("GLOBAL PROXY CONFIGURATION PLUGIN... [REGISTERED]"); + if (logger.isInfoEnabled()) + logger.info("GLOBAL PROXY CONFIGURATION PLUGIN... [REGISTERED]"); } /** diff --git a/src/net/java/sip/communicator/plugin/googletalkaccregwizz/FirstWizardPage.java b/src/net/java/sip/communicator/plugin/googletalkaccregwizz/FirstWizardPage.java index 6249ecf..b9ffdfa 100644 --- a/src/net/java/sip/communicator/plugin/googletalkaccregwizz/FirstWizardPage.java +++ b/src/net/java/sip/communicator/plugin/googletalkaccregwizz/FirstWizardPage.java @@ -238,7 +238,8 @@ public class FirstWizardPage {
public void actionPerformed(ActionEvent evt)
{
- logger.debug("Reg OK");
+ if (logger.isDebugEnabled()) + logger.debug("Reg OK");
/*
* We don't have our own implementation of registering/signing
@@ -246,7 +247,8 @@ public class FirstWizardPage */
FirstWizardPage.this.wizard.webSignup();
- logger.debug("Reg End");
+ if (logger.isDebugEnabled()) + logger.debug("Reg End");
}
});
diff --git a/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccRegWizzActivator.java b/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccRegWizzActivator.java index 4649758..42d7556 100644 --- a/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccRegWizzActivator.java +++ b/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccRegWizzActivator.java @@ -38,7 +38,8 @@ public class IrcAccRegWizzActivator */ public void start(BundleContext bc) { - logger.info("Loading irc account wizard."); + if (logger.isInfoEnabled()) + logger.info("Loading irc account wizard."); bundleContext = bc; @@ -66,7 +67,8 @@ public class IrcAccRegWizzActivator ircWizard, containerFilter); - logger.info("IRC account registration wizard [STARTED]."); + if (logger.isInfoEnabled()) + logger.info("IRC account registration wizard [STARTED]."); } /** diff --git a/src/net/java/sip/communicator/plugin/jabberaccregwizz/FirstWizardPage.java b/src/net/java/sip/communicator/plugin/jabberaccregwizz/FirstWizardPage.java index ab9e749..57d9a84 100644 --- a/src/net/java/sip/communicator/plugin/jabberaccregwizz/FirstWizardPage.java +++ b/src/net/java/sip/communicator/plugin/jabberaccregwizz/FirstWizardPage.java @@ -245,7 +245,8 @@ public class FirstWizardPage { public void actionPerformed(ActionEvent evt) { - logger.debug("Reg OK"); + if (logger.isDebugEnabled()) + logger.debug("Reg OK"); // Open the new account dialog. @@ -262,7 +263,8 @@ public class FirstWizardPage passField.setText(jabberNewAccountDialog.password); } - logger.debug("Reg End"); + if (logger.isDebugEnabled()) + logger.debug("Reg End"); } }); diff --git a/src/net/java/sip/communicator/plugin/keybindingchooser/KeybindingChooserActivator.java b/src/net/java/sip/communicator/plugin/keybindingchooser/KeybindingChooserActivator.java index a3480c8..0abadc3 100644 --- a/src/net/java/sip/communicator/plugin/keybindingchooser/KeybindingChooserActivator.java +++ b/src/net/java/sip/communicator/plugin/keybindingchooser/KeybindingChooserActivator.java @@ -36,7 +36,8 @@ public class KeybindingChooserActivator { bundleContext = context; - logger.debug("Service Impl: " + getClass().getName() + " [ STARTED ]"); + if (logger.isDebugEnabled()) + logger.debug("Service Impl: " + getClass().getName() + " [ STARTED ]"); context .registerService( diff --git a/src/net/java/sip/communicator/plugin/mailbox/Mailbox.java b/src/net/java/sip/communicator/plugin/mailbox/Mailbox.java index e3ad55e..673262c 100644 --- a/src/net/java/sip/communicator/plugin/mailbox/Mailbox.java +++ b/src/net/java/sip/communicator/plugin/mailbox/Mailbox.java @@ -109,7 +109,8 @@ public class Mailbox } catch(NumberFormatException e) { - logger.info("failed to load the wait time out of the config file"+ + if (logger.isInfoEnabled()) + logger.info("failed to load the wait time out of the config file"+ ", using default value of 30 seconds",e); timeDelay = 30000; } @@ -140,7 +141,8 @@ public class Mailbox } catch (NumberFormatException e) { - logger.info("failed to load the max msg time out of the config"+ + if (logger.isInfoEnabled()) + logger.info("failed to load the max msg time out of the config"+ "file, using default value of 60 seconds",e); duration = 60000; } @@ -260,7 +262,8 @@ public class Mailbox */ public void start(BundleContext bc) { - logger.debug("Starting the mailbox implementation."); + if (logger.isDebugEnabled()) + logger.debug("Starting the mailbox implementation."); this.bundleContext = bc; // start listening for newly registered or removed protocol providers @@ -285,7 +288,8 @@ public class Mailbox // in case we found any if (protocolProviderRefs != null) { - logger.debug("Found " + if (logger.isDebugEnabled()) + logger.debug("Found " + protocolProviderRefs.length + " already installed providers."); for (int i = 0; i < protocolProviderRefs.length; i++) @@ -345,7 +349,8 @@ public class Mailbox */ public void handleProviderAdded(ProtocolProviderService provider) { - logger.debug("Adding protocol provider " + provider.getProtocolName()); + if (logger.isDebugEnabled()) + logger.debug("Adding protocol provider " + provider.getProtocolName()); // check whether the provider has a basic telephony operation set OperationSetBasicTelephony opSetTelephony = @@ -357,7 +362,8 @@ public class Mailbox } else { - logger.trace("Service did not have a basic telephony op. set."); + if (logger.isTraceEnabled()) + logger.trace("Service did not have a basic telephony op. set."); } } @@ -390,7 +396,8 @@ public class Mailbox Object sService = bundleContext.getService( serviceEvent.getServiceReference()); - logger.trace("Received a service event for: " + if (logger.isTraceEnabled()) + logger.trace("Received a service event for: " + sService.getClass().getName()); // we don't care if the source service is not a protocol provider @@ -399,10 +406,12 @@ public class Mailbox return; } - logger.debug("Service is a protocol provider."); + if (logger.isDebugEnabled()) + logger.debug("Service is a protocol provider."); if (serviceEvent.getType() == ServiceEvent.REGISTERED) { - logger.debug("Handling registration of a new Protocol Provider."); + if (logger.isDebugEnabled()) + logger.debug("Handling registration of a new Protocol Provider."); this.handleProviderAdded((ProtocolProviderService)sService); } @@ -476,7 +485,8 @@ public class Mailbox return; } - logger.info("Call waited long enough, picking up the phone"); + if (logger.isInfoEnabled()) + logger.info("Call waited long enough, picking up the phone"); //add our datasource to our rtp manager and answer the call MediaService mediaService = MailboxActivator.getMediaService(); @@ -607,7 +617,8 @@ public class Mailbox = call .getProtocolProvider() .getOperationSet(OperationSetBasicTelephony.class); - logger.info("Max Message Length Reached, Mailbox is" + if (logger.isInfoEnabled()) + logger.info("Max Message Length Reached, Mailbox is" +" disconnecting the call"); Iterator<? extends CallPeer> callPeers = call.getCallPeers(); diff --git a/src/net/java/sip/communicator/plugin/mailbox/MailboxActivator.java b/src/net/java/sip/communicator/plugin/mailbox/MailboxActivator.java index c223fb4..27b7515 100644 --- a/src/net/java/sip/communicator/plugin/mailbox/MailboxActivator.java +++ b/src/net/java/sip/communicator/plugin/mailbox/MailboxActivator.java @@ -67,7 +67,8 @@ public class MailboxActivator */ public void start(BundleContext bundleContext) throws Exception { - logger.info("Mailbox plug-in...[STARTING]"); + if (logger.isInfoEnabled()) + logger.info("Mailbox plug-in...[STARTING]"); MailboxActivator.bundleContext = bundleContext; //Create and start the Mailbox Service @@ -85,7 +86,8 @@ public class MailboxActivator 500), null); - logger.info("Mailbox plug-in...[STARTED]"); + if (logger.isInfoEnabled()) + logger.info("Mailbox plug-in...[STARTED]"); } /** diff --git a/src/net/java/sip/communicator/plugin/notificationconfiguration/NotificationConfigurationActivator.java b/src/net/java/sip/communicator/plugin/notificationconfiguration/NotificationConfigurationActivator.java index 273b07f..aa73949 100644 --- a/src/net/java/sip/communicator/plugin/notificationconfiguration/NotificationConfigurationActivator.java +++ b/src/net/java/sip/communicator/plugin/notificationconfiguration/NotificationConfigurationActivator.java @@ -46,7 +46,8 @@ public class NotificationConfigurationActivator implements BundleActivator 30), null); - logger.trace("Notification Configuration: [ STARTED ]"); + if (logger.isTraceEnabled()) + logger.trace("Notification Configuration: [ STARTED ]"); } /** diff --git a/src/net/java/sip/communicator/plugin/notificationconfiguration/NotificationConfigurationPanel.java b/src/net/java/sip/communicator/plugin/notificationconfiguration/NotificationConfigurationPanel.java index 339d888..84544e5 100644 --- a/src/net/java/sip/communicator/plugin/notificationconfiguration/NotificationConfigurationPanel.java +++ b/src/net/java/sip/communicator/plugin/notificationconfiguration/NotificationConfigurationPanel.java @@ -420,7 +420,8 @@ public class NotificationConfigurationPanel NotificationsTableEntry tmpNTE = dataVector.elementAt(index); //This is where a real application would open the file. - logger.debug("Opening: " + if (logger.isDebugEnabled()) + logger.debug("Opening: " + file.toURI().toURL().toExternalForm()); tmpNTE.setSoundFile(file.toURI().toURL().toExternalForm()); tmpNTE.setSound(true); @@ -437,7 +438,8 @@ public class NotificationConfigurationPanel } else { - logger.debug("Open command cancelled by user."); + if (logger.isDebugEnabled()) + logger.debug("Open command cancelled by user."); } noListener = false; } @@ -451,7 +453,8 @@ public class NotificationConfigurationPanel NotificationsTableEntry tmpNTE = dataVector.elementAt(index); //This is where a real application would open the file. - logger.debug("Opening: " +file.getAbsolutePath()); + if (logger.isDebugEnabled()) + logger.debug("Opening: " +file.getAbsolutePath()); tmpNTE.setProgramFile(file.getAbsolutePath()); tmpNTE.setProgram(true); tmpNTE.setModify(true); @@ -461,7 +464,8 @@ public class NotificationConfigurationPanel } else { - logger.debug("Open command cancelled by user."); + if (logger.isDebugEnabled()) + logger.debug("Open command cancelled by user."); } noListener = false; } @@ -471,7 +475,8 @@ public class NotificationConfigurationPanel { String soundFile = soundFileTextField.getText(); - logger.debug("****"+soundFile+"****"+soundFile.length()); + if (logger.isDebugEnabled()) + logger.debug("****"+soundFile+"****"+soundFile.length()); if(soundFile.length() != 0) { AudioNotifierService audioNotifServ @@ -483,12 +488,14 @@ public class NotificationConfigurationPanel } else { - logger.debug("No file specified"); + if (logger.isDebugEnabled()) + logger.debug("No file specified"); } } else { - logger.debug("Its non-active"); + if (logger.isDebugEnabled()) + logger.debug("Its non-active"); } } else if(e.getSource() == turnOnAll) @@ -609,7 +616,8 @@ public class NotificationConfigurationPanel if(tmpNTE.isModified()) { - logger.debug("Event modify : "+tmpNTE.getEvent()); + if (logger.isDebugEnabled()) + logger.debug("Event modify : "+tmpNTE.getEvent()); notificationService.setActive(tmpNTE.getEvent(), tmpNTE.getEnabled()); @@ -620,14 +628,16 @@ public class NotificationConfigurationPanel NotificationService.ACTION_SOUND, tmpNTE.getSoundFile(), ""); - logger.debug("Adding Sound"); + if (logger.isDebugEnabled()) + logger.debug("Adding Sound"); } else { notificationService.removeEventNotificationAction( tmpNTE.getEvent(), NotificationService.ACTION_SOUND); - logger.debug("Deleting Sound"); + if (logger.isDebugEnabled()) + logger.debug("Deleting Sound"); } if(tmpNTE.getProgram() == true) @@ -637,14 +647,16 @@ public class NotificationConfigurationPanel NotificationService.ACTION_COMMAND, tmpNTE.getProgramFile(), ""); - logger.debug("Program"); + if (logger.isDebugEnabled()) + logger.debug("Program"); } else { notificationService.removeEventNotificationAction( tmpNTE.getEvent(), NotificationService.ACTION_COMMAND); - logger.debug("Deleting Program"); + if (logger.isDebugEnabled()) + logger.debug("Deleting Program"); } if(tmpNTE.getPopup()) @@ -654,14 +666,16 @@ public class NotificationConfigurationPanel NotificationService.ACTION_POPUP_MESSAGE, "", ""); - logger.debug("Popup"); + if (logger.isDebugEnabled()) + logger.debug("Popup"); } else { notificationService.removeEventNotificationAction( tmpNTE.getEvent(), NotificationService.ACTION_POPUP_MESSAGE); - logger.debug("Deleting Popup"); + if (logger.isDebugEnabled()) + logger.debug("Deleting Popup"); } tmpNTE.setModify(false); } @@ -788,7 +802,8 @@ public class NotificationConfigurationPanel */ public void actionAdded(NotificationActionTypeEvent event) { - logger.debug("Start action added"); + if (logger.isDebugEnabled()) + logger.debug("Start action added"); String eventName = event.getSourceEventType(); Iterator<NotificationsTableEntry> it = null; int row = 0; @@ -827,7 +842,8 @@ public class NotificationConfigurationPanel this.addRowAtVector(tmpNTE); notificationList.setRowSelectionInterval(0, 0); updatePanel(tmpNTE); - logger.debug("End action added"); + if (logger.isDebugEnabled()) + logger.debug("End action added"); return; } /* @@ -864,7 +880,8 @@ public class NotificationConfigurationPanel this.updateTableRow(tmpNTE,row); updatePanel(tmpNTE); notificationList.setRowSelectionInterval(row, row); - logger.debug("End action added"); + if (logger.isDebugEnabled()) + logger.debug("End action added"); return; } row ++; @@ -901,13 +918,15 @@ public class NotificationConfigurationPanel notificationList.getRowCount() - 1, notificationList.getRowCount() - 1); - logger.debug("End action added"); + if (logger.isDebugEnabled()) + logger.debug("End action added"); return; } public void actionRemoved(NotificationActionTypeEvent event) { - logger.debug("Start action remove"); + if (logger.isDebugEnabled()) + logger.debug("Start action remove"); String eventName = event.getSourceEventType(); Iterator<NotificationsTableEntry> it = null; NotificationsTableEntry tmpNTE = null; @@ -937,7 +956,8 @@ public class NotificationConfigurationPanel tmpNTE.setSound(false); tmpNTE.setSoundFile(""); } - logger.debug("End action remove"); + if (logger.isDebugEnabled()) + logger.debug("End action remove"); return; } } @@ -945,7 +965,8 @@ public class NotificationConfigurationPanel public void actionChanged(NotificationActionTypeEvent event) { - logger.debug("Start action changed"); + if (logger.isDebugEnabled()) + logger.debug("Start action changed"); String eventName = event.getSourceEventType(); Iterator<NotificationsTableEntry> it = null; int row = 0; @@ -970,7 +991,8 @@ public class NotificationConfigurationPanel .getActionHandler()).getDescriptor()); } this.updateTableRow(tmpNTE,row); - logger.debug("End action changed"); + if (logger.isDebugEnabled()) + logger.debug("End action changed"); return; } row ++; diff --git a/src/net/java/sip/communicator/plugin/otr/OtrActivator.java b/src/net/java/sip/communicator/plugin/otr/OtrActivator.java index 0a9441e..92c708a 100644 --- a/src/net/java/sip/communicator/plugin/otr/OtrActivator.java +++ b/src/net/java/sip/communicator/plugin/otr/OtrActivator.java @@ -117,7 +117,8 @@ public class OtrActivator if (protocolProviderRefs != null && protocolProviderRefs.length > 0) { - logger.debug("Found " + protocolProviderRefs.length + if (logger.isDebugEnabled()) + logger.debug("Found " + protocolProviderRefs.length + " already installed providers."); for (ServiceReference protocolProviderRef : protocolProviderRefs) { @@ -186,7 +187,8 @@ public class OtrActivator } else { - logger.trace("Service did not have a transform op. set."); + if (logger.isTraceEnabled()) + logger.trace("Service did not have a transform op. set."); } } @@ -262,17 +264,20 @@ public class OtrActivator Object sService = bundleContext.getService(serviceEvent.getServiceReference()); - logger.trace("Received a service event for: " + if (logger.isTraceEnabled()) + logger.trace("Received a service event for: " + sService.getClass().getName()); // we don't care if the source service is not a protocol provider if (!(sService instanceof ProtocolProviderService)) return; - logger.debug("Service is a protocol provider."); + if (logger.isDebugEnabled()) + logger.debug("Service is a protocol provider."); if (serviceEvent.getType() == ServiceEvent.REGISTERED) { - logger.debug("Handling registration of a new Protocol Provider."); + if (logger.isDebugEnabled()) + logger.debug("Handling registration of a new Protocol Provider."); this.handleProviderAdded((ProtocolProviderService) sService); } diff --git a/src/net/java/sip/communicator/plugin/profiler4j/ProfilerActivator.java b/src/net/java/sip/communicator/plugin/profiler4j/ProfilerActivator.java index 8003e8f..e8644f2 100644 --- a/src/net/java/sip/communicator/plugin/profiler4j/ProfilerActivator.java +++ b/src/net/java/sip/communicator/plugin/profiler4j/ProfilerActivator.java @@ -38,7 +38,8 @@ public class ProfilerActivator implements BundleActivator { menuRegistration = bc.registerService(PluginComponent.class .getName(), menuEntry, toolsMenuFilter); - logger.info("PROFILER4J [REGISTERED]"); + if (logger.isInfoEnabled()) + logger.info("PROFILER4J [REGISTERED]"); } @@ -46,7 +47,8 @@ public class ProfilerActivator implements BundleActivator { if (menuRegistration != null) { menuRegistration.unregister(); - logger.info("PROFILER4J [UNREGISTERED]"); + if (logger.isInfoEnabled()) + logger.info("PROFILER4J [UNREGISTERED]"); } } diff --git a/src/net/java/sip/communicator/plugin/reconnectplugin/ReconnectPluginActivator.java b/src/net/java/sip/communicator/plugin/reconnectplugin/ReconnectPluginActivator.java index bc9fbb4..78eabcc 100644 --- a/src/net/java/sip/communicator/plugin/reconnectplugin/ReconnectPluginActivator.java +++ b/src/net/java/sip/communicator/plugin/reconnectplugin/ReconnectPluginActivator.java @@ -190,7 +190,8 @@ public class ReconnectPluginActivator // in case we found any if (protocolProviderRefs != null) { - logger.debug("Found " + if (logger.isDebugEnabled()) + logger.debug("Found " + protocolProviderRefs.length + " already installed providers."); for (int i = 0; i < protocolProviderRefs.length; i++) @@ -324,7 +325,8 @@ public class ReconnectPluginActivator Object sService = bundleContext.getService(serviceRef); - logger.trace("Received a service event for: " + + if (logger.isTraceEnabled()) + logger.trace("Received a service event for: " + sService.getClass().getName()); if(sService instanceof NetworkAddressManagerService) @@ -353,7 +355,8 @@ public class ReconnectPluginActivator if (!(sService instanceof ProtocolProviderService)) return; - logger.debug("Service is a protocol provider."); + if (logger.isDebugEnabled()) + logger.debug("Service is a protocol provider."); switch (serviceEvent.getType()) { case ServiceEvent.REGISTERED: @@ -373,7 +376,8 @@ public class ReconnectPluginActivator */ private void handleProviderAdded(ProtocolProviderService provider) { - logger.trace("New protocol provider is comming " + if (logger.isTraceEnabled()) + logger.trace("New protocol provider is comming " + provider.getProtocolName()); provider.addRegistrationStateChangeListener(this); @@ -389,7 +393,8 @@ public class ReconnectPluginActivator */ private void handleProviderRemoved(ProtocolProviderService provider) { - logger.trace("Provider modified forget every instance of it"); + if (logger.isTraceEnabled()) + logger.trace("Provider modified forget every instance of it"); if(hasAtLeastOneSuccessfulConnection(provider)) { @@ -498,7 +503,8 @@ public class ReconnectPluginActivator connectedInterfaces.clear(); - logger.trace("Network is down!"); + if (logger.isTraceEnabled()) + logger.trace("Network is down!"); notify("", "plugin.reconnectplugin.NETWORK_DOWN", new String[0]); } } @@ -637,7 +643,8 @@ public class ReconnectPluginActivator task.delay = delay; currentlyReconnecting.put(pp, task); - logger.trace("Reconnect " + pp + " after " + delay + " ms."); + if (logger.isTraceEnabled()) + logger.trace("Reconnect " + pp + " after " + delay + " ms."); timer.schedule(task, delay); } @@ -673,7 +680,8 @@ public class ReconnectPluginActivator { try { - logger.trace("Start reconnecting!"); + if (logger.isTraceEnabled()) + logger.trace("Start reconnecting!"); provider.register( getUIService().getDefaultSecurityAuthority(provider)); diff --git a/src/net/java/sip/communicator/plugin/rssaccregwizz/RssAccRegWizzActivator.java b/src/net/java/sip/communicator/plugin/rssaccregwizz/RssAccRegWizzActivator.java index acdffe6..45752a6 100644 --- a/src/net/java/sip/communicator/plugin/rssaccregwizz/RssAccRegWizzActivator.java +++ b/src/net/java/sip/communicator/plugin/rssaccregwizz/RssAccRegWizzActivator.java @@ -38,7 +38,8 @@ public class RssAccRegWizzActivator */ public void start(BundleContext bc) { - logger.info("Loading rss account wizard."); + if (logger.isInfoEnabled()) + logger.info("Loading rss account wizard."); bundleContext = bc; @@ -65,7 +66,8 @@ public class RssAccRegWizzActivator rssWizard, containerFilter); - logger.info("RSS account registration wizard [STARTED]."); + if (logger.isInfoEnabled()) + logger.info("RSS account registration wizard [STARTED]."); } /** diff --git a/src/net/java/sip/communicator/plugin/simpleaccreg/InitialAccountRegistrationFrame.java b/src/net/java/sip/communicator/plugin/simpleaccreg/InitialAccountRegistrationFrame.java index 6046bf5..aa5dbaa 100644 --- a/src/net/java/sip/communicator/plugin/simpleaccreg/InitialAccountRegistrationFrame.java +++ b/src/net/java/sip/communicator/plugin/simpleaccreg/InitialAccountRegistrationFrame.java @@ -462,7 +462,8 @@ public class InitialAccountRegistrationFrame }
catch (OperationFailedException e)
{
- logger.debug("The sign in operation has failed.");
+ if (logger.isDebugEnabled()) + logger.debug("The sign in operation has failed.");
PopupDialog popupDialog
= SimpleAccountRegistrationActivator.getUIService()
diff --git a/src/net/java/sip/communicator/plugin/simpleaccreg/SimpleAccountRegistrationActivator.java b/src/net/java/sip/communicator/plugin/simpleaccreg/SimpleAccountRegistrationActivator.java index 1d5db47..b5e8f3a 100644 --- a/src/net/java/sip/communicator/plugin/simpleaccreg/SimpleAccountRegistrationActivator.java +++ b/src/net/java/sip/communicator/plugin/simpleaccreg/SimpleAccountRegistrationActivator.java @@ -49,7 +49,8 @@ public class SimpleAccountRegistrationActivator accountRegFrame.setVisible(true); } - logger.info("SIMPLE ACCOUNT REGISTRATION ...[STARTED]"); + if (logger.isInfoEnabled()) + logger.info("SIMPLE ACCOUNT REGISTRATION ...[STARTED]"); } public void stop(BundleContext bc) throws Exception diff --git a/src/net/java/sip/communicator/plugin/sshaccregwizz/SSHAccRegWizzActivator.java b/src/net/java/sip/communicator/plugin/sshaccregwizz/SSHAccRegWizzActivator.java index 70e05a0..18db2e0 100644 --- a/src/net/java/sip/communicator/plugin/sshaccregwizz/SSHAccRegWizzActivator.java +++ b/src/net/java/sip/communicator/plugin/sshaccregwizz/SSHAccRegWizzActivator.java @@ -48,7 +48,8 @@ public class SSHAccRegWizzActivator */ public void start(BundleContext bc) { - logger.info("Loading ssh account wizard."); + if (logger.isInfoEnabled()) + logger.info("Loading ssh account wizard."); bundleContext = bc; @@ -75,7 +76,8 @@ public class SSHAccRegWizzActivator sshWizard, containerFilter); - logger.info("SSH account registration wizard [STARTED]."); + if (logger.isInfoEnabled()) + logger.info("SSH account registration wizard [STARTED]."); } /** diff --git a/src/net/java/sip/communicator/plugin/updatechecker/Resources.java b/src/net/java/sip/communicator/plugin/updatechecker/Resources.java index 5261ad0..31db17b 100644 --- a/src/net/java/sip/communicator/plugin/updatechecker/Resources.java +++ b/src/net/java/sip/communicator/plugin/updatechecker/Resources.java @@ -38,7 +38,8 @@ public class Resources File configPropsFile = new File(CONFIG_PROP_FILE_NAME); if (!configPropsFile.exists()) { - logger.info("No config file specified for update checker. Disabling update checks"); + if (logger.isInfoEnabled()) + logger.info("No config file specified for update checker. Disabling update checks"); return null; } @@ -51,7 +52,8 @@ public class Resources catch (IOException ex) { logger.error("Could not open config file."); - logger.debug("Error was: " + ex); + if (logger.isDebugEnabled()) + logger.debug("Error was: " + ex); return null; } finally diff --git a/src/net/java/sip/communicator/plugin/updatechecker/UpdateCheckActivator.java b/src/net/java/sip/communicator/plugin/updatechecker/UpdateCheckActivator.java index 4bad83a..994e719 100644 --- a/src/net/java/sip/communicator/plugin/updatechecker/UpdateCheckActivator.java +++ b/src/net/java/sip/communicator/plugin/updatechecker/UpdateCheckActivator.java @@ -237,7 +237,8 @@ public class UpdateCheckActivator if(configString == null) { - logger.debug("Updates are disabled. Faking latest version."); + if (logger.isDebugEnabled()) + logger.debug("Updates are disabled. Faking latest version."); return true; } @@ -261,7 +262,8 @@ public class UpdateCheckActivator catch (Exception e) { logger.warn("Cannot get and compare versions!"); - logger.debug("Error was: ", e); + if (logger.isDebugEnabled()) + logger.debug("Error was: ", e); // if we get an exception this mean we were unable to compare versions // will return that current is newest to prevent opening info dialog // about new version @@ -517,7 +519,8 @@ public class UpdateCheckActivator } catch (Exception e) { - logger.info("Error starting update process!", e); + if (logger.isInfoEnabled()) + logger.info("Error starting update process!", e); tempF.delete(); } } diff --git a/src/net/java/sip/communicator/plugin/whiteboard/WhiteboardActivator.java b/src/net/java/sip/communicator/plugin/whiteboard/WhiteboardActivator.java index bc45d91..23630d2 100644 --- a/src/net/java/sip/communicator/plugin/whiteboard/WhiteboardActivator.java +++ b/src/net/java/sip/communicator/plugin/whiteboard/WhiteboardActivator.java @@ -53,7 +53,8 @@ public class WhiteboardActivator implements BundleActivator whiteboardPlugin, containerFilter); - logger.info("WHITEBOARD... [REGISTERED]"); + if (logger.isInfoEnabled()) + logger.info("WHITEBOARD... [REGISTERED]"); } /** diff --git a/src/net/java/sip/communicator/plugin/whiteboard/WhiteboardSessionManager.java b/src/net/java/sip/communicator/plugin/whiteboard/WhiteboardSessionManager.java index aa6c0a6..598a398 100644 --- a/src/net/java/sip/communicator/plugin/whiteboard/WhiteboardSessionManager.java +++ b/src/net/java/sip/communicator/plugin/whiteboard/WhiteboardSessionManager.java @@ -66,7 +66,8 @@ public class WhiteboardSessionManager if (opSetWb == null) { - logger.info("Contact does not support whiteboarding"); + if (logger.isInfoEnabled()) + logger.info("Contact does not support whiteboarding"); return; } @@ -340,7 +341,8 @@ public class WhiteboardSessionManager if(wbFrame == null) { - logger.debug ("New WBParticipant" + if (logger.isDebugEnabled()) + logger.debug ("New WBParticipant" + evt.getSourceContact ().getDisplayName ()); wbFrame = new WhiteboardFrame ( @@ -365,7 +367,8 @@ public class WhiteboardSessionManager */ public void whiteboardObjectDelivered (WhiteboardObjectDeliveredEvent evt) { - logger.debug ("WBObjectDeliveredEvent: The following object: " + if (logger.isDebugEnabled()) + logger.debug ("WBObjectDeliveredEvent: The following object: " + evt.getSourceWhiteboardObject() + " has been delivered to " + evt.getDestinationContact().getDisplayName()); @@ -423,7 +426,8 @@ public class WhiteboardSessionManager + " because of the following error: " + errorMessage; - logger.debug (debugErrorMessage); + if (logger.isDebugEnabled()) + logger.debug (debugErrorMessage); WhiteboardActivator.getUiService().getPopupDialog() .showMessagePopupDialog(errorMessage, diff --git a/src/net/java/sip/communicator/plugin/whiteboard/gui/WhiteboardFrame.java b/src/net/java/sip/communicator/plugin/whiteboard/gui/WhiteboardFrame.java index 785e4a3..f38a6fa 100644 --- a/src/net/java/sip/communicator/plugin/whiteboard/gui/WhiteboardFrame.java +++ b/src/net/java/sip/communicator/plugin/whiteboard/gui/WhiteboardFrame.java @@ -1738,7 +1738,8 @@ public class WhiteboardFrame */ private void polyOperation(MouseEvent e) { - logger.debug("[log] : polyOperation"); + if (logger.isDebugEnabled()) + logger.debug("[log] : polyOperation"); Graphics g = drawCanvas.getGraphics(); g.setColor(currentColor); @@ -2119,7 +2120,8 @@ public class WhiteboardFrame */ private void releasedPolyline(boolean fill) { - logger.debug("[log] : releasedPolyline"); + if (logger.isDebugEnabled()) + logger.debug("[log] : releasedPolyline"); doneDrawing = true; appendAndSend(new WhiteboardShapePolyLine(id(), spinModel.getNumber() .intValue(), currentColor, pathList, fill, s2w)); @@ -2232,7 +2234,8 @@ public class WhiteboardFrame } catch (NoninvertibleTransformException e) { - logger.debug(e.getMessage()); + if (logger.isDebugEnabled()) + logger.debug(e.getMessage()); } repaint(); } @@ -2314,7 +2317,8 @@ public class WhiteboardFrame */ public void receiveWhiteboardObject(WhiteboardObject wbo) { - logger.debug("receiveWhiteboardObject: " + wbo.getID()); + if (logger.isDebugEnabled()) + logger.debug("receiveWhiteboardObject: " + wbo.getID()); WhiteboardShape ws = createWhiteboardShape(wbo); for (int i = 0; i < displayList.size(); i++) { @@ -2337,7 +2341,8 @@ public class WhiteboardFrame */ public void receiveDeleteWhiteboardObject(String id) { - logger.debug("receiveDeleteWhiteboardObject"); + if (logger.isDebugEnabled()) + logger.debug("receiveDeleteWhiteboardObject"); int i = 0; while (i < displayList.size()) { @@ -2359,7 +2364,8 @@ public class WhiteboardFrame */ private WhiteboardShape createWhiteboardShape(WhiteboardObject wbo) { - logger.debug("CreateWhiteboardShape"); + if (logger.isDebugEnabled()) + logger.debug("CreateWhiteboardShape"); WhiteboardShape wShape = null; String id = wbo.getID(); int color = wbo.getColor(); @@ -2368,7 +2374,8 @@ public class WhiteboardFrame if (wbo instanceof WhiteboardObjectPath) { WhiteboardObjectPath path = (WhiteboardObjectPath) wbo; - logger.debug("[log] : WB_PATH"); + if (logger.isDebugEnabled()) + logger.debug("[log] : WB_PATH"); Color c = Color.getColor("", color); List<WhiteboardPoint> points = path.getPoints(); wShape = new WhiteboardShapePath(id, t, c, points); @@ -2376,7 +2383,8 @@ public class WhiteboardFrame else if (wbo instanceof WhiteboardObjectPolyLine) { WhiteboardObjectPolyLine pLine = (WhiteboardObjectPolyLine) wbo; - logger.debug("[log] : WB_POLYLINE"); + if (logger.isDebugEnabled()) + logger.debug("[log] : WB_POLYLINE"); Color c = Color.getColor("", color); List<WhiteboardPoint> points = pLine.getPoints(); wShape = new WhiteboardShapePolyLine(id, t, c, points, false); @@ -2385,7 +2393,8 @@ public class WhiteboardFrame else if (wbo instanceof WhiteboardObjectPolygon) { WhiteboardObjectPolygon polygon = (WhiteboardObjectPolygon) wbo; - logger.debug("[log] : WB_POLYGON"); + if (logger.isDebugEnabled()) + logger.debug("[log] : WB_POLYGON"); Color c = Color.getColor("", color); List<WhiteboardPoint> points = polygon.getPoints(); boolean fill = polygon.isFill(); @@ -2395,7 +2404,8 @@ public class WhiteboardFrame else if (wbo instanceof WhiteboardObjectLine) { WhiteboardObjectLine line = (WhiteboardObjectLine) wbo; - logger.debug("[log] : WB_LINE"); + if (logger.isDebugEnabled()) + logger.debug("[log] : WB_LINE"); WhiteboardPoint pStart = line.getWhiteboardPointStart(); WhiteboardPoint pEnd = line.getWhiteboardPointEnd(); Color c = Color.getColor("", color); @@ -2405,7 +2415,8 @@ public class WhiteboardFrame else if (wbo instanceof WhiteboardObjectRect) { WhiteboardObjectRect rect = (WhiteboardObjectRect) wbo; - logger.debug("[log] : WB_RECT"); + if (logger.isDebugEnabled()) + logger.debug("[log] : WB_RECT"); Color c = Color.getColor("", color); double height, width; WhiteboardPoint p = rect.getWhiteboardPoint(); @@ -2418,7 +2429,8 @@ public class WhiteboardFrame else if (wbo instanceof WhiteboardObjectCircle) { WhiteboardObjectCircle circle = (WhiteboardObjectCircle) wbo; - logger.debug("[log] : WB_CIRCLE"); + if (logger.isDebugEnabled()) + logger.debug("[log] : WB_CIRCLE"); Color c = Color.getColor("", color); WhiteboardPoint p = circle.getWhiteboardPoint(); double r = circle.getRadius(); @@ -2429,7 +2441,8 @@ public class WhiteboardFrame else if (wbo instanceof WhiteboardObjectText) { WhiteboardObjectText text = (WhiteboardObjectText) wbo; - logger.debug("[log] : WB_TEXT"); + if (logger.isDebugEnabled()) + logger.debug("[log] : WB_TEXT"); Color c = Color.getColor("", color); WhiteboardPoint p = text.getWhiteboardPoint(); int size = text.getFontSize(); @@ -2440,7 +2453,8 @@ public class WhiteboardFrame else if (wbo instanceof WhiteboardObjectImage) { WhiteboardObjectImage img = (WhiteboardObjectImage) wbo; - logger.debug("[log] : WB_IMAGE"); + if (logger.isDebugEnabled()) + logger.debug("[log] : WB_IMAGE"); double height, width; WhiteboardPoint p = img.getWhiteboardPoint(); width = img.getWidth(); @@ -2561,7 +2575,8 @@ public class WhiteboardFrame public void whiteboardParticipantRemoved(WhiteboardParticipantEvent evt) { - logger.trace("Whiteboard participant has left."); + if (logger.isTraceEnabled()) + logger.trace("Whiteboard participant has left."); WhiteboardActivator.getUiService().getPopupDialog() .showMessagePopupDialog(contact.getAddress() diff --git a/src/net/java/sip/communicator/plugin/zeroconfaccregwizz/ZeroconfAccRegWizzActivator.java b/src/net/java/sip/communicator/plugin/zeroconfaccregwizz/ZeroconfAccRegWizzActivator.java index 17c7058..ebf6378 100644 --- a/src/net/java/sip/communicator/plugin/zeroconfaccregwizz/ZeroconfAccRegWizzActivator.java +++ b/src/net/java/sip/communicator/plugin/zeroconfaccregwizz/ZeroconfAccRegWizzActivator.java @@ -38,7 +38,8 @@ public class ZeroconfAccRegWizzActivator */ public void start(BundleContext bc) { - logger.info("Loading zeroconf account wizard."); + if (logger.isInfoEnabled()) + logger.info("Loading zeroconf account wizard."); bundleContext = bc; @@ -65,7 +66,8 @@ public class ZeroconfAccRegWizzActivator zeroconfWizard, containerFilter); - logger.info("Zeroconf account registration wizard [STARTED]."); + if (logger.isInfoEnabled()) + logger.info("Zeroconf account registration wizard [STARTED]."); } /** diff --git a/src/net/java/sip/communicator/service/protocol/AbstractCallPeer.java b/src/net/java/sip/communicator/service/protocol/AbstractCallPeer.java index 80ee2d7..849c8c6 100644 --- a/src/net/java/sip/communicator/service/protocol/AbstractCallPeer.java +++ b/src/net/java/sip/communicator/service/protocol/AbstractCallPeer.java @@ -195,7 +195,8 @@ public abstract class AbstractCallPeer CallPeerChangeEvent evt = new CallPeerChangeEvent( this, eventType, oldValue, newValue, reason); - logger.debug("Dispatching a CallPeerChangeEvent event to " + if (logger.isDebugEnabled()) + logger.debug("Dispatching a CallPeerChangeEvent event to " + callPeerListeners.size() +" listeners. event is: " + evt.toString()); @@ -248,7 +249,8 @@ public abstract class AbstractCallPeer = new CallPeerSecurityOnEvent( this, sessionType, cipher, securityString, isVerified); - logger.debug("Dispatching a CallPeerSecurityStatusEvent event to " + if (logger.isDebugEnabled()) + logger.debug("Dispatching a CallPeerSecurityStatusEvent event to " + callPeerSecurityListeners.size() +" listeners. event is: " + evt.toString()); @@ -279,7 +281,8 @@ public abstract class AbstractCallPeer CallPeerSecurityOffEvent event = new CallPeerSecurityOffEvent( this, sessionType); - logger.debug( + if (logger.isDebugEnabled()) + logger.debug( "Dispatching a CallPeerSecurityAuthenticationEvent event to " + callPeerSecurityListeners.size() +" listeners. event is: " + event.toString()); @@ -319,7 +322,8 @@ public abstract class AbstractCallPeer i18nMessage, severity); - logger.debug("Dispatching a CallPeerSecurityFailedEvent event to " + if (logger.isDebugEnabled()) + logger.debug("Dispatching a CallPeerSecurityFailedEvent event to " + callPeerSecurityListeners.size() +" listeners. event is: " + evt.toString()); diff --git a/src/net/java/sip/communicator/service/protocol/AbstractFileTransfer.java b/src/net/java/sip/communicator/service/protocol/AbstractFileTransfer.java index 79e9e28..eea2f30 100644 --- a/src/net/java/sip/communicator/service/protocol/AbstractFileTransfer.java +++ b/src/net/java/sip/communicator/service/protocol/AbstractFileTransfer.java @@ -154,7 +154,8 @@ public abstract class AbstractFileTransfer = new ArrayList<FileTransferStatusListener>(statusListeners); } - logger.debug("Dispatching a FileTransfer Event to" + listeners.size() + if (logger.isDebugEnabled()) + logger.debug("Dispatching a FileTransfer Event to" + listeners.size() + " listeners. Status=" + status); FileTransferStatusChangeEvent statusEvent diff --git a/src/net/java/sip/communicator/service/protocol/AbstractOperationSetBasicInstantMessaging.java b/src/net/java/sip/communicator/service/protocol/AbstractOperationSetBasicInstantMessaging.java index 50c0fc3..4150325 100644 --- a/src/net/java/sip/communicator/service/protocol/AbstractOperationSetBasicInstantMessaging.java +++ b/src/net/java/sip/communicator/service/protocol/AbstractOperationSetBasicInstantMessaging.java @@ -149,7 +149,8 @@ public abstract class AbstractOperationSetBasicInstantMessaging listeners = new ArrayList<MessageListener>(this.messageListeners); } - logger.debug("Dispatching Message Listeners=" + listeners.size() + if (logger.isDebugEnabled()) + logger.debug("Dispatching Message Listeners=" + listeners.size() + " evt=" + evt); /* diff --git a/src/net/java/sip/communicator/service/protocol/AbstractOperationSetBasicTelephony.java b/src/net/java/sip/communicator/service/protocol/AbstractOperationSetBasicTelephony.java index 307ffd1..898f349 100644 --- a/src/net/java/sip/communicator/service/protocol/AbstractOperationSetBasicTelephony.java +++ b/src/net/java/sip/communicator/service/protocol/AbstractOperationSetBasicTelephony.java @@ -65,7 +65,8 @@ public abstract class AbstractOperationSetBasicTelephony listeners = new ArrayList<CallListener>(callListeners); } - logger.debug("Dispatching a CallEvent to " + listeners.size() + if (logger.isDebugEnabled()) + logger.debug("Dispatching a CallEvent to " + listeners.size() + " listeners. event is: " + cEvent); for (Iterator<CallListener> listenerIter diff --git a/src/net/java/sip/communicator/service/protocol/AbstractOperationSetPersistentPresence.java b/src/net/java/sip/communicator/service/protocol/AbstractOperationSetPersistentPresence.java index 4b5595f..f52fbc4 100644 --- a/src/net/java/sip/communicator/service/protocol/AbstractOperationSetPersistentPresence.java +++ b/src/net/java/sip/communicator/service/protocol/AbstractOperationSetPersistentPresence.java @@ -143,7 +143,8 @@ public abstract class AbstractOperationSetPersistentPresence<T extends ProtocolP PresenceStatus newValue = source.getPresenceStatus(); if (oldValue.equals(newValue)) { - logger.debug("Ignored prov stat. change evt. old==new = " + if (logger.isDebugEnabled()) + logger.debug("Ignored prov stat. change evt. old==new = " + oldValue); return; } @@ -176,7 +177,8 @@ public abstract class AbstractOperationSetPersistentPresence<T extends ProtocolP contactPresenceStatusListeners); } - logger.debug( + if (logger.isDebugEnabled()) + logger.debug( "Dispatching Contact Status Change. Listeners=" + listeners.size() + " evt=" + evt); @@ -213,7 +215,8 @@ public abstract class AbstractOperationSetPersistentPresence<T extends ProtocolP = new ArrayList<SubscriptionListener>(subscriptionListeners); } - logger.debug("Dispatching a Contact Property Change Event to" + if (logger.isDebugEnabled()) + logger.debug("Dispatching a Contact Property Change Event to" + listeners.size() + " listeners. Evt=" + evt); for (SubscriptionListener listener : listeners) @@ -257,7 +260,8 @@ public abstract class AbstractOperationSetPersistentPresence<T extends ProtocolP providerPresenceStatusListeners); } - logger.debug( + if (logger.isDebugEnabled()) + logger.debug( "Dispatching Provider Status Change. Listeners=" + listeners.size() + " evt=" + evt); @@ -265,7 +269,8 @@ public abstract class AbstractOperationSetPersistentPresence<T extends ProtocolP for (ProviderPresenceStatusListener listener : listeners) listener.providerStatusChanged(evt); - logger.debug("status dispatching done."); + if (logger.isDebugEnabled()) + logger.debug("status dispatching done."); } /** @@ -296,7 +301,8 @@ public abstract class AbstractOperationSetPersistentPresence<T extends ProtocolP providerPresenceStatusListeners); } - logger.debug( + if (logger.isDebugEnabled()) + logger.debug( "Dispatching stat. msg change. Listeners=" + listeners.size() + " evt=" + evt); @@ -379,7 +385,8 @@ public abstract class AbstractOperationSetPersistentPresence<T extends ProtocolP new ArrayList<SubscriptionListener>(subscriptionListeners); } - logger.debug("Dispatching a Subscription Event to" + listeners.size() + if (logger.isDebugEnabled()) + logger.debug("Dispatching a Subscription Event to" + listeners.size() + " listeners. Evt=" + evt); for (SubscriptionListener listener : listeners) @@ -422,7 +429,8 @@ public abstract class AbstractOperationSetPersistentPresence<T extends ProtocolP = new ArrayList<SubscriptionListener>(subscriptionListeners); } - logger.debug("Dispatching a Subscription Event to" + listeners.size() + if (logger.isDebugEnabled()) + logger.debug("Dispatching a Subscription Event to" + listeners.size() + " listeners. Evt=" + evt); for (SubscriptionListener listener : listeners) diff --git a/src/net/java/sip/communicator/service/protocol/AbstractOperationSetTypingNotifications.java b/src/net/java/sip/communicator/service/protocol/AbstractOperationSetTypingNotifications.java index f8043de..dbfb96d 100644 --- a/src/net/java/sip/communicator/service/protocol/AbstractOperationSetTypingNotifications.java +++ b/src/net/java/sip/communicator/service/protocol/AbstractOperationSetTypingNotifications.java @@ -110,7 +110,8 @@ public abstract class AbstractOperationSetTypingNotifications<T extends Protocol typingNotificationsListeners.size()]); } - logger.debug( + if (logger.isDebugEnabled()) + logger.debug( "Dispatching a TypingNotificationEvent to " + listeners.length + " listeners. Contact " diff --git a/src/net/java/sip/communicator/service/protocol/AbstractProtocolProviderService.java b/src/net/java/sip/communicator/service/protocol/AbstractProtocolProviderService.java index 96b08fa..fd59179 100644 --- a/src/net/java/sip/communicator/service/protocol/AbstractProtocolProviderService.java +++ b/src/net/java/sip/communicator/service/protocol/AbstractProtocolProviderService.java @@ -158,7 +158,8 @@ public abstract class AbstractProtocolProviderService throwable); } - logger.trace("Done."); + if (logger.isTraceEnabled()) + logger.trace("Done."); } /** diff --git a/src/net/java/sip/communicator/service/protocol/Call.java b/src/net/java/sip/communicator/service/protocol/Call.java index b438a41..d7e71c1 100644 --- a/src/net/java/sip/communicator/service/protocol/Call.java +++ b/src/net/java/sip/communicator/service/protocol/Call.java @@ -189,7 +189,8 @@ public abstract class Call CallPeerEvent cpEvent = new CallPeerEvent( sourceCallPeer, this, eventID); - logger.debug("Dispatching a CallPeer event to " + if (logger.isDebugEnabled()) + logger.debug("Dispatching a CallPeer event to " + callListeners.size() +" listeners. event is: " + cpEvent.toString()); @@ -242,7 +243,8 @@ public abstract class Call CallChangeEvent ccEvent = new CallChangeEvent( this, type, oldValue, newValue); - logger.debug("Dispatching a CallChange event to " + if (logger.isDebugEnabled()) + logger.debug("Dispatching a CallChange event to " + callListeners.size() +" listeners. event is: " + ccEvent.toString()); diff --git a/src/net/java/sip/communicator/service/protocol/ProtocolProviderFactory.java b/src/net/java/sip/communicator/service/protocol/ProtocolProviderFactory.java index a988784..0190302 100644 --- a/src/net/java/sip/communicator/service/protocol/ProtocolProviderFactory.java +++ b/src/net/java/sip/communicator/service/protocol/ProtocolProviderFactory.java @@ -783,7 +783,8 @@ public abstract class ProtocolProviderFactory */ public void stop() { - logger.trace("Preparing to stop all protocol providers of" + this); + if (logger.isTraceEnabled()) + logger.trace("Preparing to stop all protocol providers of" + this); synchronized (registeredAccounts) { diff --git a/src/net/java/sip/communicator/util/FileUtils.java b/src/net/java/sip/communicator/util/FileUtils.java index 1e1220c..382c1c4 100644 --- a/src/net/java/sip/communicator/util/FileUtils.java +++ b/src/net/java/sip/communicator/util/FileUtils.java @@ -68,7 +68,8 @@ public class FileUtils } catch (Exception e) { - logger.debug("Failed to obtain file icon from ShellFolder.", e); + if (logger.isDebugEnabled()) + logger.debug("Failed to obtain file icon from ShellFolder.", e); /* try with another method to obtain file icon */ try @@ -77,7 +78,8 @@ public class FileUtils } catch (Exception e1) { - logger.debug("Failed to obtain file icon from JFileChooser.", e1); + if (logger.isDebugEnabled()) + logger.debug("Failed to obtain file icon from JFileChooser.", e1); } } diff --git a/src/net/java/sip/communicator/util/Html2Text.java b/src/net/java/sip/communicator/util/Html2Text.java index 0cef33b..72c6cdc 100644 --- a/src/net/java/sip/communicator/util/Html2Text.java +++ b/src/net/java/sip/communicator/util/Html2Text.java @@ -52,7 +52,8 @@ public class Html2Text } catch (Exception exc) { - logger.info("Failed to extract plain text from html="+html, exc); + if (logger.isInfoEnabled()) + logger.info("Failed to extract plain text from html="+html, exc); return html; } } diff --git a/src/net/java/sip/communicator/util/ImageUtils.java b/src/net/java/sip/communicator/util/ImageUtils.java index abf661e..9b7d7d0 100644 --- a/src/net/java/sip/communicator/util/ImageUtils.java +++ b/src/net/java/sip/communicator/util/ImageUtils.java @@ -154,7 +154,8 @@ public class ImageUtils } catch (IOException e) { - logger.debug("Could not scale image in bytes.", e); + if (logger.isDebugEnabled()) + logger.debug("Could not scale image in bytes.", e); } } @@ -221,11 +222,13 @@ public class ImageUtils if(image != null) imageIcon = getScaledRoundedIcon(image, width, height); else - logger.trace("Unknown image format or error reading image"); + if (logger.isTraceEnabled()) + logger.trace("Unknown image format or error reading image"); } catch (Exception e) { - logger.debug("Could not create image.", e); + if (logger.isDebugEnabled()) + logger.debug("Could not create image.", e); } return imageIcon; @@ -250,7 +253,8 @@ public class ImageUtils } catch (IOException ex) { - logger.debug("Failed to load image:" + imagePath, ex); + if (logger.isDebugEnabled()) + logger.debug("Failed to load image:" + imagePath, ex); } } return image; diff --git a/src/net/java/sip/communicator/util/Logger.java b/src/net/java/sip/communicator/util/Logger.java index bc92ddc..f4c155d 100644 --- a/src/net/java/sip/communicator/util/Logger.java +++ b/src/net/java/sip/communicator/util/Logger.java @@ -16,6 +16,10 @@ import java.util.logging.*; public class Logger { private final java.util.logging.Logger loggerDelegate; + + static private long trc = 0; + static private long dbg = 0; + static private long inf = 0; /** * Base constructor @@ -115,6 +119,7 @@ public class Logger */ public void trace(Object msg) { + if ((++trc % 10) == 0) System.out.println("Trace: " + trc); loggerDelegate.finer(msg!=null?msg.toString():"null"); } @@ -126,6 +131,7 @@ public class Logger */ public void trace(Object msg, Throwable t) { + if ((++trc % 10) == 0) System.out.println("Trace: " + trc); loggerDelegate.log(Level.FINER, msg!=null?msg.toString():"null", t); } @@ -151,6 +157,7 @@ public class Logger */ public void debug(Object msg) { + if ((++dbg % 10) == 0) System.out.println("Debug: " + dbg); loggerDelegate.fine(msg!=null?msg.toString():"null"); } @@ -162,6 +169,7 @@ public class Logger */ public void debug(Object msg, Throwable t) { + if ((++dbg % 10) == 0) System.out.println("Debug: " + dbg); loggerDelegate.log(Level.FINE, msg!=null?msg.toString():"null", t); } @@ -187,6 +195,7 @@ public class Logger */ public void info(Object msg) { + if ((++inf % 10) == 0) System.out.println("Info: " + inf); loggerDelegate.info(msg!=null?msg.toString():"null"); } @@ -198,6 +207,7 @@ public class Logger */ public void info(Object msg, Throwable t) { + if ((++inf % 10) == 0) System.out.println("Info: " + inf); loggerDelegate.log(Level.INFO, msg!=null?msg.toString():"null", t); } diff --git a/src/net/java/sip/communicator/util/NetworkUtils.java b/src/net/java/sip/communicator/util/NetworkUtils.java index db7abd5..9b86fd2 100644 --- a/src/net/java/sip/communicator/util/NetworkUtils.java +++ b/src/net/java/sip/communicator/util/NetworkUtils.java @@ -301,7 +301,8 @@ public class NetworkUtils logger.trace("DNS SRV query for domain " + domain + " returned:"); for (int i = 0; i < sortedHostNames.length; i++) { - logger.trace(sortedHostNames[i]); + if (logger.isTraceEnabled()) + logger.trace(sortedHostNames[i]); } } return sortedHostNames; @@ -425,7 +426,8 @@ public class NetworkUtils } catch (SocketException e) { - logger.debug("Couldn't retrieve local interfaces.", e); + if (logger.isDebugEnabled()) + logger.debug("Couldn't retrieve local interfaces.", e); return IN4_ADDR_ANY; } diff --git a/src/net/java/sip/communicator/util/UtilActivator.java b/src/net/java/sip/communicator/util/UtilActivator.java index 8e49c5b..855d769 100644 --- a/src/net/java/sip/communicator/util/UtilActivator.java +++ b/src/net/java/sip/communicator/util/UtilActivator.java @@ -53,7 +53,8 @@ public class UtilActivator public void start(BundleContext context) throws Exception { - logger.trace("Setting default uncaught exception handler."); + if (logger.isTraceEnabled()) + logger.trace("Setting default uncaught exception handler."); bundleContext = context; diff --git a/src/net/java/sip/communicator/util/launchutils/ArgDelegator.java b/src/net/java/sip/communicator/util/launchutils/ArgDelegator.java index 2d687b9..297de89 100644 --- a/src/net/java/sip/communicator/util/launchutils/ArgDelegator.java +++ b/src/net/java/sip/communicator/util/launchutils/ArgDelegator.java @@ -69,13 +69,15 @@ class ArgDelegator { synchronized(recordedArgs) { - logger.trace("Someone set a delegationPeer. " + if (logger.isTraceEnabled()) + logger.trace("Someone set a delegationPeer. " +"Will dispatch "+ recordedArgs.size() +" args"); this.uriDelegationPeer = delegationPeer; for (String arg : recordedArgs) { - logger.trace("Dispatching arg: " + arg); + if (logger.isTraceEnabled()) + logger.trace("Dispatching arg: " + arg); uriDelegationPeer.handleUri(arg); } diff --git a/src/net/java/sip/communicator/util/launchutils/LaunchArgHandler.java b/src/net/java/sip/communicator/util/launchutils/LaunchArgHandler.java index 694a4c1..1e6f35e 100644 --- a/src/net/java/sip/communicator/util/launchutils/LaunchArgHandler.java +++ b/src/net/java/sip/communicator/util/launchutils/LaunchArgHandler.java @@ -151,7 +151,8 @@ public class LaunchArgHandler } if (!versionPropertiesAreLoaded) { - logger.trace("Couldn't open version.properties"); + if (logger.isTraceEnabled()) + logger.trace("Couldn't open version.properties"); } // Start url handler for Mac OS X. @@ -191,7 +192,8 @@ public class LaunchArgHandler for(int i = 0; i < args.length; i++) { - logger.trace("handling arg " + i); + if (logger.isTraceEnabled()) + logger.trace("handling arg " + i); if (args[i].equals("--version") || args[i].equals("-v")) { @@ -295,7 +297,8 @@ public class LaunchArgHandler */ private void handleUri(String uri) { - logger.trace("Handling uri "+ uri); + if (logger.isTraceEnabled()) + logger.trace("Handling uri "+ uri); argDelegator.handleUri(uri); } diff --git a/src/net/java/sip/communicator/util/launchutils/SipCommunicatorLock.java b/src/net/java/sip/communicator/util/launchutils/SipCommunicatorLock.java index db7672c..ea8a6d4 100644 --- a/src/net/java/sip/communicator/util/launchutils/SipCommunicatorLock.java +++ b/src/net/java/sip/communicator/util/launchutils/SipCommunicatorLock.java @@ -522,7 +522,8 @@ public class SipCommunicatorLock extends Thread .substring((ARG_COUNT + "=").length()); int serverReadArgCount = Integer.parseInt(serverReadArgCountStr); - logger.debug("Server read " + serverReadArgCount + " args."); + if (logger.isDebugEnabled()) + logger.debug("Server read " + serverReadArgCount + " args."); if(serverReadArgCount != args.length) return LOCK_ERROR; @@ -534,7 +535,8 @@ public class SipCommunicatorLock extends Thread //catch IOExceptions, NPEs and NumberFormatExceptions here. catch (Exception e) { - logger.debug("Failed to connect to a running sc instance."); + if (logger.isDebugEnabled()) + logger.debug("Failed to connect to a running sc instance."); return LOCK_ERROR; } @@ -595,7 +597,8 @@ public class SipCommunicatorLock extends Thread wait(runDuration); } - logger.debug("Done waiting. Will close socket"); + if (logger.isDebugEnabled()) + logger.debug("Done waiting. Will close socket"); interInstanceSocket.close(); } catch (Exception exception) @@ -619,7 +622,8 @@ public class SipCommunicatorLock extends Thread //we only need to read a single line and then bail out. message = lineReader.readLine(); - logger.debug("Message is " + message); + if (logger.isDebugEnabled()) + logger.debug("Message is " + message); synchronized(this) { notifyAll(); @@ -629,7 +633,8 @@ public class SipCommunicatorLock extends Thread { // does not necessarily mean something is wrong. Could be // that we got tired of waiting and want to quit. - logger.info("An IOException is thrown while reading sock", exc); + if (logger.isInfoEnabled()) + logger.info("An IOException is thrown while reading sock", exc); } } } @@ -729,7 +734,8 @@ public class SipCommunicatorLock extends Thread ArrayList<String> argsList = new ArrayList<String>(); - logger.debug("Handling incoming connection"); + if (logger.isDebugEnabled()) + logger.debug("Handling incoming connection"); int argCount = 1024; try @@ -741,7 +747,8 @@ public class SipCommunicatorLock extends Thread { String line = lineReader.readLine(); - logger.debug(line); + if (logger.isDebugEnabled()) + logger.debug(line); if (line.startsWith(ARG_COUNT)) { @@ -776,7 +783,8 @@ public class SipCommunicatorLock extends Thread } catch (IOException exc) { - logger.info("An IOException is thrown while " + if (logger.isInfoEnabled()) + logger.info("An IOException is thrown while " + "processing remote args", exc); printer.print(ERROR_ARG + "=" + exc.getMessage()); diff --git a/src/net/java/sip/communicator/util/swing/FileDragLabel.java b/src/net/java/sip/communicator/util/swing/FileDragLabel.java index ac06292..cdbde0c 100644 --- a/src/net/java/sip/communicator/util/swing/FileDragLabel.java +++ b/src/net/java/sip/communicator/util/swing/FileDragLabel.java @@ -88,7 +88,8 @@ public class FileDragLabel } catch (Exception ex) { - logger.debug("Unable to drop label.", ex); + if (logger.isDebugEnabled()) + logger.debug("Unable to drop label.", ex); event.rejectDrop(); } } |