diff options
author | Werner Dittmann <wernerd@java.net> | 2010-06-03 13:41:54 +0000 |
---|---|---|
committer | Werner Dittmann <wernerd@java.net> | 2010-06-03 13:41:54 +0000 |
commit | faa3a7ca59efe6e4747087ee94818e6f2a29294e (patch) | |
tree | 6753710e6ae24bc61fe54eb398ffeddcee79b17a /src/net | |
parent | 72cd6281f1502990eb276ca9c0f1f6cd7db2af90 (diff) | |
download | jitsi-faa3a7ca59efe6e4747087ee94818e6f2a29294e.zip jitsi-faa3a7ca59efe6e4747087ee94818e6f2a29294e.tar.gz jitsi-faa3a7ca59efe6e4747087ee94818e6f2a29294e.tar.bz2 |
Fix logger usage - fifth bunch.
Diffstat (limited to 'src/net')
36 files changed, 362 insertions, 181 deletions
diff --git a/src/net/java/sip/communicator/impl/media/CallSessionImpl.java b/src/net/java/sip/communicator/impl/media/CallSessionImpl.java index d608767..90faa5f 100644 --- a/src/net/java/sip/communicator/impl/media/CallSessionImpl.java +++ b/src/net/java/sip/communicator/impl/media/CallSessionImpl.java @@ -396,7 +396,8 @@ public class CallSessionImpl List<SendStream> sendStreams = rtpManager.getSendStreams(); if((sendStreams != null) && (sendStreams.size() > 0)) { - logger.trace("Will be starting " + sendStreams.size() + if (logger.isTraceEnabled()) + logger.trace("Will be starting " + sendStreams.size() + " audio send streams."); for (SendStream stream : sendStreams) @@ -416,7 +417,8 @@ public class CallSessionImpl } else { - logger.trace("No audio send streams will be started."); + if (logger.isTraceEnabled()) + logger.trace("No audio send streams will be started."); } //start video streams @@ -428,7 +430,8 @@ public class CallSessionImpl && ((sendStreams = rtpManager.getSendStreams()) != null) && (sendStreams.size() > 0)) { - logger.trace("Will be starting " + sendStreams.size() + if (logger.isTraceEnabled()) + logger.trace("Will be starting " + sendStreams.size() + " video send streams."); for (SendStream stream : sendStreams) @@ -446,7 +449,8 @@ public class CallSessionImpl } else { - logger.trace("No video send streams will be started."); + if (logger.isTraceEnabled()) + logger.trace("No video send streams will be started."); } setLocalVideoStreaming(startedAtLeastOneVideoStream); @@ -622,7 +626,8 @@ public class CallSessionImpl //it gracefully catch (Exception e) { - logger.trace("Failed to retrieve receive streams", e); + if (logger.isTraceEnabled()) + logger.trace("Failed to retrieve receive streams", e); receiveStreams = new Vector<ReceiveStream>(); } for (ReceiveStream stream : receiveStreams) @@ -703,7 +708,8 @@ public class CallSessionImpl //print flow statistics. GlobalTransmissionStats s = rtpManager.getGlobalTransmissionStats(); - logger.debug( + if (logger.isDebugEnabled()) + logger.debug( "global transmission stats (" + rtpManagerDescription + "): \n" + "bytes sent: " + s.getBytesSent() + "\n" + "local colls: " + s.getLocalColls() + "\n" + @@ -715,7 +721,8 @@ public class CallSessionImpl GlobalReceptionStats rs = rtpManager.getGlobalReceptionStats(); - logger.debug( + if (logger.isDebugEnabled()) + logger.debug( "global reception stats (" + rtpManagerDescription + "): \n" + "bad RTCP packets: " + rs.getBadRTCPPkts() + "\n" + "bad RTP packets: " + rs.getBadRTPkts() + "\n" + @@ -1193,7 +1200,8 @@ public class CallSessionImpl { String answerStr = answer ? "answer" : "offer"; - logger.trace("Parsing SDP " + answerStr + ": " + sdpStr); + if (logger.isTraceEnabled()) + logger.trace("Parsing SDP " + answerStr + ": " + sdpStr); //first parse the answer SessionDescription sdp; @@ -1345,7 +1353,8 @@ public class CallSessionImpl { if (sdpURI == null) { - logger.trace("Call URI was null."); + if (logger.isTraceEnabled()) + logger.trace("Call URI was null."); return; } @@ -1443,7 +1452,8 @@ public class CallSessionImpl = (ZRTPTransformEngine) transConnector.getEngine(); engine.setOwnSSRC(ssrc); } - logger.trace("Created a send stream for format " + format); + if (logger.isTraceEnabled()) + logger.trace("Created a send stream for format " + format); } catch (Exception exc) { @@ -1550,7 +1560,8 @@ public class CallSessionImpl rtpManager.addTarget(target); } - logger.trace("added target " + target + if (logger.isTraceEnabled()) + logger.trace("added target " + target + " for type " + type); } catch (Throwable exc) @@ -1654,7 +1665,8 @@ public class CallSessionImpl } catch (UnknownHostException e) { - logger.debug("Couldn't determine indtended " + if (logger.isDebugEnabled()) + logger.debug("Couldn't determine indtended " + "destination from address" + conn.getAddress(), e); } @@ -1727,7 +1739,8 @@ public class CallSessionImpl ? null : offer.getMediaDescriptions(false); - logger.debug("Will create media descs with: audio public address=" + if (logger.isDebugEnabled()) + logger.debug("Will create media descs with: audio public address=" + audioPublicAddress + " and video public address=" + videoPublicAddress); @@ -2109,7 +2122,8 @@ public class CallSessionImpl mediaEncodings.put(mediaType, jmfEncodings); } } - logger.trace("Possible media encodings="+mediaEncodings); + if (logger.isTraceEnabled()) + logger.trace("Possible media encodings="+mediaEncodings); return mediaEncodings; } @@ -2267,7 +2281,8 @@ public class CallSessionImpl if (logger.isDebugEnabled()) { logger.debug("AudioSessionAddress=" + audioSessionAddress); - logger.debug("AudioPublicAddress=" + audioPublicAddress); + if (logger.isDebugEnabled()) + logger.debug("AudioPublicAddress=" + audioPublicAddress); } //initialize video rtp manager. @@ -2398,7 +2413,8 @@ public class CallSessionImpl EnumSet.of(ZRTPCustomInfoCodes.ZRTPNotEnabledByUser)); } - logger.trace( + if (logger.isTraceEnabled()) + logger.trace( "RTP" + (rtpManager.equals(audioRtpManager)?" audio ":"video") + "manager initialized through connector"); @@ -2456,7 +2472,8 @@ public class CallSessionImpl { rtpManager.initialize(bindAddress); - logger.trace("RTP"+ + if (logger.isTraceEnabled()) + logger.trace("RTP"+ (rtpManager.equals(audioRtpManager)?" audio ":"video")+ "manager initialized normally"); } @@ -2495,7 +2512,8 @@ public class CallSessionImpl } buff = bc.setBufferLength(buff); - logger.trace("set receiver buffer len to=" + buff); + if (logger.isTraceEnabled()) + logger.trace("set receiver buffer len to=" + buff); bc.setEnabledThreshold(true); bc.setMinimumThreshold(100); } @@ -2530,7 +2548,8 @@ public class CallSessionImpl for (int i=0; i<CUSTOM_CODEC_FORMATS.length; i++) { javax.media.Format format = CUSTOM_CODEC_FORMATS[i]; - logger.debug("registering format " + format + " with RTP manager"); + if (logger.isDebugEnabled()) + logger.debug("registering format " + format + " with RTP manager"); /* * NOTE (mkoch@rowa.de): com.sun.media.rtp.RtpSessionMgr.addFormat * leaks memory, since it stores the Format in a static Vector. @@ -2555,7 +2574,8 @@ public class CallSessionImpl } javax.media.Format format = new VideoFormat(Constants.H264_RTP); - logger.debug("registering format " + format + " with RTP manager"); + if (logger.isDebugEnabled()) + logger.debug("registering format " + format + " with RTP manager"); /* * NOTE (mkoch@rowa.de): com.sun.media.rtp.RtpSessionMgr.addFormat * leaks memory, since it stores the Format in a static Vector. @@ -2596,7 +2616,8 @@ public class CallSessionImpl { try { - logger.debug("call connected. starting streaming"); + if (logger.isDebugEnabled()) + logger.debug("call connected. starting streaming"); startStreamingAndProcessingMedia(); } catch (MediaException ex) @@ -2694,12 +2715,14 @@ public class CallSessionImpl Participant participant = ((NewParticipantEvent) event).getParticipant(); - logger.debug("A new participant had just joined: " + if (logger.isDebugEnabled()) + logger.debug("A new participant had just joined: " + participant.getCNAME()); } else { - logger.debug("Received the following JMF Session event - " + if (logger.isDebugEnabled()) + logger.debug("Received the following JMF Session event - " + event.getClass().getName() + "=" + event); @@ -2715,7 +2738,8 @@ public class CallSessionImpl */ public synchronized void update(SendStreamEvent event) { - logger.debug( + if (logger.isDebugEnabled()) + logger.debug( "received the following JMF SendStreamEvent - " + event.getClass().getName() + "="+ event); } @@ -2735,7 +2759,8 @@ public class CallSessionImpl { try { - logger.debug("received a new incoming stream. " + evt); + if (logger.isDebugEnabled()) + logger.debug("received a new incoming stream. " + evt); DataSource ds = stream.getDataSource(); // Find out the formats. RTPControl ctl = (RTPControl) ds.getControl( @@ -2744,12 +2769,14 @@ public class CallSessionImpl { if (ctl != null) { - logger.debug("Received new RTP stream: " + if (logger.isDebugEnabled()) + logger.debug("Received new RTP stream: " + ctl.getFormat()); } else { - logger.debug("Received new RTP stream"); + if (logger.isDebugEnabled()) + logger.debug("Received new RTP stream"); } } @@ -2801,13 +2828,15 @@ public class CallSessionImpl } msg += " had now been identified as sent by: " + participant.getCNAME(); - logger.debug(msg); + if (logger.isDebugEnabled()) + logger.debug(msg); } } } else if (evt instanceof ByeEvent) { - logger.debug("Got \"bye\" from: " + participant.getCNAME()); + if (logger.isDebugEnabled()) + logger.debug("Got \"bye\" from: " + participant.getCNAME()); } } @@ -2819,7 +2848,8 @@ public class CallSessionImpl */ public synchronized void controllerUpdate(ControllerEvent ce) { - logger.debug("Received a ControllerEvent: " + ce); + if (logger.isDebugEnabled()) + logger.debug("Received a ControllerEvent: " + ce); Player player = (Player) ce.getSourceController(); if (player == null) @@ -2860,13 +2890,15 @@ public class CallSessionImpl // else // logger.debug("Player does not have gain control."); - logger.debug("A player was realized and will be started."); + if (logger.isDebugEnabled()) + logger.debug("A player was realized and will be started."); if (dataSink != null) { try { - logger.info("starting recording to file: " + dataSink); + if (logger.isInfoEnabled()) + logger.info("starting recording to file: " + dataSink); MediaLocator dest = new MediaLocator(dataSink); DataSink sink = Manager.createDataSink(((Processor) player) @@ -2895,7 +2927,8 @@ public class CallSessionImpl } else if (ce instanceof StartEvent) { - logger.debug("Received a StartEvent"); + if (logger.isDebugEnabled()) + logger.debug("Received a StartEvent"); } else if (ce instanceof ControllerErrorEvent) { @@ -2911,7 +2944,8 @@ public class CallSessionImpl * the check for the latter should be kept in front of the check for * the former. */ - logger.debug("Received a ControllerClosedEvent"); + if (logger.isDebugEnabled()) + logger.debug("Received a ControllerClosedEvent"); } } diff --git a/src/net/java/sip/communicator/impl/media/MediaActivator.java b/src/net/java/sip/communicator/impl/media/MediaActivator.java index faf2fcf..2b50fbc 100644 --- a/src/net/java/sip/communicator/impl/media/MediaActivator.java +++ b/src/net/java/sip/communicator/impl/media/MediaActivator.java @@ -52,7 +52,8 @@ public class MediaActivator public void start(BundleContext context) throws Exception { - logger.debug("Started."); + if (logger.isDebugEnabled()) + logger.debug("Started."); /* MediaActivator.bundleContext = context; @@ -63,7 +64,8 @@ public class MediaActivator mediaServiceRegistration = context.registerService(MediaService.class.getName(), mediaServiceImpl, null); - logger.debug("Media Service ... [REGISTERED]"); + if (logger.isDebugEnabled()) + logger.debug("Media Service ... [REGISTERED]"); // MediaConfigurationForm context.registerService(ConfigurationForm.class.getName(), diff --git a/src/net/java/sip/communicator/impl/media/MediaControl.java b/src/net/java/sip/communicator/impl/media/MediaControl.java index 95d3c1a..9fb0cc8 100644 --- a/src/net/java/sip/communicator/impl/media/MediaControl.java +++ b/src/net/java/sip/communicator/impl/media/MediaControl.java @@ -372,7 +372,8 @@ public class MediaControl public void initDataSourceFromURL(URL dataSourceURL) throws MediaException { - logger.debug("Using a data source from url: " + dataSourceURL); + if (logger.isDebugEnabled()) + logger.debug("Using a data source from url: " + dataSourceURL); avDataSource = createDataSource(new MediaLocator(dataSourceURL)); @@ -493,7 +494,8 @@ public class MediaControl //check out the formats that our processor supports and update our //supported formats arrays. TrackControl[] trackControls = sourceProcessor.getTrackControls(); - logger.debug("We will be able to transmit in:"); + if (logger.isDebugEnabled()) + logger.debug("We will be able to transmit in:"); List<String> transmittableAudioEncodings = new ArrayList<String>(); List<String> transmittableVideoEncodings = new ArrayList<String>(); @@ -537,7 +539,8 @@ public class MediaControl } else { - logger.debug("unknown encoding format " + encoding); + if (logger.isDebugEnabled()) + logger.debug("unknown encoding format " + encoding); } } } @@ -628,7 +631,8 @@ public class MediaControl public static DataSource createDataSource(MediaLocator locator) { try { - logger.info("Creating datasource for:" + if (logger.isInfoEnabled()) + logger.info("Creating datasource for:" + ((locator != null) ? locator.toExternalForm() : "null")); @@ -701,7 +705,8 @@ public class MediaControl } if ( logger.isDebugEnabled() && (sourceProcessor.getState() > Processor.Configured)) - logger.debug( + if (logger.isDebugEnabled()) + logger.debug( "sourceProcessor is in state " + sourceProcessor.getState() + " which is > Processor.Configured" @@ -721,7 +726,8 @@ public class MediaControl Format[] supported = tracks[i].getSupportedFormats(); if (supported.length == 0) { - logger.debug("No available encodings."); + if (logger.isDebugEnabled()) + logger.debug("No available encodings."); tracks[i].setEnabled(false); continue; } @@ -731,7 +737,8 @@ public class MediaControl logger.debug("Available encodings are:"); for (int j = 0; j < supported.length; j++) { - logger.debug("track[" + i + "] format[" + j + "]=" + if (logger.isDebugEnabled()) + logger.debug("track[" + i + "] format[" + j + "]=" + supported[j].getEncoding()); } } @@ -751,7 +758,8 @@ public class MediaControl (VideoFormat)supported[index]); tracks[i].setFormat(chosenFormat); - logger.debug("Track " + i + " is set to transmit " + if (logger.isDebugEnabled()) + logger.debug("Track " + i + " is set to transmit " + "as: " + chosenFormat); atLeastOneTrack = true; } @@ -847,7 +855,8 @@ public class MediaControl { qc = (QualityControl) c; qc.setQuality(val); - logger.debug("Setting quality to " + if (logger.isDebugEnabled()) + logger.debug("Setting quality to " + val + " on " + qc); break; } diff --git a/src/net/java/sip/communicator/impl/media/MediaServiceImpl.java b/src/net/java/sip/communicator/impl/media/MediaServiceImpl.java index dda4322..a3f54f5 100644 --- a/src/net/java/sip/communicator/impl/media/MediaServiceImpl.java +++ b/src/net/java/sip/communicator/impl/media/MediaServiceImpl.java @@ -446,7 +446,8 @@ public class MediaServiceImpl audioNotifier, null); - logger.info("Audio Notifier Service ...[REGISTERED]"); + if (logger.isInfoEnabled()) + logger.info("Audio Notifier Service ...[REGISTERED]"); } /** diff --git a/src/net/java/sip/communicator/impl/media/ProcessorUtility.java b/src/net/java/sip/communicator/impl/media/ProcessorUtility.java index dcd3db0..7fff173 100644 --- a/src/net/java/sip/communicator/impl/media/ProcessorUtility.java +++ b/src/net/java/sip/communicator/impl/media/ProcessorUtility.java @@ -74,7 +74,8 @@ public class ProcessorUtility implements ControllerListener if (ce instanceof ControllerErrorEvent) logger.warn("ControllerErrorEvent: " + ce); else - logger.debug("ControllerClosedEvent: " + ce); + if (logger.isDebugEnabled()) + logger.debug("ControllerClosedEvent: " + ce); setFailed(true); diff --git a/src/net/java/sip/communicator/impl/media/RtpFlowImpl.java b/src/net/java/sip/communicator/impl/media/RtpFlowImpl.java index 09e825b..54088a1 100644 --- a/src/net/java/sip/communicator/impl/media/RtpFlowImpl.java +++ b/src/net/java/sip/communicator/impl/media/RtpFlowImpl.java @@ -235,7 +235,8 @@ public class RtpFlowImpl } rtpMgrs[i].addTarget(destAddr); - logger.info("Created RTP session at " + localPort + + if (logger.isInfoEnabled()) + logger.info("Created RTP session at " + localPort + " to: " + remoteAddress + " " + port); sendStream = rtpMgrs[i].createSendStream(dataSource, i); sendStreams.add(sendStream); @@ -281,7 +282,8 @@ public class RtpFlowImpl */ public void resume() { - logger.info("resuming transmission... "); + if (logger.isInfoEnabled()) + logger.info("resuming transmission... "); for (SendStream sendStream : sendStreams) { @@ -301,7 +303,8 @@ public class RtpFlowImpl */ public void pause() { - logger.info("pausing transmission... "); + if (logger.isInfoEnabled()) + logger.info("pausing transmission... "); for (SendStream sendStream : sendStreams) { @@ -326,7 +329,8 @@ public class RtpFlowImpl if (evt instanceof NewParticipantEvent) { Participant p = ((NewParticipantEvent) evt).getParticipant(); - logger.info("A new participant had just joined: " + p.getCNAME()); + if (logger.isInfoEnabled()) + logger.info("A new participant had just joined: " + p.getCNAME()); } } @@ -358,17 +362,21 @@ public class RtpFlowImpl (RTPControl) ds.getControl("javax.jmf.rtp.RTPControl"); if (ctl != null) { - logger.info("Recevied new RTP stream: " + ctl.getFormat()); + if (logger.isInfoEnabled()) + logger.info("Recevied new RTP stream: " + ctl.getFormat()); } else - logger.info("Recevied new RTP stream"); + if (logger.isInfoEnabled()) + logger.info("Recevied new RTP stream"); if (participant == null) - logger.info("The sender of this stream" + + if (logger.isInfoEnabled()) + logger.info("The sender of this stream" + "had yet to be identified."); else { - logger.info("The stream comes from: " + + if (logger.isInfoEnabled()) + logger.info("The stream comes from: " + participant.getCNAME()); } @@ -398,16 +406,20 @@ public class RtpFlowImpl // Find out the formats. RTPControl ctl = (RTPControl) ds.getControl("javax.jmf.rtp.RTPControl"); - logger.info("The previously unidentified stream "); + if (logger.isInfoEnabled()) + logger.info("The previously unidentified stream "); if (ctl != null) - logger.info(": " + ctl.getFormat()); - logger.info(" had now been identified as sent by: " + if (logger.isInfoEnabled()) + logger.info(": " + ctl.getFormat()); + if (logger.isInfoEnabled()) + logger.info(" had now been identified as sent by: " + participant.getCNAME()); } } else if (evt instanceof ByeEvent) { - logger.info("Got \"bye\" from: " + participant.getCNAME()); + if (logger.isInfoEnabled()) + logger.info("Got \"bye\" from: " + participant.getCNAME()); } } diff --git a/src/net/java/sip/communicator/impl/media/codec/EncodingConfiguration.java b/src/net/java/sip/communicator/impl/media/codec/EncodingConfiguration.java index 15efb5d..b50757f 100644 --- a/src/net/java/sip/communicator/impl/media/codec/EncodingConfiguration.java +++ b/src/net/java/sip/communicator/impl/media/codec/EncodingConfiguration.java @@ -318,7 +318,8 @@ public class EncodingConfiguration if (registeredPlugins.contains(className)) { - logger.debug("Codec : " + className + " is already registered"); + if (logger.isDebugEnabled()) + logger.debug("Codec : " + className + " is already registered"); } else { @@ -345,12 +346,14 @@ public class EncodingConfiguration exception = ex; } if (registered) - logger.debug( + if (logger.isDebugEnabled()) + logger.debug( "Codec " + className + " is successfully registered"); else - logger.debug( + if (logger.isDebugEnabled()) + logger.debug( "Codec " + className + " is NOT succsefully registered", exception); @@ -397,13 +400,15 @@ public class EncodingConfiguration if (!currentPackagePrefix.contains(className)) { currentPackagePrefix.add(className); - logger.debug("Adding package : " + className); + if (logger.isDebugEnabled()) + logger.debug("Adding package : " + className); } } PackageManager.setProtocolPrefixList(currentPackagePrefix); PackageManager.commitProtocolPrefixList(); - logger.debug("Registering new protocol prefix list : " + if (logger.isDebugEnabled()) + logger.debug("Registering new protocol prefix list : " + currentPackagePrefix); } diff --git a/src/net/java/sip/communicator/impl/media/codec/video/h264/JNIDecoder.java b/src/net/java/sip/communicator/impl/media/codec/video/h264/JNIDecoder.java index fd8a628..11a8562 100644 --- a/src/net/java/sip/communicator/impl/media/codec/video/h264/JNIDecoder.java +++ b/src/net/java/sip/communicator/impl/media/codec/video/h264/JNIDecoder.java @@ -248,7 +248,8 @@ public class JNIDecoder long oldRecv = lastReceivedSeq; lastReceivedSeq = inputBuffer.getSequenceNumber(); waitingForMarker = true; - logger.trace("DROP rtp data! " + oldRecv + "/" + lastReceivedSeq); + if (logger.isTraceEnabled()) + logger.trace("DROP rtp data! " + oldRecv + "/" + lastReceivedSeq); parser.reset(); reset(); return OUTPUT_BUFFER_NOT_FILLED; diff --git a/src/net/java/sip/communicator/impl/media/device/DeviceConfiguration.java b/src/net/java/sip/communicator/impl/media/device/DeviceConfiguration.java index 5f6b073..1bb74e1 100644 --- a/src/net/java/sip/communicator/impl/media/device/DeviceConfiguration.java +++ b/src/net/java/sip/communicator/impl/media/device/DeviceConfiguration.java @@ -161,7 +161,8 @@ public class DeviceConfiguration { ConfigurationService config = MediaActivator.getConfigurationService(); - logger.info("Scanning for configured Audio Devices."); + if (logger.isInfoEnabled()) + logger.info("Scanning for configured Audio Devices."); CaptureDeviceInfo[] audioCaptureDevices = getAvailableAudioCaptureDevices(); if (config.getBoolean(PROP_AUDIO_DEVICE_IS_DISABLED, false)) @@ -177,7 +178,8 @@ public class DeviceConfiguration } else { - logger.debug("Found " + audioCaptureDevices.length + if (logger.isDebugEnabled()) + logger.debug("Found " + audioCaptureDevices.length + " capture devices: " + audioCaptureDevices); String audioDevName = config.getString(PROP_AUDIO_DEVICE); @@ -212,7 +214,8 @@ public class DeviceConfiguration } } if (audioCaptureDevice != null) - logger.info("Found " + audioCaptureDevice.getName() + if (logger.isInfoEnabled()) + logger.info("Found " + audioCaptureDevice.getName() + " as an audio capture device."); // now extract other sound related configs @@ -256,7 +259,8 @@ public class DeviceConfiguration videoCaptureDevice = null; else { - logger.info("Scanning for configured Video Devices."); + if (logger.isInfoEnabled()) + logger.info("Scanning for configured Video Devices."); videoCaptureDevice = extractConfiguredVideoCaptureDevice(VideoFormat.RGB); // no RGB camera found. And what about YUV ? @@ -265,7 +269,8 @@ public class DeviceConfiguration videoCaptureDevice = extractConfiguredVideoCaptureDevice(VideoFormat.YUV); if (videoCaptureDevice == null) - logger.info("No Video Device was found."); + if (logger.isInfoEnabled()) + logger.info("No Video Device was found."); } } } @@ -303,7 +308,8 @@ public class DeviceConfiguration } if (videoCaptureDevice != null) - logger.info("Found " + videoCaptureDevice.getName() + if (logger.isInfoEnabled()) + logger.info("Found " + videoCaptureDevice.getName() + " as an RGB Video Device."); } return videoCaptureDevice; diff --git a/src/net/java/sip/communicator/impl/media/device/JavaSoundAuto.java b/src/net/java/sip/communicator/impl/media/device/JavaSoundAuto.java index 486a029..c02c630 100644 --- a/src/net/java/sip/communicator/impl/media/device/JavaSoundAuto.java +++ b/src/net/java/sip/communicator/impl/media/device/JavaSoundAuto.java @@ -45,7 +45,8 @@ public class JavaSoundAuto { logger.error("Failed detecting java sound audio", thr); } - logger.info("JavaSound Capture Supported = " + supported); + if (logger.isInfoEnabled()) + logger.info("JavaSound Capture Supported = " + supported); if (supported) { // It's there, start to register JavaSound with CaptureDeviceManager @@ -73,7 +74,8 @@ public class JavaSoundAuto { CaptureDeviceManager.addDevice(cdi[i]); try { CaptureDeviceManager.commit(); - logger.info("JavaSoundAuto: Committed ok"); + if (logger.isInfoEnabled()) + logger.info("JavaSoundAuto: Committed ok"); } catch (java.io.IOException ioe) { logger.error("JavaSoundAuto: error committing cdm"); } diff --git a/src/net/java/sip/communicator/impl/media/device/JmfDeviceDetector.java b/src/net/java/sip/communicator/impl/media/device/JmfDeviceDetector.java index b39d041..075de41 100644 --- a/src/net/java/sip/communicator/impl/media/device/JmfDeviceDetector.java +++ b/src/net/java/sip/communicator/impl/media/device/JmfDeviceDetector.java @@ -128,7 +128,8 @@ public class JmfDeviceDetector */ private void detectCaptureDevices() { - logger.info("Looking for Audio capturer"); + if (logger.isInfoEnabled()) + logger.info("Looking for Audio capturer"); // check if JavaSound capture is available try @@ -137,7 +138,8 @@ public class JmfDeviceDetector } catch (Throwable exc) { - logger.debug("No JMF javasound detected: " + exc.getMessage()); + if (logger.isDebugEnabled()) + logger.debug("No JMF javasound detected: " + exc.getMessage()); } // check if we have FMJJavaSoundAuto capture is available @@ -147,7 +149,8 @@ public class JmfDeviceDetector } catch (Throwable exc) { - logger.debug("No FMJ javasound detected: " + exc.getMessage()); + if (logger.isDebugEnabled()) + logger.debug("No FMJ javasound detected: " + exc.getMessage()); } try { @@ -155,7 +158,8 @@ public class JmfDeviceDetector } catch (Throwable exc) { - logger.info("No portaudio detected: " + exc.getMessage()); + if (logger.isInfoEnabled()) + logger.info("No portaudio detected: " + exc.getMessage()); } // after javasound and portaudio eventually add them to available @@ -173,20 +177,23 @@ public class JmfDeviceDetector // Try to configgure capture devices for any operating system. //those that do not apply will silently fail. - logger.info("Looking for video capture devices"); + if (logger.isInfoEnabled()) + logger.info("Looking for video capture devices"); /* int nDevices = 0; //Windows try { VFWAuto vfwAuto = new VFWAuto(); vfwAuto.autoDetectDevices(); - logger.info("Detected " + if (logger.isInfoEnabled()) + logger.info("Detected " + nDevices +" VFW video capture device(s)."); } catch (Throwable exc) { - logger.debug("No VFW video detected: " + exc.getMessage()); + if (logger.isDebugEnabled()) + logger.debug("No VFW video detected: " + exc.getMessage()); } //SunVideo @@ -195,13 +202,15 @@ public class JmfDeviceDetector SunVideoAuto sunVideoAuto = new SunVideoAuto(); nDevices = sunVideoAuto.autoDetectDevices(); - logger.info("Detected " + if (logger.isInfoEnabled()) + logger.info("Detected " + nDevices +" SUN Video capture device(s)."); } catch (Throwable exc) { - logger.debug("No SUN Video detected: " + exc.getMessage()); + if (logger.isDebugEnabled()) + logger.debug("No SUN Video detected: " + exc.getMessage()); } //SunVideoPlus @@ -210,13 +219,15 @@ public class JmfDeviceDetector SunVideoPlusAuto sunVideoAutoPlus = new SunVideoPlusAuto(); nDevices = sunVideoAutoPlus.autoDetectDevices(); - logger.info("Detected " + if (logger.isInfoEnabled()) + logger.info("Detected " + nDevices + " SUN Video Plus device(s)."); } catch (Throwable exc) { - logger.debug("No SUN Video Plus detected: " + exc.getMessage()); + if (logger.isDebugEnabled()) + logger.debug("No SUN Video Plus detected: " + exc.getMessage()); } //Linux @@ -224,13 +235,15 @@ public class JmfDeviceDetector { V4LAuto v4lAuto = new V4LAuto(); nDevices = v4lAuto.autoDetectDevices(); - logger.info("Detected " + if (logger.isInfoEnabled()) + logger.info("Detected " + nDevices +" V4L video capture device."); } catch (Throwable exc) { - logger.debug("No V4l video detected: " + exc.getMessage()); + if (logger.isDebugEnabled()) + logger.debug("No V4l video detected: " + exc.getMessage()); } */ @@ -243,7 +256,8 @@ public class JmfDeviceDetector } catch (Throwable exc) { - logger.debug("No FMJ CIVIL video detected: " + exc.getMessage(), exc); + if (logger.isDebugEnabled()) + logger.debug("No FMJ CIVIL video detected: " + exc.getMessage(), exc); } } @@ -312,12 +326,14 @@ public class JmfDeviceDetector } catch (Throwable throwable) { - logger.debug("Detection for direct audio failed.", throwable); + if (logger.isDebugEnabled()) + logger.debug("Detection for direct audio failed.", throwable); } } catch (Throwable tt) { - logger.debug("Detection for direct audio failed.", tt); + if (logger.isDebugEnabled()) + logger.debug("Detection for direct audio failed.", tt); } } diff --git a/src/net/java/sip/communicator/impl/metahistory/MetaHistoryActivator.java b/src/net/java/sip/communicator/impl/metahistory/MetaHistoryActivator.java index 52ca9db..bfead79 100755..100644 --- a/src/net/java/sip/communicator/impl/metahistory/MetaHistoryActivator.java +++ b/src/net/java/sip/communicator/impl/metahistory/MetaHistoryActivator.java @@ -44,7 +44,8 @@ public class MetaHistoryActivator bundleContext.registerService( MetaHistoryService.class.getName(), metaHistoryService, null); - logger.info("Meta History Service ...[REGISTERED]"); + if (logger.isInfoEnabled()) + logger.info("Meta History Service ...[REGISTERED]"); } finally { diff --git a/src/net/java/sip/communicator/impl/metahistory/MetaHistoryServiceImpl.java b/src/net/java/sip/communicator/impl/metahistory/MetaHistoryServiceImpl.java index cb9858b..855880d 100644 --- a/src/net/java/sip/communicator/impl/metahistory/MetaHistoryServiceImpl.java +++ b/src/net/java/sip/communicator/impl/metahistory/MetaHistoryServiceImpl.java @@ -860,7 +860,8 @@ public class MetaHistoryServiceImpl */ 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; services.clear(); diff --git a/src/net/java/sip/communicator/impl/msghistory/MessageHistoryActivator.java b/src/net/java/sip/communicator/impl/msghistory/MessageHistoryActivator.java index 933481d..d0f694e 100644 --- a/src/net/java/sip/communicator/impl/msghistory/MessageHistoryActivator.java +++ b/src/net/java/sip/communicator/impl/msghistory/MessageHistoryActivator.java @@ -57,7 +57,8 @@ public class MessageHistoryActivator bundleContext.registerService( MessageHistoryService.class.getName(), msgHistoryService, null); - logger.info("Message History Service ...[REGISTERED]"); + if (logger.isInfoEnabled()) + logger.info("Message History Service ...[REGISTERED]"); } finally { diff --git a/src/net/java/sip/communicator/impl/msghistory/MessageHistoryServiceImpl.java b/src/net/java/sip/communicator/impl/msghistory/MessageHistoryServiceImpl.java index 656f0d2..0e4de79 100644 --- a/src/net/java/sip/communicator/impl/msghistory/MessageHistoryServiceImpl.java +++ b/src/net/java/sip/communicator/impl/msghistory/MessageHistoryServiceImpl.java @@ -816,7 +816,8 @@ public class MessageHistoryServiceImpl "impl.msghistory.IS_MESSAGE_HISTORY_ENABLED", msgHistoryPropListener); - logger.debug("Starting the msg history implementation."); + if (logger.isDebugEnabled()) + logger.debug("Starting the msg history implementation."); this.loadMessageHistoryService(); } @@ -1016,7 +1017,8 @@ public class MessageHistoryServiceImpl { this.historyService = historyService; - logger.debug("New history service registered."); + if (logger.isDebugEnabled()) + logger.debug("New history service registered."); } } @@ -1033,7 +1035,8 @@ public class MessageHistoryServiceImpl { this.historyService = null; - logger.debug("History service unregistered."); + if (logger.isDebugEnabled()) + logger.debug("History service unregistered."); } } } @@ -1048,7 +1051,8 @@ public class MessageHistoryServiceImpl { 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)) @@ -1056,10 +1060,12 @@ public class MessageHistoryServiceImpl 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); } @@ -1079,7 +1085,8 @@ public class MessageHistoryServiceImpl */ private void handleProviderAdded(ProtocolProviderService provider) { - logger.debug("Adding protocol provider " + if (logger.isDebugEnabled()) + logger.debug("Adding protocol provider " + provider.getProtocolDisplayName()); // check whether the provider has a basic im operation set @@ -1092,7 +1099,8 @@ public class MessageHistoryServiceImpl } else { - logger.trace("Service did not have a im op. set."); + if (logger.isTraceEnabled()) + logger.trace("Service did not have a im op. set."); } OperationSetMultiUserChat opSetMultiUChat = @@ -1113,7 +1121,8 @@ public class MessageHistoryServiceImpl } 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."); } } @@ -2142,7 +2151,8 @@ public class MessageHistoryServiceImpl // 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++) diff --git a/src/net/java/sip/communicator/impl/neomedia/AudioMediaStreamImpl.java b/src/net/java/sip/communicator/impl/neomedia/AudioMediaStreamImpl.java index dccef1a..2b2a853 100644 --- a/src/net/java/sip/communicator/impl/neomedia/AudioMediaStreamImpl.java +++ b/src/net/java/sip/communicator/impl/neomedia/AudioMediaStreamImpl.java @@ -231,7 +231,8 @@ public class AudioMediaStreamImpl for (AudioFormat format : CUSTOM_CODEC_FORMATS) { - logger.debug("registering format " + format + " with RTP manager"); + if (logger.isDebugEnabled()) + logger.debug("registering format " + format + " with RTP manager"); /* * NOTE (mkoch@rowa.de): com.sun.media.rtp.RtpSessionMgr.addFormat diff --git a/src/net/java/sip/communicator/impl/neomedia/MediaStreamImpl.java b/src/net/java/sip/communicator/impl/neomedia/MediaStreamImpl.java index 026872a..06624ba 100644 --- a/src/net/java/sip/communicator/impl/neomedia/MediaStreamImpl.java +++ b/src/net/java/sip/communicator/impl/neomedia/MediaStreamImpl.java @@ -1365,7 +1365,8 @@ public class MediaStreamImpl * NullPointerException could be thrown. Make sure we handle it * gracefully. */ - logger.trace("Failed to retrieve receive streams", ex); + if (logger.isTraceEnabled()) + logger.trace("Failed to retrieve receive streams", ex); receiveStreams = null; } @@ -1530,7 +1531,8 @@ public class MediaStreamImpl * NullPointerException could be thrown. Make sure we handle it * gracefully. */ - logger.trace("Failed to retrieve receive streams", ex); + if (logger.isTraceEnabled()) + logger.trace("Failed to retrieve receive streams", ex); receiveStreams = null; } diff --git a/src/net/java/sip/communicator/impl/neomedia/NeomediaActivator.java b/src/net/java/sip/communicator/impl/neomedia/NeomediaActivator.java index b520c1c..db40e4f 100644 --- a/src/net/java/sip/communicator/impl/neomedia/NeomediaActivator.java +++ b/src/net/java/sip/communicator/impl/neomedia/NeomediaActivator.java @@ -93,7 +93,8 @@ public class NeomediaActivator public void start(BundleContext bundleContext) throws Exception { - logger.debug("Started."); + if (logger.isDebugEnabled()) + logger.debug("Started."); NeomediaActivator.bundleContext = bundleContext; @@ -107,7 +108,8 @@ public class NeomediaActivator MediaService.class.getName(), mediaServiceImpl, null); - logger.debug("Media Service ... [REGISTERED]"); + if (logger.isDebugEnabled()) + logger.debug("Media Service ... [REGISTERED]"); // MediaConfigurationForm bundleContext @@ -158,7 +160,8 @@ public class NeomediaActivator audioNotifier, null); - logger.info("Audio Notifier Service ...[REGISTERED]"); + if (logger.isInfoEnabled()) + logger.info("Audio Notifier Service ...[REGISTERED]"); } /** diff --git a/src/net/java/sip/communicator/impl/neomedia/ProcessorUtility.java b/src/net/java/sip/communicator/impl/neomedia/ProcessorUtility.java index cce04cd..e35cfbb 100644 --- a/src/net/java/sip/communicator/impl/neomedia/ProcessorUtility.java +++ b/src/net/java/sip/communicator/impl/neomedia/ProcessorUtility.java @@ -88,7 +88,8 @@ public class ProcessorUtility if (ce instanceof ControllerErrorEvent) logger.warn("ControllerErrorEvent: " + ce); else - logger.debug("ControllerClosedEvent: " + ce); + if (logger.isDebugEnabled()) + logger.debug("ControllerClosedEvent: " + ce); setFailed(true); diff --git a/src/net/java/sip/communicator/impl/neomedia/codec/EncodingConfiguration.java b/src/net/java/sip/communicator/impl/neomedia/codec/EncodingConfiguration.java index 0028f8b..aa87469 100644 --- a/src/net/java/sip/communicator/impl/neomedia/codec/EncodingConfiguration.java +++ b/src/net/java/sip/communicator/impl/neomedia/codec/EncodingConfiguration.java @@ -355,7 +355,8 @@ public class EncodingConfiguration if (registeredPlugins.contains(className)) { - logger.debug("Codec : " + className + " is already registered"); + if (logger.isDebugEnabled()) + logger.debug("Codec : " + className + " is already registered"); } else { @@ -383,14 +384,16 @@ public class EncodingConfiguration } if (registered) { - logger.debug( + if (logger.isDebugEnabled()) + logger.debug( "Codec " + className + " is successfully registered"); } else { - logger.debug( + if (logger.isDebugEnabled()) + logger.debug( "Codec " + className + " is NOT succsefully registered", exception); @@ -441,7 +444,8 @@ public class EncodingConfiguration { packages.add(customPackage); if (loggerIsDebugEnabled) - logger.debug("Adding package : " + customPackage); + if (logger.isDebugEnabled()) + logger.debug("Adding package : " + customPackage); } } @@ -449,7 +453,8 @@ public class EncodingConfiguration PackageManager.commitProtocolPrefixList(); if (loggerIsDebugEnabled) { - logger.debug( + if (logger.isDebugEnabled()) + logger.debug( "Registering new protocol prefix list: " + packages); } } diff --git a/src/net/java/sip/communicator/impl/neomedia/device/AudioMediaDeviceImpl.java b/src/net/java/sip/communicator/impl/neomedia/device/AudioMediaDeviceImpl.java index 8803b6c..b49f530 100644 --- a/src/net/java/sip/communicator/impl/neomedia/device/AudioMediaDeviceImpl.java +++ b/src/net/java/sip/communicator/impl/neomedia/device/AudioMediaDeviceImpl.java @@ -218,7 +218,8 @@ public class AudioMediaDeviceImpl { // can't happen since CSRC_AUDIO_LEVEL_URN is a valid URI and // never changes. - logger.info("Aha! Someone messed with the source!", e); + if (logger.isInfoEnabled()) + logger.info("Aha! Someone messed with the source!", e); return null; } diff --git a/src/net/java/sip/communicator/impl/neomedia/device/AudioMixerMediaDevice.java b/src/net/java/sip/communicator/impl/neomedia/device/AudioMixerMediaDevice.java index 482a463..6bb798b 100644 --- a/src/net/java/sip/communicator/impl/neomedia/device/AudioMixerMediaDevice.java +++ b/src/net/java/sip/communicator/impl/neomedia/device/AudioMixerMediaDevice.java @@ -383,7 +383,8 @@ public class AudioMixerMediaDevice { // can't happen since CSRC_AUDIO_LEVEL_URN is a valid URI and // never changes. - logger.info("Aha! Someone messed with the source!", e); + if (logger.isInfoEnabled()) + logger.info("Aha! Someone messed with the source!", e); return null; } diff --git a/src/net/java/sip/communicator/impl/neomedia/device/DeviceConfiguration.java b/src/net/java/sip/communicator/impl/neomedia/device/DeviceConfiguration.java index 992c076..775c66f 100644 --- a/src/net/java/sip/communicator/impl/neomedia/device/DeviceConfiguration.java +++ b/src/net/java/sip/communicator/impl/neomedia/device/DeviceConfiguration.java @@ -216,7 +216,8 @@ public class DeviceConfiguration ConfigurationService config = NeomediaActivator.getConfigurationService(); - logger.info("Scanning for configured Audio Devices."); + if (logger.isInfoEnabled()) + logger.info("Scanning for configured Audio Devices."); CaptureDeviceInfo[] audioCaptureDevices = getAvailableAudioCaptureDevices(); if (config.getBoolean(PROP_AUDIO_DEVICE_IS_DISABLED, false)) @@ -232,7 +233,8 @@ public class DeviceConfiguration } else { - logger.debug("Found " + audioCaptureDevices.length + if (logger.isDebugEnabled()) + logger.debug("Found " + audioCaptureDevices.length + " capture devices: " + audioCaptureDevices); String audioDevName = config.getString(PROP_AUDIO_DEVICE); @@ -277,7 +279,8 @@ public class DeviceConfiguration } } if (audioCaptureDevice != null) - logger.info("Found " + audioCaptureDevice.getName() + if (logger.isInfoEnabled()) + logger.info("Found " + audioCaptureDevice.getName() + " as an audio capture device."); } @@ -285,7 +288,8 @@ public class DeviceConfiguration videoCaptureDevice = null; else { - logger.info("Scanning for configured Video Devices."); + if (logger.isInfoEnabled()) + logger.info("Scanning for configured Video Devices."); Format[] formats = new Format[] @@ -303,7 +307,8 @@ public class DeviceConfiguration break; } if (videoCaptureDevice == null) - logger.info("No Video Device was found."); + if (logger.isInfoEnabled()) + logger.info("No Video Device was found."); } } @@ -341,7 +346,8 @@ public class DeviceConfiguration if (videoCaptureDevice != null) { - logger.info( + if (logger.isInfoEnabled()) + logger.info( "Found " + videoCaptureDevice.getName() + " as a " diff --git a/src/net/java/sip/communicator/impl/neomedia/device/JavaSoundAuto.java b/src/net/java/sip/communicator/impl/neomedia/device/JavaSoundAuto.java index 9bef757..63b8f01 100644 --- a/src/net/java/sip/communicator/impl/neomedia/device/JavaSoundAuto.java +++ b/src/net/java/sip/communicator/impl/neomedia/device/JavaSoundAuto.java @@ -49,7 +49,8 @@ public class JavaSoundAuto logger.error("Failed detecting java sound audio", thr); } - logger.info("JavaSound Capture Supported = " + supported); + if (logger.isInfoEnabled()) + logger.info("JavaSound Capture Supported = " + supported); if (supported) { @@ -82,7 +83,8 @@ public class JavaSoundAuto try { CaptureDeviceManager.commit(); - logger.info("JavaSoundAuto: Committed ok"); + if (logger.isInfoEnabled()) + logger.info("JavaSoundAuto: Committed ok"); } catch (IOException ioex) { diff --git a/src/net/java/sip/communicator/impl/neomedia/device/JmfDeviceDetector.java b/src/net/java/sip/communicator/impl/neomedia/device/JmfDeviceDetector.java index 536002a..33b1704 100644 --- a/src/net/java/sip/communicator/impl/neomedia/device/JmfDeviceDetector.java +++ b/src/net/java/sip/communicator/impl/neomedia/device/JmfDeviceDetector.java @@ -123,7 +123,8 @@ public class JmfDeviceDetector */ private void detectCaptureDevices() { - logger.info("Looking for Audio capturer"); + if (logger.isInfoEnabled()) + logger.info("Looking for Audio capturer"); // check if JavaSound capture is available try @@ -132,7 +133,8 @@ public class JmfDeviceDetector } catch (Throwable exc) { - logger.debug("No JMF javasound detected: " + exc.getMessage()); + if (logger.isDebugEnabled()) + logger.debug("No JMF javasound detected: " + exc.getMessage()); } // check if we have FMJJavaSoundAuto capture is available @@ -142,7 +144,8 @@ public class JmfDeviceDetector } catch (Throwable exc) { - logger.debug("No FMJ javasound detected: " + exc.getMessage()); + if (logger.isDebugEnabled()) + logger.debug("No FMJ javasound detected: " + exc.getMessage()); } try { @@ -150,7 +153,8 @@ public class JmfDeviceDetector } catch (Throwable exc) { - logger.info("No portaudio detected: " + exc.getMessage()); + if (logger.isInfoEnabled()) + logger.info("No portaudio detected: " + exc.getMessage()); } // after javasound and portaudio eventually add them to available @@ -170,7 +174,8 @@ public class JmfDeviceDetector // Try to configgure capture devices for any operating system. // those that do not apply will silently fail. - logger.info("Looking for video capture devices"); + if (logger.isInfoEnabled()) + logger.info("Looking for video capture devices"); //FMJ boolean fmjVideoAvailable = isFMJVideoAvailable(); @@ -182,7 +187,8 @@ public class JmfDeviceDetector } catch (Throwable exc) { - logger.debug("No FMJ CIVIL video detected: " + exc.getMessage(), exc); + if (logger.isDebugEnabled()) + logger.debug("No FMJ CIVIL video detected: " + exc.getMessage(), exc); fmjVideoAvailable = false; } @@ -194,7 +200,8 @@ public class JmfDeviceDetector } catch (Throwable t) { - logger.debug("No QuickTime detected: " + t.getMessage(), t); + if (logger.isDebugEnabled()) + logger.debug("No QuickTime detected: " + t.getMessage(), t); } } else if (OSUtils.IS_LINUX) // Video4Linux2 @@ -205,7 +212,8 @@ public class JmfDeviceDetector } catch (Throwable t) { - logger.debug("No Video4Linux2 detected: " + t.getMessage(), t); + if (logger.isDebugEnabled()) + logger.debug("No Video4Linux2 detected: " + t.getMessage(), t); } } else if (OSUtils.IS_WINDOWS) /* DirectShow */ @@ -216,7 +224,8 @@ public class JmfDeviceDetector } catch(Throwable t) { - logger.debug("No DirectShow detected: " + t.getMessage(), t); + if (logger.isDebugEnabled()) + logger.debug("No DirectShow detected: " + t.getMessage(), t); } } diff --git a/src/net/java/sip/communicator/impl/neomedia/imgstreaming/DesktopInteractImpl.java b/src/net/java/sip/communicator/impl/neomedia/imgstreaming/DesktopInteractImpl.java index d64ec5f..3ee1e8a 100644 --- a/src/net/java/sip/communicator/impl/neomedia/imgstreaming/DesktopInteractImpl.java +++ b/src/net/java/sip/communicator/impl/neomedia/imgstreaming/DesktopInteractImpl.java @@ -183,10 +183,12 @@ public class DesktopInteractImpl implements DesktopInteract return null; } - logger.info("Begin capture: " + System.nanoTime()); + if (logger.isInfoEnabled()) + logger.info("Begin capture: " + System.nanoTime()); rect = new Rectangle(x, y, width, height); img = robot.createScreenCapture(rect); - logger.info("End capture: " + System.nanoTime()); + if (logger.isInfoEnabled()) + logger.info("End capture: " + System.nanoTime()); return img; } diff --git a/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/ByteBufferPool.java b/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/ByteBufferPool.java index 3bc22d1..7a84bb7 100644 --- a/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/ByteBufferPool.java +++ b/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/ByteBufferPool.java @@ -69,7 +69,8 @@ public class ByteBufferPool } if (loggerIsTraceEnabled) { - logger.trace( + if (logger.isTraceEnabled()) + logger.trace( "Leaking " + leakedCount + " ByteBuffer instances."); } } diff --git a/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/directshow/DataSource.java b/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/directshow/DataSource.java index ea59ffc..f323a1a 100644 --- a/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/directshow/DataSource.java +++ b/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/directshow/DataSource.java @@ -312,7 +312,8 @@ public class DataSource extends AbstractPushBufferCaptureDevice @Override
protected void doConnect() throws IOException
{
- logger.info("doConnect");
+ if (logger.isInfoEnabled()) + logger.info("doConnect");
if(manager == null)
{
@@ -330,7 +331,8 @@ public class DataSource extends AbstractPushBufferCaptureDevice @Override
protected void doDisconnect()
{
- logger.info("doDisconnect");
+ if (logger.isInfoEnabled()) + logger.info("doDisconnect");
super.doDisconnect();
if(manager != null)
@@ -353,7 +355,8 @@ public class DataSource extends AbstractPushBufferCaptureDevice @Override
protected void doStart() throws IOException
{
- logger.info("start");
+ if (logger.isInfoEnabled()) + logger.info("start");
/* open and start capture */
device.open();
super.doStart();
@@ -369,7 +372,8 @@ public class DataSource extends AbstractPushBufferCaptureDevice @Override
protected void doStop() throws IOException
{
- logger.info("stop");
+ if (logger.isInfoEnabled()) + logger.info("stop");
/* close capture */
super.doStop();
device.close();
diff --git a/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/imgstreaming/ImageStream.java b/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/imgstreaming/ImageStream.java index 5217591..32ac000 100644 --- a/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/imgstreaming/ImageStream.java +++ b/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/imgstreaming/ImageStream.java @@ -213,7 +213,8 @@ public class ImageStream @Override public void stop() { - logger.info("Stop stream"); + if (logger.isInfoEnabled()) + logger.info("Stop stream"); } /** diff --git a/src/net/java/sip/communicator/impl/neomedia/transform/zrtp/SecurityEventManager.java b/src/net/java/sip/communicator/impl/neomedia/transform/zrtp/SecurityEventManager.java index 97af828..782ce56 100644 --- a/src/net/java/sip/communicator/impl/neomedia/transform/zrtp/SecurityEventManager.java +++ b/src/net/java/sip/communicator/impl/neomedia/transform/zrtp/SecurityEventManager.java @@ -142,7 +142,8 @@ public class SecurityEventManager extends ZrtpUserCallback @Override public void secureOn(String cipher) { - logger.debug(sessionTypeToString(sessionType) + if (logger.isDebugEnabled()) + logger.debug(sessionTypeToString(sessionType) + ": cipher enabled: " + cipher); this.cipher = cipher; @@ -158,7 +159,8 @@ public class SecurityEventManager extends ZrtpUserCallback @Override public void showSAS(String sas, boolean isVerified) { - logger.debug(sessionTypeToString(sessionType) + ": SAS is: " + sas); + if (logger.isDebugEnabled()) + logger.debug(sessionTypeToString(sessionType) + ": SAS is: " + sas); this.sas = sas; this.isSasVerified = isVerified; @@ -303,7 +305,8 @@ public class SecurityEventManager extends ZrtpUserCallback securityListener .securityMessageReceived(message, i18nMessage, severity); - logger.debug(sessionTypeToString(sessionType) + ": " + if (logger.isDebugEnabled()) + logger.debug(sessionTypeToString(sessionType) + ": " + "ZRTP message: severity: " + sev + ", sub code: " + msgCode + ", DH session: " + isDHSession + ", multi: " + multiStreams); } @@ -321,7 +324,8 @@ public class SecurityEventManager extends ZrtpUserCallback Iterator<?> ii = subCode.iterator(); Object msgCode = ii.next(); - logger.debug(sessionTypeToString(sessionType) + if (logger.isDebugEnabled()) + logger.debug(sessionTypeToString(sessionType) + ": ZRTP key negotiation failed, sub code: " + msgCode); } @@ -331,7 +335,8 @@ public class SecurityEventManager extends ZrtpUserCallback @Override public void secureOff() { - logger.debug(sessionTypeToString(sessionType) + ": Security off"); + if (logger.isDebugEnabled()) + logger.debug(sessionTypeToString(sessionType) + ": Security off"); securityListener.securityTurnedOff(sessionType); } @@ -342,7 +347,8 @@ public class SecurityEventManager extends ZrtpUserCallback @Override public void zrtpNotSuppOther() { - logger.debug(sessionTypeToString(sessionType) + if (logger.isDebugEnabled()) + logger.debug(sessionTypeToString(sessionType) + ": Other party does not support ZRTP key negotiation protocol," + " no secure calls possible."); } @@ -353,7 +359,8 @@ public class SecurityEventManager extends ZrtpUserCallback @Override public void confirmGoClear() { - logger.debug(sessionTypeToString(sessionType) + if (logger.isDebugEnabled()) + logger.debug(sessionTypeToString(sessionType) + ": GoClear confirmation requested."); } diff --git a/src/net/java/sip/communicator/impl/netaddr/AddressDiagnosticsKit.java b/src/net/java/sip/communicator/impl/netaddr/AddressDiagnosticsKit.java index 918d3ef..4e2ace1 100644 --- a/src/net/java/sip/communicator/impl/netaddr/AddressDiagnosticsKit.java +++ b/src/net/java/sip/communicator/impl/netaddr/AddressDiagnosticsKit.java @@ -132,7 +132,8 @@ public class AddressDiagnosticsKit */ public void run() { - logger.debug("Started a diag kit for entry: " + addressEntry); + if (logger.isDebugEnabled()) + logger.debug("Started a diag kit for entry: " + addressEntry); //implements the algorithm from AssigningAddressPreferences.png @@ -204,7 +205,8 @@ public class AddressDiagnosticsKit stunClient = new StunClient(localStunAddress); stunClient.start(); - logger.debug("Successfully started StunClient for " + if (logger.isDebugEnabled()) + logger.debug("Successfully started StunClient for " + localStunAddress + "."); break; } @@ -213,9 +215,11 @@ public class AddressDiagnosticsKit if (ex.getCause() instanceof SocketException && i < bindRetries) { - logger.debug("Failed to bind to " + if (logger.isDebugEnabled()) + logger.debug("Failed to bind to " + localStunAddress + ". Retrying ..."); - logger.debug("Exception was ", ex); + if (logger.isDebugEnabled()) + logger.debug("Exception was ", ex); continue; } logger.error("Failed to start a stun client for address entry [" @@ -248,11 +252,13 @@ public class AddressDiagnosticsKit //server is down /** @todo if possible try another stun server here. we should * support multiple stun servers*/ - logger.debug("There seems to be no inet connectivity for " + if (logger.isDebugEnabled()) + logger.debug("There seems to be no inet connectivity for " + addressEntry); setDiagnosticsStatus(DIAGNOSTICS_STATUS_TERMINATED); stunClient.shutDown(); - logger.debug("stun test 1 failed"); + if (logger.isDebugEnabled()) + logger.debug("stun test 1 failed"); return; } @@ -301,7 +307,8 @@ public class AddressDiagnosticsKit + addressEntry.toString(), ex); setDiagnosticsStatus(DIAGNOSTICS_STATUS_TERMINATED); stunClient.shutDown(); - logger.debug("stun test 2 failed"); + if (logger.isDebugEnabled()) + logger.debug("stun test 2 failed"); return; } @@ -319,7 +326,8 @@ public class AddressDiagnosticsKit try { event = stunClient.doStunTestI(secondaryStunServerAddress); - logger.debug("stun test 1 succeeded with s server 2"); + if (logger.isDebugEnabled()) + logger.debug("stun test 1 succeeded with s server 2"); } catch (StunException ex) { @@ -350,7 +358,8 @@ public class AddressDiagnosticsKit if(!mappedAddrFromTestI.equals(mappedAddrFromSecServer)) { //secondary stun server is down - logger.debug("We are behind a symmetric nat" + if (logger.isDebugEnabled()) + logger.debug("We are behind a symmetric nat" + addressEntry.toString()); setDiagnosticsStatus(DIAGNOSTICS_STATUS_TERMINATED); stunClient.shutDown(); @@ -362,7 +371,8 @@ public class AddressDiagnosticsKit try { event = stunClient.doStunTestIII(primaryStunServerAddress); - logger.debug("stun test 3 succeeded with s server 1"); + if (logger.isDebugEnabled()) + logger.debug("stun test 3 succeeded with s server 1"); } catch (StunException ex) { @@ -375,14 +385,16 @@ public class AddressDiagnosticsKit if (event == null) { - logger.debug("We are behind a port restricted NAT or fw" + if (logger.isDebugEnabled()) + logger.debug("We are behind a port restricted NAT or fw" + addressEntry.toString()); setDiagnosticsStatus(DIAGNOSTICS_STATUS_TERMINATED); stunClient.shutDown(); return; } - logger.debug("We are behind a restricted NAT or fw" + if (logger.isDebugEnabled()) + logger.debug("We are behind a restricted NAT or fw" + addressEntry.toString()); setDiagnosticsStatus(DIAGNOSTICS_STATUS_TERMINATED); stunClient.shutDown(); diff --git a/src/net/java/sip/communicator/impl/netaddr/NetaddrActivator.java b/src/net/java/sip/communicator/impl/netaddr/NetaddrActivator.java index 1a585d6..f4cb7c9 100644 --- a/src/net/java/sip/communicator/impl/netaddr/NetaddrActivator.java +++ b/src/net/java/sip/communicator/impl/netaddr/NetaddrActivator.java @@ -56,12 +56,14 @@ public class NetaddrActivator // give references to the NetworkAddressManager implementation networkAMS.start(); - logger.info("Network Address Manager ...[ STARTED ]"); + if (logger.isInfoEnabled()) + logger.info("Network Address Manager ...[ STARTED ]"); bundleContext.registerService( NetworkAddressManagerService.class.getName(), networkAMS, null); - logger.info("Network Address Manager Service ...[REGISTERED]"); + if (logger.isInfoEnabled()) + logger.info("Network Address Manager Service ...[REGISTERED]"); } finally { @@ -99,6 +101,7 @@ public class NetaddrActivator { if(networkAMS != null) networkAMS.stop(); - logger.info("Network Address Manager Service ...[STOPPED]"); + if (logger.isInfoEnabled()) + logger.info("Network Address Manager Service ...[STOPPED]"); } } diff --git a/src/net/java/sip/communicator/impl/netaddr/NetworkAddressManagerServiceImpl.java b/src/net/java/sip/communicator/impl/netaddr/NetworkAddressManagerServiceImpl.java index 79f9dd9..260ddff 100644 --- a/src/net/java/sip/communicator/impl/netaddr/NetworkAddressManagerServiceImpl.java +++ b/src/net/java/sip/communicator/impl/netaddr/NetworkAddressManagerServiceImpl.java @@ -145,7 +145,8 @@ public class NetworkAddressManagerServiceImpl { useStun = false; - logger.info("Stun server address(" + if (logger.isInfoEnabled()) + logger.info("Stun server address(" +stunAddressStr+")/port(" +portStr +") not set (or invalid). Disabling STUN."); @@ -161,7 +162,8 @@ public class NetworkAddressManagerServiceImpl } catch (NumberFormatException ex) { - logger.info(portStr + " is not a valid port number. " + if (logger.isInfoEnabled()) + logger.info(portStr + " is not a valid port number. " +"Defaulting to 3478", ex); port = DEFAULT_STUN_SERVER_PORT; @@ -178,7 +180,8 @@ public class NetworkAddressManagerServiceImpl + stunAddressStr + ":" + port); } detector.start(); - logger.debug("STUN server detector started;"); + if (logger.isDebugEnabled()) + logger.debug("STUN server detector started;"); //make sure that someone doesn't set invalid stun address and port configurationService @@ -299,7 +302,8 @@ public class NetworkAddressManagerServiceImpl //better on windows so lets hope it'll do the trick. if( localHost.isAnyLocalAddress()) { - logger.trace("Socket returned the AnyLocalAddress. "+ + if (logger.isTraceEnabled()) + logger.trace("Socket returned the AnyLocalAddress. "+ "Trying a workaround."); try { @@ -469,7 +473,8 @@ public class NetworkAddressManagerServiceImpl { if (!useStun || (dst instanceof Inet6Address)) { - logger.debug( + if (logger.isDebugEnabled()) + logger.debug( "Stun is disabled for destination " + dst +", skipping mapped address recovery (useStun=" @@ -656,11 +661,13 @@ public class NetworkAddressManagerServiceImpl return null; } //port seems to be taken. try another one. - logger.debug("Port " + currentlyTriedPort + if (logger.isDebugEnabled()) + logger.debug("Port " + currentlyTriedPort + " seems in use."); currentlyTriedPort = NetworkUtils.getRandomPortNumber(); - logger.debug("Retrying bind on port " + if (logger.isDebugEnabled()) + logger.debug("Retrying bind on port " + currentlyTriedPort); } } @@ -689,7 +696,8 @@ public class NetworkAddressManagerServiceImpl if (stunAddress != null) { useStun = true; - logger.trace( + if (logger.isTraceEnabled()) + logger.trace( "StunServer check succeeded for server: " + detector.getServerAddress() + " and local port: " @@ -698,7 +706,8 @@ public class NetworkAddressManagerServiceImpl else { useStun = false; - logger.trace( + if (logger.isTraceEnabled()) + logger.trace( "StunServer check failed for server: " + detector.getServerAddress() + " and local port: " @@ -801,7 +810,8 @@ public class NetworkAddressManagerServiceImpl } catch (SocketException se) { - logger.info( + if (logger.isInfoEnabled()) + logger.info( "Retrying a bind because of a failure to bind to address " + laddr + " and port " + port, se); } diff --git a/src/net/java/sip/communicator/impl/notification/LogMessageNotificationHandlerImpl.java b/src/net/java/sip/communicator/impl/notification/LogMessageNotificationHandlerImpl.java index 2aef8b8..a10a632 100644 --- a/src/net/java/sip/communicator/impl/notification/LogMessageNotificationHandlerImpl.java +++ b/src/net/java/sip/communicator/impl/notification/LogMessageNotificationHandlerImpl.java @@ -58,9 +58,11 @@ public class LogMessageNotificationHandlerImpl if (logType.equals(LogMessageNotificationHandler.ERROR_LOG_TYPE)) logger.error(message); else if(logType.equals(LogMessageNotificationHandler.INFO_LOG_TYPE)) - logger.info(message); + if (logger.isInfoEnabled()) + logger.info(message); else if(logType.equals(LogMessageNotificationHandler.TRACE_LOG_TYPE)) - logger.trace(message); + if (logger.isTraceEnabled()) + logger.trace(message); } /** diff --git a/src/net/java/sip/communicator/impl/notification/NotificationActivator.java b/src/net/java/sip/communicator/impl/notification/NotificationActivator.java index 588f668..b958146 100644 --- a/src/net/java/sip/communicator/impl/notification/NotificationActivator.java +++ b/src/net/java/sip/communicator/impl/notification/NotificationActivator.java @@ -42,12 +42,14 @@ public class NotificationActivator NotificationService notificationService = new NotificationServiceImpl(); - logger.info("Notification Service...[ STARTED ]"); + if (logger.isInfoEnabled()) + logger.info("Notification Service...[ STARTED ]"); bundleContext.registerService(NotificationService.class.getName(), notificationService, null); - logger.info("Notification Service ...[REGISTERED]"); + if (logger.isInfoEnabled()) + logger.info("Notification Service ...[REGISTERED]"); logger.logEntry(); } @@ -58,7 +60,8 @@ public class NotificationActivator public void stop(BundleContext bc) throws Exception { - logger.info("UI Service ...[STOPPED]"); + if (logger.isInfoEnabled()) + logger.info("UI Service ...[STOPPED]"); } /** diff --git a/src/net/java/sip/communicator/impl/notification/NotificationServiceImpl.java b/src/net/java/sip/communicator/impl/notification/NotificationServiceImpl.java index 7621940..7932018 100644 --- a/src/net/java/sip/communicator/impl/notification/NotificationServiceImpl.java +++ b/src/net/java/sip/communicator/impl/notification/NotificationServiceImpl.java @@ -182,7 +182,8 @@ public class NotificationServiceImpl String actionDescriptor, String defaultMessage) { - logger.debug("Registering event " + eventType + "/" + + if (logger.isDebugEnabled()) + logger.debug("Registering event " + eventType + "/" + actionType + "/" + actionDescriptor + "/" + defaultMessage); if (actionType.equals(NotificationService.ACTION_SOUND)) @@ -756,7 +757,8 @@ public class NotificationServiceImpl private void fireNotificationEventTypeEvent(String eventType, String sourceEventType) { - logger.debug("Dispatching NotificationEventType Change. Listeners=" + if (logger.isDebugEnabled()) + logger.debug("Dispatching NotificationEventType Change. Listeners=" + changeListeners.size() + " evt=" + eventType); @@ -956,7 +958,8 @@ public class NotificationServiceImpl String actionDescriptor, String defaultMessage) { - logger.debug("Registering default event " + eventType + "/" + + if (logger.isDebugEnabled()) + logger.debug("Registering default event " + eventType + "/" + actionType + "/" + actionDescriptor + "/" + defaultMessage); if(isDefault(eventType, actionType)) |