diff options
author | Werner Dittmann <wernerd@java.net> | 2010-06-03 08:05:30 +0000 |
---|---|---|
committer | Werner Dittmann <wernerd@java.net> | 2010-06-03 08:05:30 +0000 |
commit | cad7b07e9886cf47de6fa4575ef509003cd216c2 (patch) | |
tree | d433aefa82e898dbd8aa2a7999d252ac01e5506d /src/net/java/sip/communicator/impl | |
parent | 5b052b9bd44a503cc3f42d6e2646e270db3211ac (diff) | |
download | jitsi-cad7b07e9886cf47de6fa4575ef509003cd216c2.zip jitsi-cad7b07e9886cf47de6fa4575ef509003cd216c2.tar.gz jitsi-cad7b07e9886cf47de6fa4575ef509003cd216c2.tar.bz2 |
Fix logger usage - third bunch of changes.
Diffstat (limited to 'src/net/java/sip/communicator/impl')
16 files changed, 164 insertions, 82 deletions
diff --git a/src/net/java/sip/communicator/impl/argdelegation/ArgDelegationPeerImpl.java b/src/net/java/sip/communicator/impl/argdelegation/ArgDelegationPeerImpl.java index be0f697..6256632 100644 --- a/src/net/java/sip/communicator/impl/argdelegation/ArgDelegationPeerImpl.java +++ b/src/net/java/sip/communicator/impl/argdelegation/ArgDelegationPeerImpl.java @@ -55,7 +55,8 @@ public class ArgDelegationPeerImpl { // this shouldn't happen because we aren't using a filter // but let's log just the same. - logger.info("An error occurred while retrieving UriHandlers", exc); + if (logger.isInfoEnabled()) + logger.info("An error occurred while retrieving UriHandlers", exc); return; } @@ -135,7 +136,8 @@ public class ArgDelegationPeerImpl */ public void handleUri(String uriArg) { - logger.trace("Handling URI: " + uriArg); + if (logger.isTraceEnabled()) + logger.trace("Handling URI: " + uriArg); //first parse the uri and determine the scheme/protocol //the parsing is currently a bit oversimplified so we'd probably need //to revisit it at some point. @@ -163,7 +165,8 @@ public class ArgDelegationPeerImpl //if handler is null we need to tell the user. if(handler == null) { - logger.trace("Couldn't open " + uriArg + if (logger.isTraceEnabled()) + logger.trace("Couldn't open " + uriArg + "No handler found for protocol"+ scheme); ArgDelegationActivator.getUIService().getPopupDialog() .showMessagePopupDialog( diff --git a/src/net/java/sip/communicator/impl/browserlauncher/BrowserLauncherActivator.java b/src/net/java/sip/communicator/impl/browserlauncher/BrowserLauncherActivator.java index f5cc1e1..f898e29 100644 --- a/src/net/java/sip/communicator/impl/browserlauncher/BrowserLauncherActivator.java +++ b/src/net/java/sip/communicator/impl/browserlauncher/BrowserLauncherActivator.java @@ -35,7 +35,8 @@ public class BrowserLauncherActivator //Create the browser launcher service BrowserLauncherService browserLauncher = new BrowserLauncherImpl(); - logger.info("Browser Launcher Service STARTED"); + if (logger.isInfoEnabled()) + logger.info("Browser Launcher Service STARTED"); bundleContext .registerService( @@ -43,7 +44,8 @@ public class BrowserLauncherActivator browserLauncher, null); - logger.info("Browser Launcher Service REGISTERED"); + if (logger.isInfoEnabled()) + logger.info("Browser Launcher Service REGISTERED"); } public void stop(BundleContext bundleContext) diff --git a/src/net/java/sip/communicator/impl/callhistory/CallHistoryActivator.java b/src/net/java/sip/communicator/impl/callhistory/CallHistoryActivator.java index 049ca9c..6956eb9 100755..100644 --- a/src/net/java/sip/communicator/impl/callhistory/CallHistoryActivator.java +++ b/src/net/java/sip/communicator/impl/callhistory/CallHistoryActivator.java @@ -85,7 +85,8 @@ public class CallHistoryActivator ContactSourceService.class.getName(), new CallHistoryContactSource(), null); - logger.info("Call History Service ...[REGISTERED]"); + if (logger.isInfoEnabled()) + logger.info("Call History Service ...[REGISTERED]"); } finally { diff --git a/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java b/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java index 9321298..489b7ab 100644 --- a/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java +++ b/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java @@ -497,7 +497,8 @@ public class CallHistoryServiceImpl */ public void start(BundleContext bc) { - logger.debug("Starting the call history implementation."); + if (logger.isDebugEnabled()) + logger.debug("Starting the call history implementation."); this.bundleContext = bc; // start listening for newly register or removed protocol providers @@ -522,7 +523,8 @@ public class CallHistoryServiceImpl // 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++) @@ -644,7 +646,8 @@ public class CallHistoryServiceImpl { this.historyService = historyService; - logger.debug("New history service registered."); + if (logger.isDebugEnabled()) + logger.debug("New history service registered."); } } @@ -661,7 +664,8 @@ public class CallHistoryServiceImpl { this.historyService = null; - logger.debug("History service unregistered."); + if (logger.isDebugEnabled()) + logger.debug("History service unregistered."); } } } @@ -677,7 +681,8 @@ public class CallHistoryServiceImpl 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 @@ -686,10 +691,12 @@ public class CallHistoryServiceImpl 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); } @@ -708,7 +715,8 @@ public class CallHistoryServiceImpl */ 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 telephony operation set OperationSetBasicTelephony opSetTelephony @@ -720,7 +728,8 @@ public class CallHistoryServiceImpl } 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."); } } diff --git a/src/net/java/sip/communicator/impl/configuration/ConfigurationActivator.java b/src/net/java/sip/communicator/impl/configuration/ConfigurationActivator.java index 02584a2..ef98a21 100644 --- a/src/net/java/sip/communicator/impl/configuration/ConfigurationActivator.java +++ b/src/net/java/sip/communicator/impl/configuration/ConfigurationActivator.java @@ -35,7 +35,8 @@ public class ConfigurationActivator public void start(BundleContext bundleContext) throws Exception { - logger.debug("Service Impl: " + getClass().getName() + " [ STARTED ]"); + if (logger.isDebugEnabled()) + logger.debug("Service Impl: " + getClass().getName() + " [ STARTED ]"); impl.start(bundleContext); @@ -43,7 +44,8 @@ public class ConfigurationActivator impl, null); - logger.debug("Service Impl: " + getClass().getName() + " [REGISTERED]"); + if (logger.isDebugEnabled()) + logger.debug("Service Impl: " + getClass().getName() + " [REGISTERED]"); } /** @@ -58,6 +60,7 @@ public class ConfigurationActivator { logger.logEntry(); impl.stop(); - logger.info("The ConfigurationService stop method has been called."); + if (logger.isInfoEnabled()) + logger.info("The ConfigurationService stop method has been called."); } } diff --git a/src/net/java/sip/communicator/impl/configuration/ConfigurationServiceImpl.java b/src/net/java/sip/communicator/impl/configuration/ConfigurationServiceImpl.java index f61965a..c9853d4 100644 --- a/src/net/java/sip/communicator/impl/configuration/ConfigurationServiceImpl.java +++ b/src/net/java/sip/communicator/impl/configuration/ConfigurationServiceImpl.java @@ -116,7 +116,8 @@ public class ConfigurationServiceImpl //no exception was thrown - lets change the property and fire a //change event - logger.trace(propertyName + "( oldValue=" + oldValue + if (logger.isTraceEnabled()) + logger.trace(propertyName + "( oldValue=" + oldValue + ", newValue=" + property + "."); doSetProperty(propertyName, property, isSystem); @@ -274,7 +275,8 @@ public class ConfigurationServiceImpl //no exception was thrown - lets change the property and fire a //change event - logger.trace("Will remove prop: " + propertyName + "."); + if (logger.isTraceEnabled()) + logger.trace("Will remove prop: " + propertyName + "."); store.removeProperty(propertyName); @@ -889,7 +891,8 @@ public class ConfigurationServiceImpl File configFileInCurrentDir = new File(pFileName); if (configFileInCurrentDir.exists()) { - logger.debug( + if (logger.isDebugEnabled()) + logger.debug( "Using config file in current dir: " + configFileInCurrentDir.getAbsolutePath()); return configFileInCurrentDir; @@ -907,7 +910,8 @@ public class ConfigurationServiceImpl if (configFileInUserHomeDir.exists()) { - logger.debug( + if (logger.isDebugEnabled()) + logger.debug( "Using config file in $HOME/.sip-communicator: " + configFileInUserHomeDir.getAbsolutePath()); return configFileInUserHomeDir; @@ -926,13 +930,15 @@ public class ConfigurationServiceImpl configDir.mkdirs(); configFileInUserHomeDir.createNewFile(); } - logger.debug( + if (logger.isDebugEnabled()) + logger.debug( "Created an empty file in $HOME: " + configFileInUserHomeDir.getAbsolutePath()); return configFileInUserHomeDir; } - logger.trace( + if (logger.isTraceEnabled()) + logger.trace( "Copying config file from JAR into " + configFileInUserHomeDir.getAbsolutePath()); configDir.mkdirs(); @@ -1134,7 +1140,8 @@ public class ConfigurationServiceImpl { for (Map.Entry<Object, Object> entry : System.getProperties().entrySet()) - logger.debug(entry.getKey() + "=" + entry.getValue()); + if (logger.isDebugEnabled()) + logger.debug(entry.getKey() + "=" + entry.getValue()); } } diff --git a/src/net/java/sip/communicator/impl/contactlist/ContactlistActivator.java b/src/net/java/sip/communicator/impl/contactlist/ContactlistActivator.java index 2995006..99cf667 100644 --- a/src/net/java/sip/communicator/impl/contactlist/ContactlistActivator.java +++ b/src/net/java/sip/communicator/impl/contactlist/ContactlistActivator.java @@ -37,7 +37,8 @@ public class ContactlistActivator { bundleContext = context; - logger.debug("Service Impl: " + getClass().getName() + " [ STARTED ]"); + if (logger.isDebugEnabled()) + logger.debug("Service Impl: " + getClass().getName() + " [ STARTED ]"); mclServiceImpl = new MetaContactListServiceImpl(); @@ -47,7 +48,8 @@ public class ContactlistActivator mclServiceImpl.start(context); - logger.debug("Service Impl: " + getClass().getName() + " [REGISTERED]"); + if (logger.isDebugEnabled()) + logger.debug("Service Impl: " + getClass().getName() + " [REGISTERED]"); } /** @@ -62,7 +64,8 @@ public class ContactlistActivator */ public void stop(BundleContext context) throws Exception { - logger.trace("Stopping the contact list."); + if (logger.isTraceEnabled()) + logger.trace("Stopping the contact list."); if(mclServiceImpl != null) mclServiceImpl.stop(context); } diff --git a/src/net/java/sip/communicator/impl/contactlist/MclStorageManager.java b/src/net/java/sip/communicator/impl/contactlist/MclStorageManager.java index 32d1d5a..ef3c3e7 100644 --- a/src/net/java/sip/communicator/impl/contactlist/MclStorageManager.java +++ b/src/net/java/sip/communicator/impl/contactlist/MclStorageManager.java @@ -234,7 +234,8 @@ public class MclStorageManager */ public void stop() { - logger.trace("Stopping the MCL XML storage manager."); + if (logger.isTraceEnabled()) + logger.trace("Stopping the MCL XML storage manager."); this.started = false; synchronized (contactListRWLock) { @@ -391,9 +392,11 @@ public class MclStorageManager */ private void storeContactList0() throws IOException { - logger.trace("storing contact list. because is started ==" + if (logger.isTraceEnabled()) + logger.trace("storing contact list. because is started ==" + isStarted()); - logger.trace("storing contact list. because is modified ==" + if (logger.isTraceEnabled()) + logger.trace("storing contact list. because is modified ==" + isModified); if (isStarted()) { @@ -1013,8 +1016,10 @@ public class MclStorageManager if(logger.isTraceEnabled() && protoContact.getParentContactGroup() == null) { - logger.trace("the following contact looks weird:" + protoContact); - logger.trace("group:" + protoContact.getParentContactGroup()); + if (logger.isTraceEnabled()) + logger.trace("the following contact looks weird:" + protoContact); + if (logger.isTraceEnabled()) + logger.trace("group:" + protoContact.getParentContactGroup()); } protoContactElement.setAttribute(PARENT_PROTO_GROUP_UID_ATTR_NAME, diff --git a/src/net/java/sip/communicator/impl/contactlist/MetaContactGroupImpl.java b/src/net/java/sip/communicator/impl/contactlist/MetaContactGroupImpl.java index 924aac9..5e68c68 100644 --- a/src/net/java/sip/communicator/impl/contactlist/MetaContactGroupImpl.java +++ b/src/net/java/sip/communicator/impl/contactlist/MetaContactGroupImpl.java @@ -189,7 +189,8 @@ public class MetaContactGroupImpl } catch(Exception e) { - logger.debug("Failed to count online contacts.", e); + if (logger.isDebugEnabled()) + logger.debug("Failed to count online contacts.", e); } return onlineContactsNumber; @@ -918,7 +919,8 @@ public class MetaContactGroupImpl */ void addSubgroup(MetaContactGroup subgroup) { - logger.trace("Adding subgroup " + subgroup.getGroupName() + if (logger.isTraceEnabled()) + logger.trace("Adding subgroup " + subgroup.getGroupName() + " to" + getGroupName()); this.subgroups.add((MetaContactGroupImpl)subgroup); ((MetaContactGroupImpl)subgroup).parentMetaContactGroup = this; diff --git a/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java b/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java index c30010a..d0f25ae 100644 --- a/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java +++ b/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java @@ -146,7 +146,8 @@ public class MetaContactListServiceImpl */ public void start(BundleContext bc) { - logger.debug("Starting the meta contact list implementation."); + if (logger.isDebugEnabled()) + logger.debug("Starting the meta contact list implementation."); this.bundleContext = bc; //initialize the meta contact list from what has been stored locally. @@ -184,7 +185,8 @@ public class MetaContactListServiceImpl // providers and create the meta contact list if (protocolProviderRefs != null) { - logger.debug("Found " + if (logger.isDebugEnabled()) + logger.debug("Found " + protocolProviderRefs.length + " already installed providers."); for (ServiceReference providerRef : protocolProviderRefs) @@ -504,7 +506,8 @@ public class MetaContactListServiceImpl findParentMetaContactGroup(metaGroup); if (parentMetaGroup == null) { - logger.debug("Resolve failed at group" + metaGroup); + if (logger.isDebugEnabled()) + logger.debug("Resolve failed at group" + metaGroup); throw new NullPointerException("Internal Error. Orphan group."); } @@ -1218,7 +1221,8 @@ public class MetaContactListServiceImpl { this.storageManager.storeContactListAndStopStorageManager(); this.storageManager.removeContactListFile(); - logger.trace("Removed meta contact list storage file."); + if (logger.isTraceEnabled()) + logger.trace("Removed meta contact list storage file."); } /** @@ -1513,9 +1517,11 @@ public class MetaContactListServiceImpl if (rootProtoGroup != null) { - logger.trace("subgroups: " + if (logger.isTraceEnabled()) + logger.trace("subgroups: " + rootProtoGroup.countSubgroups()); - logger.trace("child contacts: " + if (logger.isTraceEnabled()) + logger.trace("child contacts: " + rootProtoGroup.countContacts()); addContactGroupToMetaGroup(rootProtoGroup, rootMetaGroup, true); @@ -1620,7 +1626,8 @@ public class MetaContactListServiceImpl private synchronized void handleProviderAdded( ProtocolProviderService provider) { - logger.debug("Adding protocol provider " + if (logger.isDebugEnabled()) + logger.debug("Adding protocol provider " + provider.getAccountID().getAccountUniqueID()); // check whether the provider has a persistent presence op set @@ -1641,7 +1648,8 @@ public class MetaContactListServiceImpl { storageManager.extractContactsForAccount( provider.getAccountID().getAccountUniqueID()); - logger.debug("All contacts loaded for account " + if (logger.isDebugEnabled()) + logger.debug("All contacts loaded for account " + provider.getAccountID().getAccountUniqueID()); } catch (XMLException exc) @@ -1653,7 +1661,8 @@ public class MetaContactListServiceImpl } else { - logger.debug("Service did not have a pers. pres. op. set."); + if (logger.isDebugEnabled()) + logger.debug("Service did not have a pers. pres. op. set."); } /** @todo implement handling non persistent presence operation sets */ @@ -1676,7 +1685,8 @@ public class MetaContactListServiceImpl private void handleProviderRemoved( ProtocolProviderService provider) { - logger.debug("Removing protocol provider " + if (logger.isDebugEnabled()) + logger.debug("Removing protocol provider " + provider.getProtocolName()); this.currentlyInstalledProviders. @@ -1936,7 +1946,8 @@ public class MetaContactListServiceImpl Object sService = bundleContext.getService(event .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 @@ -1945,7 +1956,8 @@ public class MetaContactListServiceImpl return; } - logger.debug("Service is a protocol provider."); + if (logger.isDebugEnabled()) + logger.debug("Service is a protocol provider."); ProtocolProviderService provider = (ProtocolProviderService)sService; @@ -1971,7 +1983,8 @@ public class MetaContactListServiceImpl if (event.getType() == ServiceEvent.REGISTERED) { - logger.debug("Handling registration of a new Protocol Provider."); + if (logger.isDebugEnabled()) + logger.debug("Handling registration of a new Protocol Provider."); // if we have the PROVIDER_MASK property set, make sure that this // provider has it and if not ignore it. String providerMask = System @@ -1987,7 +2000,8 @@ public class MetaContactListServiceImpl if (servRefMask == null || !servRefMask.equals(providerMask)) { - logger.debug("Ignoing masked provider: " + if (logger.isDebugEnabled()) + logger.debug("Ignoing masked provider: " + provider.getAccountID()); return; } @@ -1997,7 +2011,8 @@ public class MetaContactListServiceImpl && currentlyInstalledProviders.containsKey( provider.getAccountID().getAccountUniqueID())) { - logger.debug("Ignoing an already installed account: " + if (logger.isDebugEnabled()) + logger.debug("Ignoing an already installed account: " + provider.getAccountID()); // the account is already installed and this event is coming // from a modification. we don't need to do anything. @@ -2021,7 +2036,8 @@ public class MetaContactListServiceImpl return; } - logger.debug("Account uninstalled. acc.id=" + if (logger.isDebugEnabled()) + logger.debug("Account uninstalled. acc.id=" +provider.getAccountID() +". Removing from meta " +"contact list."); this.handleProviderRemoved( (ProtocolProviderService) sService); @@ -2046,7 +2062,8 @@ public class MetaContactListServiceImpl */ public void subscriptionCreated(SubscriptionEvent evt) { - logger.trace("Subscription created: " + evt); + if (logger.isTraceEnabled()) + logger.trace("Subscription created: " + evt); //ignore the event if the source contact is in the ignore list if (isContactInEventIgnoreList( @@ -2111,7 +2128,8 @@ public class MetaContactListServiceImpl */ public void subscriptionMoved(SubscriptionMovedEvent evt) { - logger.trace("Subscription moved: " + evt); + if (logger.isTraceEnabled()) + logger.trace("Subscription moved: " + evt); //ignore the event if the source contact is in the ignore list if (isContactInEventIgnoreList( @@ -2194,7 +2212,8 @@ public class MetaContactListServiceImpl public void subscriptionFailed(SubscriptionEvent evt) { - logger.trace("Subscription failed: " + evt); + if (logger.isTraceEnabled()) + logger.trace("Subscription failed: " + evt); } /** @@ -2277,7 +2296,8 @@ public class MetaContactListServiceImpl public void subscriptionRemoved(SubscriptionEvent evt) { - logger.trace("Subscription removed: " + evt); + if (logger.isTraceEnabled()) + logger.trace("Subscription removed: " + evt); MetaContactImpl metaContact = (MetaContactImpl) findMetaContactByContact(evt.getSourceContact()); @@ -2387,7 +2407,8 @@ public class MetaContactListServiceImpl public void groupCreated(ServerStoredGroupEvent evt) { - logger.trace("ContactGroup created: " + evt); + if (logger.isTraceEnabled()) + logger.trace("ContactGroup created: " + evt); //ignore the event if the source group is in the ignore list if (isGroupInEventIgnoreList(evt.getSourceGroup().getGroupName() @@ -2448,7 +2469,8 @@ public class MetaContactListServiceImpl public void groupRemoved(ServerStoredGroupEvent evt) { - logger.trace("ContactGroup removed: " + evt); + if (logger.isTraceEnabled()) + logger.trace("ContactGroup removed: " + evt); MetaContactGroupImpl metaContactGroup = (MetaContactGroupImpl) findMetaContactGroupByContactGroup(evt.getSourceGroup()); @@ -2478,7 +2500,8 @@ public class MetaContactListServiceImpl */ public void groupNameChanged(ServerStoredGroupEvent evt) { - logger.trace("ContactGroup renamed: " + evt); + if (logger.isTraceEnabled()) + logger.trace("ContactGroup renamed: " + evt); MetaContactGroup metaContactGroup = findMetaContactGroupByContactGroup(evt.getSourceGroup()); @@ -2507,7 +2530,8 @@ public class MetaContactListServiceImpl { MetaContactEvent evt = new MetaContactEvent(sourceContact, parentGroup, eventID); - logger.trace("Will dispatch the following mcl event: " + if (logger.isTraceEnabled()) + logger.trace("Will dispatch the following mcl event: " + evt); for (MetaContactListListener listener : getMetaContactListListeners()) @@ -2558,7 +2582,8 @@ public class MetaContactListServiceImpl */ void fireMetaContactEvent(MetaContactPropertyChangeEvent event) { - logger.trace("Will dispatch the following mcl property change event: " + if (logger.isTraceEnabled()) + logger.trace("Will dispatch the following mcl property change event: " + event); for (MetaContactListListener listener : getMetaContactListListeners()) @@ -2606,7 +2631,8 @@ public class MetaContactListServiceImpl ProtoContactEvent event = new ProtoContactEvent(source, eventName, oldParent, newParent ); - logger.trace("Will dispatch the following mcl property change event: " + if (logger.isTraceEnabled()) + logger.trace("Will dispatch the following mcl property change event: " + event); for (MetaContactListListener listener : getMetaContactListListeners()) @@ -2821,7 +2847,8 @@ public class MetaContactListServiceImpl parentGroup.addMetaContact(newMetaContact); - logger.trace("Created meta contact: " + newMetaContact); + if (logger.isTraceEnabled()) + logger.trace("Created meta contact: " + newMetaContact); } /** @@ -2848,7 +2875,8 @@ public class MetaContactListServiceImpl MetaContactGroupEvent evt = new MetaContactGroupEvent( source, provider, sourceProtoGroup, eventID); - logger.trace("Will dispatch the following mcl event: " + if (logger.isTraceEnabled()) + logger.trace("Will dispatch the following mcl event: " + evt); for (MetaContactListListener listener : getMetaContactListListeners()) diff --git a/src/net/java/sip/communicator/impl/fileaccess/FileAccessServiceImpl.java b/src/net/java/sip/communicator/impl/fileaccess/FileAccessServiceImpl.java index 779568b..d2e59dc 100644 --- a/src/net/java/sip/communicator/impl/fileaccess/FileAccessServiceImpl.java +++ b/src/net/java/sip/communicator/impl/fileaccess/FileAccessServiceImpl.java @@ -333,16 +333,19 @@ public class FileAccessServiceImpl implements FileAccessService { if (!homedirFile.exists()) { - logger.debug("Creating home directory : " + if (logger.isDebugEnabled()) + logger.debug("Creating home directory : " + homedirFile.getAbsolutePath()); if (!homedirFile.mkdirs()) { String message = "Could not create the home directory : " + homedirFile.getAbsolutePath(); - logger.debug(message); + if (logger.isDebugEnabled()) + logger.debug(message); throw new IOException(message); } - logger.debug("Home directory created : " + if (logger.isDebugEnabled()) + logger.debug("Home directory created : " + homedirFile.getAbsolutePath()); } else if (!homedirFile.canWrite()) diff --git a/src/net/java/sip/communicator/impl/filehistory/FileHistoryActivator.java b/src/net/java/sip/communicator/impl/filehistory/FileHistoryActivator.java index 8384528..db0fd9a 100644 --- a/src/net/java/sip/communicator/impl/filehistory/FileHistoryActivator.java +++ b/src/net/java/sip/communicator/impl/filehistory/FileHistoryActivator.java @@ -52,7 +52,8 @@ public class FileHistoryActivator bundleContext.registerService( FileHistoryService.class.getName(), fileHistoryService, null); - logger.info("File History Service ...[REGISTERED]"); + if (logger.isInfoEnabled()) + logger.info("File History Service ...[REGISTERED]"); } finally { diff --git a/src/net/java/sip/communicator/impl/filehistory/FileHistoryServiceImpl.java b/src/net/java/sip/communicator/impl/filehistory/FileHistoryServiceImpl.java index a59dab9..bdfcaa1 100644 --- a/src/net/java/sip/communicator/impl/filehistory/FileHistoryServiceImpl.java +++ b/src/net/java/sip/communicator/impl/filehistory/FileHistoryServiceImpl.java @@ -61,7 +61,8 @@ public class FileHistoryServiceImpl */ public void start(BundleContext bc) { - logger.debug("Starting the file history implementation."); + if (logger.isDebugEnabled()) + logger.debug("Starting the file history implementation."); this.bundleContext = bc; // start listening for newly register or removed protocol providers @@ -86,7 +87,8 @@ public class FileHistoryServiceImpl // 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++) @@ -145,7 +147,8 @@ public class FileHistoryServiceImpl */ 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 file transfer operation set OperationSetFileTransfer opSetFileTransfer @@ -157,7 +160,8 @@ public class FileHistoryServiceImpl } else { - logger.trace("Service did not have a file transfer op. set."); + if (logger.isTraceEnabled()) + logger.trace("Service did not have a file transfer op. set."); } } @@ -610,7 +614,8 @@ public class FileHistoryServiceImpl { Object sService = bundleContext.getService(serviceEvent.getServiceReference()); - logger.trace("Received a service event for: " + sService.getClass().getName()); + 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)) @@ -618,10 +623,12 @@ public class FileHistoryServiceImpl 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/impl/galagonotification/GalagoNotificationActivator.java b/src/net/java/sip/communicator/impl/galagonotification/GalagoNotificationActivator.java index 5716265..789a633 100644 --- a/src/net/java/sip/communicator/impl/galagonotification/GalagoNotificationActivator.java +++ b/src/net/java/sip/communicator/impl/galagonotification/GalagoNotificationActivator.java @@ -96,7 +96,8 @@ public class GalagoNotificationActivator .debug( "org.freedesktop.Notifications.GetCapabilities:"); for (String capability : capabilities) - logger.debug("\t" + capability); + if (logger.isDebugEnabled()) + logger.debug("\t" + capability); } /* diff --git a/src/net/java/sip/communicator/impl/growlnotification/GrowlNotificationActivator.java b/src/net/java/sip/communicator/impl/growlnotification/GrowlNotificationActivator.java index e1cd7a9..e4de5c8 100644 --- a/src/net/java/sip/communicator/impl/growlnotification/GrowlNotificationActivator.java +++ b/src/net/java/sip/communicator/impl/growlnotification/GrowlNotificationActivator.java @@ -54,7 +54,8 @@ public class GrowlNotificationActivator */ public void start(BundleContext bc) throws Exception { - logger.info("Growl Notification ...[Starting]"); + if (logger.isInfoEnabled()) + logger.info("Growl Notification ...[Starting]"); bundleContext = bc; getConfigurationService(); @@ -67,17 +68,20 @@ public class GrowlNotificationActivator bc.registerService(PopupMessageHandler.class.getName(), handler, null); } else { - logger.info("Growl Notification ...[Aborted]"); + if (logger.isInfoEnabled()) + logger.info("Growl Notification ...[Aborted]"); return; } - logger.info("Growl Notification ...[Started]"); + if (logger.isInfoEnabled()) + logger.info("Growl Notification ...[Started]"); } public void stop(BundleContext bContext) throws Exception { handler.stop(bContext); - logger.info("Growl Notification Service ...[Stopped]"); + if (logger.isInfoEnabled()) + logger.info("Growl Notification Service ...[Stopped]"); } /** diff --git a/src/net/java/sip/communicator/impl/growlnotification/GrowlNotificationServiceImpl.java b/src/net/java/sip/communicator/impl/growlnotification/GrowlNotificationServiceImpl.java index b07f552..70244d4 100644 --- a/src/net/java/sip/communicator/impl/growlnotification/GrowlNotificationServiceImpl.java +++ b/src/net/java/sip/communicator/impl/growlnotification/GrowlNotificationServiceImpl.java @@ -52,7 +52,8 @@ public class GrowlNotificationServiceImpl */ public void start(BundleContext bc) { - logger.debug("Starting the Growl Notification implementation."); + if (logger.isDebugEnabled()) + logger.debug("Starting the Growl Notification implementation."); if(Growl.isGrowlRunning()) { @@ -139,7 +140,8 @@ public class GrowlNotificationServiceImpl synchronized(shownPopups) { shownPopups.remove(context); } - logger.trace("Growl notification timed-out :" + + if (logger.isTraceEnabled()) + logger.trace("Growl notification timed-out :" + m.getMessageTitle() + ": " + m.getMessage()); } } @@ -158,7 +160,8 @@ public class GrowlNotificationServiceImpl } firePopupMessageClicked(new SystrayPopupMessageEvent(this, m.getTag())); - logger.trace("Growl message clicked :" + + if (logger.isTraceEnabled()) + logger.trace("Growl message clicked :" + m.getMessageTitle() + ": " + m.getMessage()); } } |