From 89becff57dd710bc7b0cb8d91c7cda84ef764885 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Tue, 2 Jun 2015 13:05:56 +0200 Subject: [PATCH] Backed out 14 changesets (bug 1165515) for linux x64 e10s m2 test failures Backed out changeset d68dcf2ef372 (bug 1165515) Backed out changeset 7c3b45a47811 (bug 1165515) Backed out changeset b668b617bef2 (bug 1165515) Backed out changeset d0916e1283a2 (bug 1165515) Backed out changeset ac4dc7489942 (bug 1165515) Backed out changeset e9632ce8bc65 (bug 1165515) Backed out changeset c16d215cc7e4 (bug 1165515) Backed out changeset e4d474f3c51a (bug 1165515) Backed out changeset d87680bf9f7c (bug 1165515) Backed out changeset b3c0a45ba99e (bug 1165515) Backed out changeset 9370fa197674 (bug 1165515) Backed out changeset 50970d668ca1 (bug 1165515) Backed out changeset ffa4eb6d24b9 (bug 1165515) Backed out changeset 5fcf1203cc1d (bug 1165515) --- docshell/base/nsDocShell.cpp | 30 +- docshell/shistory/nsSHistory.cpp | 6 +- dom/base/ThirdPartyUtil.cpp | 2 +- dom/base/nsContentPolicy.cpp | 4 +- dom/base/nsDOMDataChannel.cpp | 2 +- dom/base/nsDocument.cpp | 26 +- dom/base/nsFocusManager.cpp | 20 +- dom/base/nsGlobalWindow.cpp | 14 +- dom/base/nsNodeInfoManager.cpp | 6 +- dom/base/nsObjectLoadingContent.cpp | 4 +- dom/camera/CameraCommon.h | 4 +- dom/events/IMEStateManager.cpp | 126 ++-- dom/html/HTMLMediaElement.cpp | 56 +- dom/html/HTMLTrackElement.cpp | 8 +- dom/indexedDB/ActorsParent.cpp | 2 +- dom/indexedDB/ProfilerHelpers.h | 4 +- dom/ipc/ProcessPriorityManager.cpp | 4 +- dom/media/AudioSink.cpp | 4 +- dom/media/AudioStream.cpp | 26 +- dom/media/GraphDriver.cpp | 56 +- dom/media/Latency.cpp | 6 +- dom/media/MediaCache.cpp | 58 +- dom/media/MediaDecoder.cpp | 2 +- dom/media/MediaDecoderReader.cpp | 2 +- dom/media/MediaDecoderStateMachine.cpp | 6 +- dom/media/MediaFormatReader.cpp | 4 +- dom/media/MediaManager.cpp | 2 +- dom/media/MediaManager.h | 2 +- dom/media/MediaPromise.h | 2 +- dom/media/MediaRecorder.cpp | 56 +- dom/media/MediaResource.cpp | 2 +- dom/media/MediaShutdownManager.cpp | 4 +- dom/media/MediaStreamGraph.cpp | 58 +- dom/media/MediaTimer.h | 2 +- dom/media/RtspMediaResource.cpp | 2 +- dom/media/StateMirroring.h | 2 +- dom/media/StateWatching.h | 2 +- dom/media/StreamBuffer.cpp | 6 +- dom/media/TrackUnionStream.cpp | 4 +- dom/media/WebVTTListener.cpp | 2 +- dom/media/apple/AppleMP3Reader.cpp | 6 +- dom/media/directshow/AudioSinkFilter.cpp | 2 +- dom/media/directshow/AudioSinkInputPin.cpp | 2 +- dom/media/directshow/DirectShowReader.cpp | 2 +- dom/media/directshow/SampleSink.cpp | 6 +- dom/media/directshow/SourceFilter.cpp | 2 +- dom/media/eme/EMEUtils.h | 6 +- dom/media/encoder/MediaEncoder.cpp | 40 +- dom/media/encoder/TrackEncoder.cpp | 4 +- dom/media/encoder/VP8TrackEncoder.cpp | 2 +- dom/media/encoder/VorbisTrackEncoder.cpp | 2 +- dom/media/fmp4/MP4Reader.cpp | 4 +- dom/media/gmp/GMPAudioDecoderParent.cpp | 2 +- dom/media/gmp/GMPChild.cpp | 2 +- dom/media/gmp/GMPContentParent.cpp | 2 +- dom/media/gmp/GMPParent.cpp | 2 +- dom/media/gmp/GMPService.cpp | 2 +- dom/media/gmp/GMPServiceChild.cpp | 2 +- dom/media/gmp/GMPServiceParent.cpp | 2 +- dom/media/gmp/GMPStorageParent.cpp | 2 +- dom/media/gmp/GMPTimerParent.cpp | 2 +- dom/media/gmp/GMPVideoDecoderParent.cpp | 6 +- dom/media/gmp/GMPVideoEncoderParent.cpp | 4 +- dom/media/gstreamer/GStreamerReader.cpp | 54 +- dom/media/imagecapture/ImageCapture.h | 2 +- dom/media/mediasource/ContainerParser.cpp | 2 +- dom/media/mediasource/MediaSource.cpp | 4 +- dom/media/mediasource/MediaSourceDecoder.cpp | 4 +- dom/media/mediasource/MediaSourceReader.cpp | 4 +- dom/media/mediasource/MediaSourceResource.h | 2 +- dom/media/mediasource/ResourceQueue.cpp | 4 +- dom/media/mediasource/SourceBuffer.cpp | 6 +- dom/media/mediasource/SourceBufferDecoder.cpp | 2 +- dom/media/mediasource/SourceBufferList.cpp | 4 +- .../mediasource/SourceBufferResource.cpp | 4 +- dom/media/mediasource/TrackBuffer.cpp | 2 +- dom/media/ogg/OggCodecState.cpp | 20 +- dom/media/ogg/OggReader.cpp | 44 +- dom/media/ogg/OpusParser.cpp | 40 +- dom/media/omx/AudioOffloadPlayer.cpp | 42 +- dom/media/omx/AudioOutput.cpp | 18 +- dom/media/omx/I420ColorConverterHelper.cpp | 2 +- dom/media/omx/MediaOmxCommonDecoder.cpp | 10 +- dom/media/omx/MediaOmxCommonReader.cpp | 4 +- dom/media/omx/OmxDecoder.cpp | 16 +- dom/media/platforms/apple/AppleATDecoder.cpp | 2 +- dom/media/platforms/apple/AppleCMLinker.cpp | 2 +- dom/media/platforms/apple/AppleVDADecoder.cpp | 2 +- dom/media/platforms/apple/AppleVDALinker.cpp | 2 +- dom/media/platforms/apple/AppleVTDecoder.cpp | 2 +- dom/media/platforms/apple/AppleVTLinker.cpp | 2 +- dom/media/platforms/ffmpeg/FFmpegLog.h | 2 +- .../gonk/GonkAudioDecoderManager.cpp | 2 +- .../platforms/gonk/GonkMediaDataDecoder.cpp | 2 +- .../gonk/GonkVideoDecoderManager.cpp | 2 +- dom/media/platforms/wmf/MFTDecoder.cpp | 2 +- .../platforms/wmf/WMFAudioMFTManager.cpp | 2 +- .../platforms/wmf/WMFMediaDataDecoder.cpp | 2 +- .../platforms/wmf/WMFVideoMFTManager.cpp | 2 +- dom/media/systemservices/LoadManager.cpp | 4 +- dom/media/systemservices/LoadMonitor.cpp | 6 +- dom/media/systemservices/MediaChild.cpp | 2 +- dom/media/systemservices/MediaParent.cpp | 2 +- dom/media/systemservices/OpenSLESProvider.cpp | 4 +- dom/media/wave/WaveReader.cpp | 2 +- dom/media/webm/IntelWebMVideoDecoder.cpp | 2 +- dom/media/webm/WebMReader.cpp | 26 +- .../webrtc/MediaEngineCameraVideoSource.cpp | 6 +- .../webrtc/MediaEngineGonkVideoSource.cpp | 4 +- dom/media/webrtc/MediaEngineWebRTC.cpp | 4 +- dom/media/webrtc/MediaEngineWebRTCAudio.cpp | 6 +- dom/media/webrtc/MediaEngineWebRTCVideo.cpp | 6 +- .../recognition/SpeechRecognition.cpp | 2 +- .../webspeech/recognition/SpeechRecognition.h | 2 +- dom/media/webspeech/synth/SpeechSynthesis.cpp | 2 +- dom/media/webspeech/synth/nsSpeechTask.cpp | 14 +- .../webspeech/synth/nsSynthVoiceRegistry.cpp | 22 +- dom/media/wmf/WMFByteStream.cpp | 2 +- dom/media/wmf/WMFReader.cpp | 2 +- dom/media/wmf/WMFSourceReaderCallback.cpp | 2 +- dom/network/UDPSocket.h | 6 +- dom/network/UDPSocketChild.cpp | 6 +- dom/network/UDPSocketParent.cpp | 6 +- dom/plugins/base/nsPluginLogging.h | 9 +- dom/plugins/ipc/PluginInstanceChild.cpp | 10 +- dom/plugins/ipc/PluginInstanceParent.cpp | 4 +- dom/plugins/ipc/PluginMessageUtils.h | 6 +- dom/plugins/ipc/PluginModuleParent.cpp | 2 +- dom/security/nsCSPContext.cpp | 4 +- dom/security/nsCSPParser.cpp | 4 +- dom/security/nsCSPService.cpp | 20 +- dom/security/nsCSPUtils.cpp | 4 +- dom/xslt/xslt/txExecutionState.cpp | 2 +- dom/xslt/xslt/txMozillaStylesheetCompiler.cpp | 2 +- dom/xslt/xslt/txMozillaXMLOutput.cpp | 6 +- dom/xslt/xslt/txStylesheet.cpp | 7 +- dom/xslt/xslt/txStylesheetCompiler.cpp | 14 +- dom/xul/XULDocument.cpp | 42 +- dom/xul/nsXULCommandDispatcher.cpp | 16 +- dom/xul/nsXULContentSink.cpp | 16 +- dom/xul/templates/nsContentTestNode.cpp | 7 +- dom/xul/templates/nsInstantiationNode.cpp | 2 +- .../templates/nsRDFConInstanceTestNode.cpp | 19 +- dom/xul/templates/nsRDFConMemberTestNode.cpp | 33 +- dom/xul/templates/nsRDFPropertyTestNode.cpp | 37 +- dom/xul/templates/nsRuleNetwork.cpp | 14 +- dom/xul/templates/nsXULContentBuilder.cpp | 18 +- dom/xul/templates/nsXULContentUtils.cpp | 2 +- dom/xul/templates/nsXULTemplateBuilder.cpp | 4 +- .../nsXULTemplateQueryProcessorRDF.cpp | 22 +- dom/xul/templates/nsXULTreeBuilder.cpp | 2 +- extensions/auth/nsAuth.h | 2 +- extensions/auth/nsAuthGSSAPI.cpp | 2 +- extensions/gio/nsGIOProtocolHandler.cpp | 2 +- .../pref/autoconfig/src/nsAutoConfig.cpp | 12 +- .../pref/autoconfig/src/nsReadConfig.cpp | 6 +- gfx/2d/Logging.h | 18 +- gfx/layers/Layers.cpp | 2 +- gfx/layers/LayersTypes.h | 4 +- gfx/thebes/gfxDWriteFontList.cpp | 16 +- gfx/thebes/gfxFT2FontList.cpp | 4 +- gfx/thebes/gfxFcPlatformFontList.cpp | 10 +- gfx/thebes/gfxFont.cpp | 6 +- gfx/thebes/gfxFontEntry.cpp | 4 +- gfx/thebes/gfxFontUtils.cpp | 2 +- gfx/thebes/gfxGDIFontList.cpp | 10 +- gfx/thebes/gfxMacPlatformFontList.mm | 10 +- gfx/thebes/gfxPlatformFontList.cpp | 16 +- gfx/thebes/gfxTextRun.cpp | 8 +- gfx/thebes/gfxUserFontSet.cpp | 4 +- hal/HalLog.h | 4 +- image/ImageLogging.h | 24 +- image/ProgressTracker.cpp | 4 +- image/RasterImage.cpp | 2 +- image/decoders/nsBMPDecoder.cpp | 10 +- image/decoders/nsJPEGDecoder.cpp | 38 +- image/decoders/nsPNGDecoder.cpp | 6 +- image/encoders/png/nsPNGEncoder.cpp | 4 +- image/imgLoader.cpp | 36 +- image/imgRequest.cpp | 16 +- image/imgRequestProxy.cpp | 6 +- ipc/chromium/src/base/logging.cc | 14 +- js/xpconnect/loader/mozJSComponentLoader.cpp | 2 +- js/xpconnect/src/XPCLog.cpp | 4 +- js/xpconnect/src/nsXPConnect.cpp | 2 +- layout/base/AccessibleCaretLogger.h | 4 +- layout/base/SelectionCarets.cpp | 4 +- layout/base/TouchCaret.cpp | 4 +- layout/base/nsDocumentViewer.cpp | 2 +- layout/base/nsPresContext.cpp | 2 +- layout/base/nsPresShell.cpp | 14 +- layout/base/nsRefreshDriver.cpp | 2 +- layout/generic/nsFlexContainerFrame.cpp | 14 +- layout/generic/nsPageFrame.cpp | 2 +- layout/generic/nsPluginFrame.cpp | 6 +- layout/generic/nsSimplePageSequenceFrame.cpp | 2 +- layout/printing/nsPrintData.cpp | 2 +- layout/printing/nsPrintEngine.cpp | 4 +- layout/style/FontFaceSet.cpp | 6 +- layout/style/Loader.cpp | 14 +- layout/style/nsFontFaceLoader.cpp | 6 +- media/libstagefright/binding/MoofParser.cpp | 2 +- media/mtransport/logging.h | 13 +- media/mtransport/nricectx.cpp | 6 +- media/mtransport/nrinterfaceprioritizer.cpp | 2 +- .../src/common/browser_logging/CSFLog.cpp | 6 +- .../src/common/browser_logging/CSFLog.h | 19 +- .../src/common/browser_logging/WebRtcLog.cpp | 4 +- .../src/media-conduit/AudioConduit.cpp | 8 +- .../src/media-conduit/WebrtcGmpVideoCodec.cpp | 6 +- .../src/peerconnection/PeerConnectionImpl.cpp | 2 +- modules/libjar/nsJARChannel.cpp | 4 +- netwerk/base/BackgroundFileSaver.cpp | 4 +- netwerk/base/Predictor.cpp | 2 +- netwerk/base/nsAsyncRedirectVerifyHelper.cpp | 2 +- netwerk/base/nsAsyncStreamCopier.cpp | 2 +- netwerk/base/nsAutodialWin.cpp | 6 +- netwerk/base/nsChannelClassifier.cpp | 2 +- netwerk/base/nsDirectoryIndexStream.cpp | 14 +- netwerk/base/nsInputStreamPump.cpp | 2 +- netwerk/base/nsLoadGroup.cpp | 14 +- netwerk/base/nsPACMan.cpp | 2 +- netwerk/base/nsProtocolProxyService.cpp | 2 +- netwerk/base/nsRequestObserverProxy.cpp | 2 +- netwerk/base/nsSecCheckWrapChannel.cpp | 6 +- netwerk/base/nsSocketTransportService2.h | 8 +- netwerk/base/nsStandardURL.cpp | 4 +- netwerk/cache/nsCache.cpp | 2 +- netwerk/cache/nsCache.h | 10 +- netwerk/cache/nsCacheService.cpp | 30 +- netwerk/cache/nsDiskCacheDevice.cpp | 4 +- netwerk/cache/nsDiskCacheDeviceSQL.cpp | 2 +- netwerk/cache2/CacheEntry.cpp | 4 + netwerk/cache2/CacheEntry.h | 2 + netwerk/cache2/CacheLog.cpp | 2 +- netwerk/cache2/CacheLog.h | 4 +- netwerk/cookie/nsCookieService.cpp | 112 +-- netwerk/dns/GetAddrInfo.cpp | 4 +- netwerk/dns/nsHostResolver.cpp | 2 +- netwerk/protocol/ftp/FTPChannelChild.cpp | 2 +- netwerk/protocol/ftp/FTPChannelParent.cpp | 2 +- .../protocol/ftp/nsFtpConnectionThread.cpp | 12 +- .../protocol/ftp/nsFtpControlConnection.cpp | 10 +- netwerk/protocol/ftp/nsFtpProtocolHandler.cpp | 4 +- netwerk/protocol/http/HttpBaseChannel.h | 4 +- netwerk/protocol/http/HttpLog.h | 22 +- netwerk/protocol/http/nsHttpConnectionInfo.h | 2 +- netwerk/protocol/res/nsResProtocolHandler.cpp | 7 +- .../rtsp/controller/RtspController.cpp | 2 +- .../rtsp/controller/RtspControllerChild.cpp | 2 +- .../rtsp/controller/RtspControllerParent.cpp | 2 +- netwerk/protocol/rtsp/rtsp/RtspPrlog.h | 8 +- netwerk/protocol/websocket/WebSocketLog.h | 2 +- netwerk/protocol/wyciwyg/nsWyciwyg.h | 18 +- netwerk/sctp/datachannel/DataChannel.cpp | 10 +- netwerk/sctp/datachannel/DataChannelLog.h | 2 +- netwerk/socket/nsSOCKSIOLayer.cpp | 7 +- .../converters/nsFTPDirListingConv.cpp | 12 +- .../linux/nsNotifyAddrListener_Linux.cpp | 2 +- netwerk/system/win32/nsNotifyAddrListener.cpp | 2 +- netwerk/test/TestBlockingSocket.cpp | 2 +- netwerk/test/TestIOThreads.cpp | 2 +- netwerk/test/TestOverlappedIO.cpp | 2 +- netwerk/test/TestProtocols.cpp | 2 +- netwerk/test/TestServ.cpp | 2 +- netwerk/test/TestSocketIO.cpp | 2 +- netwerk/test/TestSocketTransport.cpp | 2 +- netwerk/test/TestStreamChannel.cpp | 2 +- netwerk/test/TestStreamLoader.cpp | 2 +- netwerk/test/TestStreamPump.cpp | 2 +- netwerk/test/TestStreamTransport.cpp | 2 +- netwerk/test/TestUpload.cpp | 2 +- netwerk/wifi/nsWifiAccessPoint.cpp | 2 +- netwerk/wifi/nsWifiMonitor.h | 2 +- parser/htmlparser/nsExpatDriver.cpp | 16 +- rdf/base/nsInMemoryDataSource.cpp | 6 +- rdf/base/nsRDFContentSink.cpp | 16 +- rdf/base/nsRDFService.cpp | 30 +- rdf/base/nsRDFXMLDataSource.cpp | 24 +- security/apps/AppSignatureVerification.cpp | 2 +- security/certverifier/CertVerifier.cpp | 4 +- .../certverifier/NSSCertDBTrustDomain.cpp | 38 +- security/certverifier/OCSPCache.cpp | 4 +- security/certverifier/OCSPRequestor.cpp | 4 +- security/manager/ssl/CertBlocklist.cpp | 40 +- security/manager/ssl/PSMContentListener.cpp | 8 +- .../manager/ssl/PublicKeyPinningService.cpp | 24 +- .../ssl/RootCertificateTelemetryUtils.cpp | 4 +- .../manager/ssl/SSLServerCertVerification.cpp | 50 +- security/manager/ssl/nsCertTree.cpp | 14 +- security/manager/ssl/nsNSSCallbacks.cpp | 28 +- security/manager/ssl/nsNSSCertificate.cpp | 26 +- security/manager/ssl/nsNSSCertificateDB.cpp | 20 +- security/manager/ssl/nsNSSComponent.cpp | 70 +- security/manager/ssl/nsNSSIOLayer.cpp | 38 +- security/manager/ssl/nsNSSShutDown.cpp | 6 +- security/manager/ssl/nsNTLMAuthModule.cpp | 4 +- security/manager/ssl/nsPKCS11Slot.cpp | 6 +- security/manager/ssl/nsPKCS12Blob.cpp | 4 +- .../manager/ssl/nsSecureBrowserUIImpl.cpp | 76 +-- .../manager/ssl/nsSecurityHeaderParser.cpp | 2 +- .../manager/ssl/nsSiteSecurityService.cpp | 2 +- security/manager/ssl/nsUsageArrayHelper.cpp | 2 +- storage/VacuumManager.cpp | 4 +- storage/mozStorageAsyncStatement.cpp | 10 +- storage/mozStorageConnection.cpp | 14 +- storage/mozStorageStatement.cpp | 20 +- .../downloads/ApplicationReputation.cpp | 4 +- .../filewatcher/NativeFileWatcherWin.cpp | 2 +- .../components/url-classifier/Classifier.cpp | 4 +- .../components/url-classifier/HashStore.cpp | 4 +- .../components/url-classifier/LookupCache.cpp | 4 +- .../url-classifier/ProtocolParser.cpp | 4 +- .../nsUrlClassifierDBService.cpp | 4 +- .../nsUrlClassifierPrefixSet.cpp | 4 +- .../nsUrlClassifierStreamUpdater.cpp | 2 +- toolkit/xre/nsUpdateDriver.cpp | 2 +- uriloader/base/nsDocLoader.cpp | 44 +- uriloader/base/nsURILoader.cpp | 6 +- .../exthandler/mac/nsOSHelperAppService.mm | 10 +- .../exthandler/nsExternalHelperAppService.cpp | 18 +- .../exthandler/unix/nsOSHelperAppService.cpp | 4 +- .../exthandler/win/nsOSHelperAppService.cpp | 2 +- .../prefetch/OfflineCacheUpdateChild.cpp | 6 +- uriloader/prefetch/OfflineCacheUpdateGlue.cpp | 6 +- .../prefetch/OfflineCacheUpdateParent.cpp | 6 +- uriloader/prefetch/nsOfflineCacheUpdate.cpp | 6 +- .../prefetch/nsOfflineCacheUpdateService.cpp | 6 +- uriloader/prefetch/nsPrefetchService.cpp | 6 +- widget/cocoa/NativeKeyBindings.mm | 20 +- widget/cocoa/TextInputHandler.mm | 180 ++--- widget/cocoa/nsChildView.mm | 10 +- widget/cocoa/nsClipboard.mm | 3 +- widget/cocoa/nsDragService.mm | 2 +- widget/gtk/nsDeviceContextSpecG.cpp | 2 +- widget/gtk/nsDragService.cpp | 140 ++-- widget/gtk/nsGtkIMModule.cpp | 182 ++--- widget/gtk/nsGtkKeyUtils.cpp | 56 +- widget/gtk/nsIdleServiceGTK.cpp | 12 +- widget/gtk/nsWindow.h | 8 +- widget/nsIdleService.cpp | 60 +- widget/qt/nsDeviceContextSpecQt.cpp | 2 +- widget/qt/nsWindow.h | 8 +- widget/windows/KeyboardLayout.cpp | 6 +- widget/windows/WinMouseScrollHandler.cpp | 120 ++-- widget/windows/WinUtils.cpp | 4 +- widget/windows/nsClipboard.cpp | 28 +- widget/windows/nsDataObj.cpp | 2 +- widget/windows/nsDeviceContextSpecWin.cpp | 2 +- widget/windows/nsIMM32Handler.cpp | 228 +++---- widget/windows/nsNativeThemeWin.cpp | 4 +- widget/windows/nsSound.cpp | 6 +- widget/windows/nsTextStore.cpp | 636 +++++++++--------- widget/windows/nsWinGesture.cpp | 2 +- widget/windows/nsWindow.cpp | 56 +- widget/windows/nsWindowDbg.cpp | 6 +- widget/windows/nsWindowDbg.h | 2 +- widget/xremoteclient/XRemoteClient.cpp | 54 +- xpcom/base/nsDebugImpl.cpp | 10 +- xpcom/build/perfprobe.cpp | 2 +- xpcom/components/nsComponentManager.cpp | 24 +- xpcom/components/nsNativeModuleLoader.cpp | 8 +- xpcom/ds/TimeStamp_windows.cpp | 4 +- xpcom/ds/nsObserverService.cpp | 4 +- xpcom/glue/Logging.h | 52 +- xpcom/io/nsInputStreamTee.cpp | 2 +- xpcom/io/nsPipe3.cpp | 2 +- xpcom/io/nsStorageStream.cpp | 4 +- xpcom/threads/TimerThread.cpp | 14 +- xpcom/threads/nsEventQueue.cpp | 2 +- xpcom/threads/nsThread.cpp | 2 +- xpcom/threads/nsThreadPool.cpp | 2 +- xpcom/threads/nsTimerImpl.cpp | 28 +- 373 files changed, 2549 insertions(+), 2624 deletions(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 9a13657eefbd..d2800131f816 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -926,7 +926,7 @@ nsDocShell::nsDocShell() gDocShellLeakLog = PR_NewLogModule("nsDocShellLeak"); } if (gDocShellLeakLog) { - MOZ_LOG(gDocShellLeakLog, LogLevel::Debug, ("DOCSHELL %p created\n", this)); + MOZ_LOG(gDocShellLeakLog, PR_LOG_DEBUG, ("DOCSHELL %p created\n", this)); } #ifdef DEBUG @@ -958,7 +958,7 @@ nsDocShell::~nsDocShell() } if (gDocShellLeakLog) { - MOZ_LOG(gDocShellLeakLog, LogLevel::Debug, ("DOCSHELL %p destroyed\n", this)); + MOZ_LOG(gDocShellLeakLog, PR_LOG_DEBUG, ("DOCSHELL %p destroyed\n", this)); } #ifdef DEBUG @@ -1095,7 +1095,7 @@ nsDocShell::GetInterface(const nsIID& aIID, void** aSink) } #if defined(DEBUG) - MOZ_LOG(gDocShellLog, LogLevel::Debug, + MOZ_LOG(gDocShellLog, PR_LOG_DEBUG, ("nsDocShell[%p]: returning app cache container %p", this, domDoc.get())); #endif @@ -1418,10 +1418,10 @@ nsDocShell::LoadURI(nsIURI* aURI, } #if defined(DEBUG) - if (MOZ_LOG_TEST(gDocShellLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) { nsAutoCString uristr; aURI->GetAsciiSpec(uristr); - MOZ_LOG(gDocShellLog, LogLevel::Debug, + MOZ_LOG(gDocShellLog, PR_LOG_DEBUG, ("nsDocShell[%p]: loading %s with flags 0x%08x", this, uristr.get(), aLoadFlags)); } @@ -1540,7 +1540,7 @@ nsDocShell::LoadURI(nsIURI* aURI, if (shEntry) { #ifdef DEBUG - MOZ_LOG(gDocShellLog, LogLevel::Debug, + MOZ_LOG(gDocShellLog, PR_LOG_DEBUG, ("nsDocShell[%p]: loading from session history", this)); #endif @@ -1980,7 +1980,7 @@ bool nsDocShell::SetCurrentURI(nsIURI* aURI, nsIRequest* aRequest, bool aFireOnLocationChange, uint32_t aLocationFlags) { - if (gDocShellLeakLog && MOZ_LOG_TEST(gDocShellLeakLog, LogLevel::Debug)) { + if (gDocShellLeakLog && PR_LOG_TEST(gDocShellLeakLog, PR_LOG_DEBUG)) { nsAutoCString spec; if (aURI) { aURI->GetSpec(spec); @@ -5302,7 +5302,7 @@ nsDocShell::LoadErrorPage(nsIURI* aURI, const char16_t* aURL, nsIChannel* aFailedChannel) { #if defined(DEBUG) - if (MOZ_LOG_TEST(gDocShellLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) { nsAutoCString spec; aURI->GetSpec(spec); @@ -5313,7 +5313,7 @@ nsDocShell::LoadErrorPage(nsIURI* aURI, const char16_t* aURL, chanName.AssignLiteral(""); } - MOZ_LOG(gDocShellLog, LogLevel::Debug, + MOZ_LOG(gDocShellLog, PR_LOG_DEBUG, ("nsDocShell[%p]::LoadErrorPage(\"%s\", \"%s\", {...}, [%s])\n", this, spec.get(), NS_ConvertUTF16toUTF8(aURL).get(), chanName.get())); } @@ -9606,7 +9606,7 @@ nsDocShell::InternalLoad(nsIURI* aURI, nsresult rv = NS_OK; mOriginalUriString.Truncate(); - if (gDocShellLeakLog && MOZ_LOG_TEST(gDocShellLeakLog, LogLevel::Debug)) { + if (gDocShellLeakLog && PR_LOG_TEST(gDocShellLeakLog, PR_LOG_DEBUG)) { nsAutoCString spec; if (aURI) { aURI->GetSpec(spec); @@ -11165,7 +11165,7 @@ nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel, nsISupports* aOwner, NS_PRECONDITION(!aChannel || !aOwner, "Shouldn't have both set"); #if defined(DEBUG) - if (MOZ_LOG_TEST(gDocShellLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) { nsAutoCString spec; aURI->GetSpec(spec); @@ -11176,7 +11176,7 @@ nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel, nsISupports* aOwner, chanName.AssignLiteral(""); } - MOZ_LOG(gDocShellLog, LogLevel::Debug, + MOZ_LOG(gDocShellLog, PR_LOG_DEBUG, ("nsDocShell[%p]::OnNewURI(\"%s\", [%s], 0x%x)\n", this, spec.get(), chanName.get(), aLoadType)); } @@ -11241,7 +11241,7 @@ nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel, nsISupports* aOwner, // XXX This log message is almost useless because |updateSHistory| // and |updateGHistory| are not correct at this point. - MOZ_LOG(gDocShellLog, LogLevel::Debug, + MOZ_LOG(gDocShellLog, PR_LOG_DEBUG, (" shAvailable=%i updateSHistory=%i updateGHistory=%i" " equalURI=%i\n", shAvailable, updateSHistory, updateGHistory, equalUri)); @@ -11785,7 +11785,7 @@ nsDocShell::AddToSessionHistory(nsIURI* aURI, nsIChannel* aChannel, NS_PRECONDITION(!aChannel || !aOwner, "Shouldn't have both set"); #if defined(DEBUG) - if (MOZ_LOG_TEST(gDocShellLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gDocShellLog, PR_LOG_DEBUG)) { nsAutoCString spec; aURI->GetSpec(spec); @@ -11796,7 +11796,7 @@ nsDocShell::AddToSessionHistory(nsIURI* aURI, nsIChannel* aChannel, chanName.AssignLiteral(""); } - MOZ_LOG(gDocShellLog, LogLevel::Debug, + MOZ_LOG(gDocShellLog, PR_LOG_DEBUG, ("nsDocShell[%p]::AddToSessionHistory(\"%s\", [%s])\n", this, spec.get(), chanName.get())); } diff --git a/docshell/shistory/nsSHistory.cpp b/docshell/shistory/nsSHistory.cpp index 90f7b128fdeb..66ef3c908320 100644 --- a/docshell/shistory/nsSHistory.cpp +++ b/docshell/shistory/nsSHistory.cpp @@ -68,7 +68,7 @@ GetSHistoryLog() } return sLog; } -#define LOG(format) MOZ_LOG(GetSHistoryLog(), mozilla::LogLevel::Debug, format) +#define LOG(format) MOZ_LOG(GetSHistoryLog(), PR_LOG_DEBUG, format) // This macro makes it easier to print a log message which includes a URI's // spec. Example use: @@ -78,7 +78,7 @@ GetSHistoryLog() // #define LOG_SPEC(format, uri) \ PR_BEGIN_MACRO \ - if (MOZ_LOG_TEST(GetSHistoryLog(), LogLevel::Debug)) { \ + if (PR_LOG_TEST(GetSHistoryLog(), PR_LOG_DEBUG)) { \ nsAutoCString _specStr(NS_LITERAL_CSTRING("(null)"));\ if (uri) { \ uri->GetSpec(_specStr); \ @@ -96,7 +96,7 @@ GetSHistoryLog() // #define LOG_SHENTRY_SPEC(format, shentry) \ PR_BEGIN_MACRO \ - if (MOZ_LOG_TEST(GetSHistoryLog(), LogLevel::Debug)) { \ + if (PR_LOG_TEST(GetSHistoryLog(), PR_LOG_DEBUG)) { \ nsCOMPtr uri; \ shentry->GetURI(getter_AddRefs(uri)); \ LOG_SPEC(format, uri); \ diff --git a/dom/base/ThirdPartyUtil.cpp b/dom/base/ThirdPartyUtil.cpp index bb3fdc8f50d1..903100ccf05b 100644 --- a/dom/base/ThirdPartyUtil.cpp +++ b/dom/base/ThirdPartyUtil.cpp @@ -23,7 +23,7 @@ NS_IMPL_ISUPPORTS(ThirdPartyUtil, mozIThirdPartyUtil) // static PRLogModuleInfo *gThirdPartyLog; #undef LOG -#define LOG(args) MOZ_LOG(gThirdPartyLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gThirdPartyLog, PR_LOG_DEBUG, args) nsresult ThirdPartyUtil::Init() diff --git a/dom/base/nsContentPolicy.cpp b/dom/base/nsContentPolicy.cpp index b95cc66ca1d0..9ade049763e2 100644 --- a/dom/base/nsContentPolicy.cpp +++ b/dom/base/nsContentPolicy.cpp @@ -188,7 +188,7 @@ nsContentPolicy::CheckPolicy(CPMethod policyMethod, #define LOG_CHECK(logType) \ PR_BEGIN_MACRO \ /* skip all this nonsense if the call failed or logging is disabled */ \ - if (NS_SUCCEEDED(rv) && MOZ_LOG_TEST(gConPolLog, LogLevel::Debug)) { \ + if (NS_SUCCEEDED(rv) && PR_LOG_TEST(gConPolLog, PR_LOG_DEBUG)) { \ const char *resultName; \ if (decision) { \ resultName = NS_CP_ResponseName(*decision); \ @@ -203,7 +203,7 @@ nsContentPolicy::CheckPolicy(CPMethod policyMethod, if (requestingLocation) { \ requestingLocation->GetSpec(refSpec); \ } \ - MOZ_LOG(gConPolLog, LogLevel::Debug, \ + MOZ_LOG(gConPolLog, PR_LOG_DEBUG, \ ("Content Policy: " logType ": <%s> result=%s", \ spec.get(), refSpec.get(), resultName) \ ); \ diff --git a/dom/base/nsDOMDataChannel.cpp b/dom/base/nsDOMDataChannel.cpp index 919dfbd08419..b783cbaf272a 100644 --- a/dom/base/nsDOMDataChannel.cpp +++ b/dom/base/nsDOMDataChannel.cpp @@ -11,7 +11,7 @@ extern PRLogModuleInfo* GetDataChannelLog(); #undef LOG -#define LOG(args) MOZ_LOG(GetDataChannelLog(), mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(GetDataChannelLog(), PR_LOG_DEBUG, args) #include "nsDOMDataChannelDeclarations.h" diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index d8c95909cefe..cbd300e139da 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -1595,7 +1595,7 @@ nsDocument::nsDocument(const char* aContentType) gDocumentLeakPRLog = PR_NewLogModule("DocumentLeak"); if (gDocumentLeakPRLog) - MOZ_LOG(gDocumentLeakPRLog, LogLevel::Debug, + MOZ_LOG(gDocumentLeakPRLog, PR_LOG_DEBUG, ("DOCUMENT %p created", this)); if (!gCspPRLog) @@ -1639,7 +1639,7 @@ nsIDocument::~nsIDocument() nsDocument::~nsDocument() { if (gDocumentLeakPRLog) - MOZ_LOG(gDocumentLeakPRLog, LogLevel::Debug, + MOZ_LOG(gDocumentLeakPRLog, PR_LOG_DEBUG, ("DOCUMENT %p destroyed", this)); NS_ASSERTION(!mIsShowing, "Destroying a currently-showing document"); @@ -2305,7 +2305,7 @@ nsDocument::ResetToURI(nsIURI *aURI, nsILoadGroup *aLoadGroup, { NS_PRECONDITION(aURI, "Null URI passed to ResetToURI"); - if (gDocumentLeakPRLog && MOZ_LOG_TEST(gDocumentLeakPRLog, LogLevel::Debug)) { + if (gDocumentLeakPRLog && PR_LOG_TEST(gDocumentLeakPRLog, PR_LOG_DEBUG)) { nsAutoCString spec; aURI->GetSpec(spec); PR_LogPrint("DOCUMENT %p ResetToURI %s", this, spec.get()); @@ -2638,7 +2638,7 @@ nsDocument::StartDocumentLoad(const char* aCommand, nsIChannel* aChannel, nsIStreamListener **aDocListener, bool aReset, nsIContentSink* aSink) { - if (gDocumentLeakPRLog && MOZ_LOG_TEST(gDocumentLeakPRLog, LogLevel::Debug)) { + if (gDocumentLeakPRLog && PR_LOG_TEST(gDocumentLeakPRLog, PR_LOG_DEBUG)) { nsCOMPtr uri; aChannel->GetURI(getter_AddRefs(uri)); nsAutoCString spec; @@ -2773,7 +2773,7 @@ AppendCSPFromHeader(nsIContentSecurityPolicy* csp, rv = csp->AppendPolicy(policy, aReportOnly); NS_ENSURE_SUCCESS(rv, rv); { - MOZ_LOG(gCspPRLog, LogLevel::Debug, + MOZ_LOG(gCspPRLog, PR_LOG_DEBUG, ("CSP refined with policy: \"%s\"", NS_ConvertUTF16toUTF8(policy).get())); } @@ -2813,7 +2813,7 @@ nsDocument::InitCSP(nsIChannel* aChannel) { nsCOMPtr csp; if (!CSPService::sCSPEnabled) { - MOZ_LOG(gCspPRLog, LogLevel::Debug, + MOZ_LOG(gCspPRLog, PR_LOG_DEBUG, ("CSP is disabled, skipping CSP init for document %p", this)); return NS_OK; } @@ -2866,12 +2866,12 @@ nsDocument::InitCSP(nsIChannel* aChannel) !applyLoopCSP && cspHeaderValue.IsEmpty() && cspROHeaderValue.IsEmpty()) { - if (MOZ_LOG_TEST(gCspPRLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gCspPRLog, PR_LOG_DEBUG)) { nsCOMPtr chanURI; aChannel->GetURI(getter_AddRefs(chanURI)); nsAutoCString aspec; chanURI->GetAsciiSpec(aspec); - MOZ_LOG(gCspPRLog, LogLevel::Debug, + MOZ_LOG(gCspPRLog, PR_LOG_DEBUG, ("no CSP for document, %s, %s", aspec.get(), applyAppDefaultCSP ? "is app" : "not an app")); @@ -2880,7 +2880,7 @@ nsDocument::InitCSP(nsIChannel* aChannel) return NS_OK; } - MOZ_LOG(gCspPRLog, LogLevel::Debug, ("Document is an app or CSP header specified %p", this)); + MOZ_LOG(gCspPRLog, PR_LOG_DEBUG, ("Document is an app or CSP header specified %p", this)); nsresult rv; @@ -2899,7 +2899,7 @@ nsDocument::InitCSP(nsIChannel* aChannel) NS_ENSURE_SUCCESS(rv, rv); if (csp) { - MOZ_LOG(gCspPRLog, LogLevel::Debug, ("%s %s %s", + MOZ_LOG(gCspPRLog, PR_LOG_DEBUG, ("%s %s %s", "This document is sharing principal with another document.", "Since the document is an app, CSP was already set.", "Skipping attempt to set CSP.")); @@ -2910,7 +2910,7 @@ nsDocument::InitCSP(nsIChannel* aChannel) csp = do_CreateInstance("@mozilla.org/cspcontext;1", &rv); if (NS_FAILED(rv)) { - MOZ_LOG(gCspPRLog, LogLevel::Debug, ("Failed to create CSP object: %x", rv)); + MOZ_LOG(gCspPRLog, PR_LOG_DEBUG, ("Failed to create CSP object: %x", rv)); return rv; } @@ -2963,7 +2963,7 @@ nsDocument::InitCSP(nsIChannel* aChannel) rv = csp->PermitsAncestry(docShell, &safeAncestry); if (NS_FAILED(rv) || !safeAncestry) { - MOZ_LOG(gCspPRLog, LogLevel::Debug, + MOZ_LOG(gCspPRLog, PR_LOG_DEBUG, ("CSP doesn't like frame's ancestry, not loading.")); // stop! ERROR page! aChannel->Cancel(NS_ERROR_CSP_FRAME_ANCESTOR_VIOLATION); @@ -2988,7 +2988,7 @@ nsDocument::InitCSP(nsIChannel* aChannel) rv = principal->SetCsp(csp); NS_ENSURE_SUCCESS(rv, rv); - MOZ_LOG(gCspPRLog, LogLevel::Debug, + MOZ_LOG(gCspPRLog, PR_LOG_DEBUG, ("Inserted CSP into principal %p", principal)); return NS_OK; diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp index aacdaf57e4ea..95d8602b0b98 100644 --- a/dom/base/nsFocusManager.cpp +++ b/dom/base/nsFocusManager.cpp @@ -77,16 +77,16 @@ using namespace mozilla::widget; PRLogModuleInfo* gFocusLog; PRLogModuleInfo* gFocusNavigationLog; -#define LOGFOCUS(args) MOZ_LOG(gFocusLog, mozilla::LogLevel::Debug, args) -#define LOGFOCUSNAVIGATION(args) MOZ_LOG(gFocusNavigationLog, mozilla::LogLevel::Debug, args) +#define LOGFOCUS(args) MOZ_LOG(gFocusLog, PR_LOG_DEBUG, args) +#define LOGFOCUSNAVIGATION(args) MOZ_LOG(gFocusNavigationLog, PR_LOG_DEBUG, args) #define LOGTAG(log, format, content) \ - if (MOZ_LOG_TEST(log, LogLevel::Debug)) { \ + if (PR_LOG_TEST(log, PR_LOG_DEBUG)) { \ nsAutoCString tag(NS_LITERAL_CSTRING("(none)")); \ if (content) { \ content->NodeInfo()->NameAtom()->ToUTF8String(tag); \ } \ - MOZ_LOG(log, LogLevel::Debug, (format, tag.get())); \ + MOZ_LOG(log, PR_LOG_DEBUG, (format, tag.get())); \ } #define LOGCONTENT(format, content) LOGTAG(gFocusLog, format, content) @@ -482,7 +482,7 @@ nsFocusManager::MoveFocus(nsIDOMWindow* aWindow, nsIDOMElement* aStartElement, LOGFOCUS(("<>", aType, aFlags)); - if (MOZ_LOG_TEST(gFocusLog, LogLevel::Debug) && mFocusedWindow) { + if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG) && mFocusedWindow) { nsIDocument* doc = mFocusedWindow->GetExtantDoc(); if (doc && doc->GetDocumentURI()) { nsAutoCString spec; @@ -638,7 +638,7 @@ nsFocusManager::WindowRaised(nsIDOMWindow* aWindow) nsCOMPtr window = do_QueryInterface(aWindow); NS_ENSURE_TRUE(window && window->IsOuterWindow(), NS_ERROR_INVALID_ARG); - if (MOZ_LOG_TEST(gFocusLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) { LOGFOCUS(("Window %p Raised [Currently: %p %p]", aWindow, mActiveWindow.get(), mFocusedWindow.get())); nsAutoCString spec; nsIDocument* doc = window->GetExtantDoc(); @@ -734,7 +734,7 @@ nsFocusManager::WindowLowered(nsIDOMWindow* aWindow) nsCOMPtr window = do_QueryInterface(aWindow); NS_ENSURE_TRUE(window && window->IsOuterWindow(), NS_ERROR_INVALID_ARG); - if (MOZ_LOG_TEST(gFocusLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) { LOGFOCUS(("Window %p Lowered [Currently: %p %p]", aWindow, mActiveWindow.get(), mFocusedWindow.get())); nsAutoCString spec; nsIDocument* doc = window->GetExtantDoc(); @@ -852,7 +852,7 @@ nsFocusManager::WindowShown(nsIDOMWindow* aWindow, bool aNeedsFocus) window = window->GetOuterWindow(); - if (MOZ_LOG_TEST(gFocusLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) { LOGFOCUS(("Window %p Shown [Currently: %p %p]", window.get(), mActiveWindow.get(), mFocusedWindow.get())); nsAutoCString spec; nsIDocument* doc = window->GetExtantDoc(); @@ -907,7 +907,7 @@ nsFocusManager::WindowHidden(nsIDOMWindow* aWindow) window = window->GetOuterWindow(); - if (MOZ_LOG_TEST(gFocusLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) { LOGFOCUS(("Window %p Hidden [Currently: %p %p]", window.get(), mActiveWindow.get(), mFocusedWindow.get())); nsAutoCString spec; nsIDocument* doc = window->GetExtantDoc(); @@ -1777,7 +1777,7 @@ nsFocusManager::Focus(nsPIDOMWindow* aWindow, LOGCONTENT("Element %s has been focused", aContent); - if (MOZ_LOG_TEST(gFocusLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) { nsIDocument* docm = aWindow->GetExtantDoc(); if (docm) { LOGCONTENT(" from %s", docm->GetRootElement()); diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index f3aeeb1e3c13..4ad5c89209e0 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -1211,7 +1211,7 @@ nsGlobalWindow::nsGlobalWindow(nsGlobalWindow *aOuterWindow) #endif if (gDOMLeakPRLog) - MOZ_LOG(gDOMLeakPRLog, LogLevel::Debug, + MOZ_LOG(gDOMLeakPRLog, PR_LOG_DEBUG, ("DOMWINDOW %p created outer=%p", this, aOuterWindow)); NS_ASSERTION(sWindowsById, "Windows hash table must be created!"); @@ -1301,7 +1301,7 @@ nsGlobalWindow::~nsGlobalWindow() #endif if (gDOMLeakPRLog) - MOZ_LOG(gDOMLeakPRLog, LogLevel::Debug, + MOZ_LOG(gDOMLeakPRLog, PR_LOG_DEBUG, ("DOMWINDOW %p destroyed", this)); if (IsOuterWindow()) { @@ -2804,7 +2804,7 @@ nsGlobalWindow::InnerSetNewDocument(JSContext* aCx, nsIDocument* aDocument) NS_PRECONDITION(IsInnerWindow(), "Must only be called on inner windows"); MOZ_ASSERT(aDocument); - if (gDOMLeakPRLog && MOZ_LOG_TEST(gDOMLeakPRLog, LogLevel::Debug)) { + if (gDOMLeakPRLog && PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) { nsIURI *uri = aDocument->GetDocumentURI(); nsAutoCString spec; if (uri) @@ -10558,7 +10558,7 @@ nsGlobalWindow::GetSessionStorage(ErrorResult& aError) } if (mSessionStorage) { - if (MOZ_LOG_TEST(gDOMLeakPRLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) { PR_LogPrint("nsGlobalWindow %p has %p sessionStorage", this, mSessionStorage.get()); } bool canAccess = mSessionStorage->CanAccess(principal); @@ -10609,7 +10609,7 @@ nsGlobalWindow::GetSessionStorage(ErrorResult& aError) mSessionStorage = static_cast(storage.get()); MOZ_ASSERT(mSessionStorage); - if (MOZ_LOG_TEST(gDOMLeakPRLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) { PR_LogPrint("nsGlobalWindow %p tried to get a new sessionStorage %p", this, mSessionStorage.get()); } @@ -10619,7 +10619,7 @@ nsGlobalWindow::GetSessionStorage(ErrorResult& aError) } } - if (MOZ_LOG_TEST(gDOMLeakPRLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) { PR_LogPrint("nsGlobalWindow %p returns %p sessionStorage", this, mSessionStorage.get()); } @@ -11537,7 +11537,7 @@ nsGlobalWindow::Observe(nsISupports* aSubject, const char* aTopic, return NS_OK; } - if (MOZ_LOG_TEST(gDOMLeakPRLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) { PR_LogPrint("nsGlobalWindow %p with sessionStorage %p passing event from %p", this, mSessionStorage.get(), changingStorage.get()); } diff --git a/dom/base/nsNodeInfoManager.cpp b/dom/base/nsNodeInfoManager.cpp index 5d850daa093a..fbdcdf95c7b7 100644 --- a/dom/base/nsNodeInfoManager.cpp +++ b/dom/base/nsNodeInfoManager.cpp @@ -119,7 +119,7 @@ nsNodeInfoManager::nsNodeInfoManager() gNodeInfoManagerLeakPRLog = PR_NewLogModule("NodeInfoManagerLeak"); if (gNodeInfoManagerLeakPRLog) - MOZ_LOG(gNodeInfoManagerLeakPRLog, LogLevel::Debug, + MOZ_LOG(gNodeInfoManagerLeakPRLog, PR_LOG_DEBUG, ("NODEINFOMANAGER %p created", this)); mNodeInfoHash = PL_NewHashTable(32, GetNodeInfoInnerHashValue, @@ -139,7 +139,7 @@ nsNodeInfoManager::~nsNodeInfoManager() mBindingManager = nullptr; if (gNodeInfoManagerLeakPRLog) - MOZ_LOG(gNodeInfoManagerLeakPRLog, LogLevel::Debug, + MOZ_LOG(gNodeInfoManagerLeakPRLog, PR_LOG_DEBUG, ("NODEINFOMANAGER %p destroyed", this)); nsLayoutStatics::Release(); @@ -196,7 +196,7 @@ nsNodeInfoManager::Init(nsIDocument *aDocument) mDocument = aDocument; if (gNodeInfoManagerLeakPRLog) - MOZ_LOG(gNodeInfoManagerLeakPRLog, LogLevel::Debug, + MOZ_LOG(gNodeInfoManagerLeakPRLog, PR_LOG_DEBUG, ("NODEINFOMANAGER %p Init document=%p", this, aDocument)); return NS_OK; diff --git a/dom/base/nsObjectLoadingContent.cpp b/dom/base/nsObjectLoadingContent.cpp index 5124a51e0f39..6c994c4a88f1 100644 --- a/dom/base/nsObjectLoadingContent.cpp +++ b/dom/base/nsObjectLoadingContent.cpp @@ -116,8 +116,8 @@ GetObjectLog() return sLog; } -#define LOG(args) MOZ_LOG(GetObjectLog(), mozilla::LogLevel::Debug, args) -#define LOG_ENABLED() MOZ_LOG_TEST(GetObjectLog(), mozilla::LogLevel::Debug) +#define LOG(args) MOZ_LOG(GetObjectLog(), PR_LOG_DEBUG, args) +#define LOG_ENABLED() PR_LOG_TEST(GetObjectLog(), PR_LOG_DEBUG) static bool IsJavaMIME(const nsACString & aMIMEType) diff --git a/dom/camera/CameraCommon.h b/dom/camera/CameraCommon.h index ac383c5aee97..8f59ab79be22 100644 --- a/dom/camera/CameraCommon.h +++ b/dom/camera/CameraCommon.h @@ -18,9 +18,9 @@ #include "mozilla/Logging.h" extern PRLogModuleInfo* GetCameraLog(); -#define DOM_CAMERA_LOG( type, ... ) MOZ_LOG(GetCameraLog(), (mozilla::LogLevel)type, ( __VA_ARGS__ )) +#define DOM_CAMERA_LOG( type, ... ) MOZ_LOG(GetCameraLog(), (PRLogModuleLevel)type, ( __VA_ARGS__ )) -#define DOM_CAMERA_LOGA( ... ) DOM_CAMERA_LOG( mozilla::LogLevel::Error, __VA_ARGS__ ) +#define DOM_CAMERA_LOGA( ... ) DOM_CAMERA_LOG( 0, __VA_ARGS__ ) /** * From the least to the most output. diff --git a/dom/events/IMEStateManager.cpp b/dom/events/IMEStateManager.cpp index 7fc4e9b6cdd5..37043d344d93 100644 --- a/dom/events/IMEStateManager.cpp +++ b/dom/events/IMEStateManager.cpp @@ -43,16 +43,16 @@ using namespace widget; /** * When a method is called, log its arguments and/or related static variables - * with LogLevel::Info. However, if it puts too many logs like + * with PR_LOG_ALWAYS. However, if it puts too many logs like * OnDestroyPresContext(), should long only when the method actually does * something. In this case, the log should start with "ISM: ". * * When a method quits due to unexpected situation, log the reason with - * LogLevel::Error. In this case, the log should start with + * PR_LOG_ERROR. In this case, the log should start with * "ISM: (), FAILED". The indent makes the log look easier. * * When a method does something only in some situations and it may be important - * for debug, log the information with LogLevel::Debug. In this case, the log + * for debug, log the information with PR_LOG_DEBUG. In this case, the log * should start with "ISM: (),". */ PRLogModuleInfo* sISMLog = nullptr; @@ -200,7 +200,7 @@ IMEStateManager::Init() void IMEStateManager::Shutdown() { - MOZ_LOG(sISMLog, LogLevel::Info, + MOZ_LOG(sISMLog, PR_LOG_ALWAYS, ("ISM: IMEStateManager::Shutdown(), " "sTextCompositions=0x%p, sTextCompositions->Length()=%u", sTextCompositions, sTextCompositions ? sTextCompositions->Length() : 0)); @@ -221,7 +221,7 @@ IMEStateManager::OnDestroyPresContext(nsPresContext* aPresContext) TextCompositionArray::index_type i = sTextCompositions->IndexOf(aPresContext); if (i != TextCompositionArray::NoIndex) { - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::OnDestroyPresContext(), " "removing TextComposition instance from the array (index=%u)", i)); // there should be only one composition per presContext object. @@ -229,7 +229,7 @@ IMEStateManager::OnDestroyPresContext(nsPresContext* aPresContext) sTextCompositions->RemoveElementAt(i); if (sTextCompositions->IndexOf(aPresContext) != TextCompositionArray::NoIndex) { - MOZ_LOG(sISMLog, LogLevel::Error, + MOZ_LOG(sISMLog, PR_LOG_ERROR, ("ISM: IMEStateManager::OnDestroyPresContext(), FAILED to remove " "TextComposition instance from the array")); MOZ_CRASH("Failed to remove TextComposition instance from the array"); @@ -241,7 +241,7 @@ IMEStateManager::OnDestroyPresContext(nsPresContext* aPresContext) return NS_OK; } - MOZ_LOG(sISMLog, LogLevel::Info, + MOZ_LOG(sISMLog, PR_LOG_ALWAYS, ("ISM: IMEStateManager::OnDestroyPresContext(aPresContext=0x%p), " "sPresContext=0x%p, sContent=0x%p, sTextCompositions=0x%p", aPresContext, sPresContext, sContent, sTextCompositions)); @@ -273,7 +273,7 @@ IMEStateManager::OnRemoveContent(nsPresContext* aPresContext, sTextCompositions->GetCompositionInContent(aPresContext, aContent); if (compositionInContent) { - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::OnRemoveContent(), " "composition is in the content")); @@ -296,7 +296,7 @@ IMEStateManager::OnRemoveContent(nsPresContext* aPresContext, return NS_OK; } - MOZ_LOG(sISMLog, LogLevel::Info, + MOZ_LOG(sISMLog, PR_LOG_ALWAYS, ("ISM: IMEStateManager::OnRemoveContent(aPresContext=0x%p, " "aContent=0x%p), sPresContext=0x%p, sContent=0x%p, sTextCompositions=0x%p", aPresContext, aContent, sPresContext, sContent, sTextCompositions)); @@ -324,7 +324,7 @@ IMEStateManager::OnChangeFocus(nsPresContext* aPresContext, nsIContent* aContent, InputContextAction::Cause aCause) { - MOZ_LOG(sISMLog, LogLevel::Info, + MOZ_LOG(sISMLog, PR_LOG_ALWAYS, ("ISM: IMEStateManager::OnChangeFocus(aPresContext=0x%p, " "aContent=0x%p, aCause=%s)", aPresContext, aContent, GetActionCauseName(aCause))); @@ -339,7 +339,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext, nsIContent* aContent, InputContextAction aAction) { - MOZ_LOG(sISMLog, LogLevel::Info, + MOZ_LOG(sISMLog, PR_LOG_ALWAYS, ("ISM: IMEStateManager::OnChangeFocusInternal(aPresContext=0x%p, " "aContent=0x%p, aAction={ mCause=%s, mFocusChange=%s }), " "sPresContext=0x%p, sContent=0x%p, sActiveIMEContentObserver=0x%p", @@ -367,7 +367,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext, } if (!aPresContext) { - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::OnChangeFocusInternal(), " "no nsPresContext is being activated")); return NS_OK; @@ -377,7 +377,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext, (sPresContext == aPresContext) ? oldWidget.get() : aPresContext->GetRootWidget(); if (NS_WARN_IF(!widget)) { - MOZ_LOG(sISMLog, LogLevel::Error, + MOZ_LOG(sISMLog, PR_LOG_ERROR, ("ISM: IMEStateManager::OnChangeFocusInternal(), FAILED due to " "no widget to manage its IME state")); return NS_OK; @@ -395,7 +395,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext, // on focus to the main process... but this cannot cause bugs like missed keypresses. // (It just means a lot of needless IPC.) if ((newState.mEnabled == IMEState::DISABLED) && TabParent::GetIMETabParent()) { - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::OnChangeFocusInternal(), " "Parent process cancels to set DISABLED state because the content process " "has IME focus and has already sets IME state")); @@ -410,7 +410,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext, // we should do it. InputContext context = widget->GetInputContext(); if (context.mIMEState.mEnabled == newState.mEnabled) { - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::OnChangeFocusInternal(), " "neither focus nor IME state is changing")); return NS_OK; @@ -449,7 +449,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext, void IMEStateManager::OnInstalledMenuKeyboardListener(bool aInstalling) { - MOZ_LOG(sISMLog, LogLevel::Info, + MOZ_LOG(sISMLog, PR_LOG_ALWAYS, ("ISM: IMEStateManager::OnInstalledMenuKeyboardListener(aInstalling=%s), " "sInstalledMenuKeyboardListener=%s", GetBoolName(aInstalling), GetBoolName(sInstalledMenuKeyboardListener))); @@ -468,27 +468,27 @@ IMEStateManager::OnMouseButtonEventInEditor(nsPresContext* aPresContext, nsIContent* aContent, nsIDOMMouseEvent* aMouseEvent) { - MOZ_LOG(sISMLog, LogLevel::Info, + MOZ_LOG(sISMLog, PR_LOG_ALWAYS, ("ISM: IMEStateManager::OnMouseButtonEventInEditor(aPresContext=0x%p, " "aContent=0x%p, aMouseEvent=0x%p), sPresContext=0x%p, sContent=0x%p", aPresContext, aContent, aMouseEvent, sPresContext, sContent)); if (sPresContext != aPresContext || sContent != aContent) { - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::OnMouseButtonEventInEditor(), " "the mouse event isn't fired on the editor managed by ISM")); return false; } if (!sActiveIMEContentObserver) { - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::OnMouseButtonEventInEditor(), " "there is no active IMEContentObserver")); return false; } if (!sActiveIMEContentObserver->IsManaging(aPresContext, aContent)) { - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::OnMouseButtonEventInEditor(), " "the active IMEContentObserver isn't managing the editor")); return false; @@ -497,7 +497,7 @@ IMEStateManager::OnMouseButtonEventInEditor(nsPresContext* aPresContext, WidgetMouseEvent* internalEvent = aMouseEvent->GetInternalNSEvent()->AsMouseEvent(); if (NS_WARN_IF(!internalEvent)) { - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::OnMouseButtonEventInEditor(), " "the internal event of aMouseEvent isn't WidgetMouseEvent")); return false; @@ -506,10 +506,10 @@ IMEStateManager::OnMouseButtonEventInEditor(nsPresContext* aPresContext, bool consumed = sActiveIMEContentObserver->OnMouseButtonEvent(aPresContext, internalEvent); - if (MOZ_LOG_TEST(sISMLog, LogLevel::Info)) { + if (PR_LOG_TEST(sISMLog, PR_LOG_ALWAYS)) { nsAutoString eventType; aMouseEvent->GetType(eventType); - MOZ_LOG(sISMLog, LogLevel::Info, + MOZ_LOG(sISMLog, PR_LOG_ALWAYS, ("ISM: IMEStateManager::OnMouseButtonEventInEditor(), " "mouse event (type=%s, button=%d) is %s", NS_ConvertUTF16toUTF8(eventType).get(), internalEvent->button, @@ -525,13 +525,13 @@ IMEStateManager::OnClickInEditor(nsPresContext* aPresContext, nsIContent* aContent, nsIDOMMouseEvent* aMouseEvent) { - MOZ_LOG(sISMLog, LogLevel::Info, + MOZ_LOG(sISMLog, PR_LOG_ALWAYS, ("ISM: IMEStateManager::OnClickInEditor(aPresContext=0x%p, aContent=0x%p, " "aMouseEvent=0x%p), sPresContext=0x%p, sContent=0x%p", aPresContext, aContent, aMouseEvent, sPresContext, sContent)); if (sPresContext != aPresContext || sContent != aContent) { - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::OnClickInEditor(), " "the mouse event isn't fired on the editor managed by ISM")); return; @@ -544,7 +544,7 @@ IMEStateManager::OnClickInEditor(nsPresContext* aPresContext, nsresult rv = aMouseEvent->GetIsTrusted(&isTrusted); NS_ENSURE_SUCCESS_VOID(rv); if (!isTrusted) { - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::OnClickInEditor(), " "the mouse event isn't a trusted event")); return; // ignore untrusted event. @@ -554,7 +554,7 @@ IMEStateManager::OnClickInEditor(nsPresContext* aPresContext, rv = aMouseEvent->GetButton(&button); NS_ENSURE_SUCCESS_VOID(rv); if (button != 0) { - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::OnClickInEditor(), " "the mouse event isn't a left mouse button event")); return; // not a left click event. @@ -564,7 +564,7 @@ IMEStateManager::OnClickInEditor(nsPresContext* aPresContext, rv = aMouseEvent->GetDetail(&clickCount); NS_ENSURE_SUCCESS_VOID(rv); if (clickCount != 1) { - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::OnClickInEditor(), " "the mouse event isn't a single click event")); return; // should notify only first click event. @@ -582,7 +582,7 @@ IMEStateManager::OnFocusInEditor(nsPresContext* aPresContext, nsIContent* aContent, nsIEditor* aEditor) { - MOZ_LOG(sISMLog, LogLevel::Info, + MOZ_LOG(sISMLog, PR_LOG_ALWAYS, ("ISM: IMEStateManager::OnFocusInEditor(aPresContext=0x%p, aContent=0x%p, " "aEditor=0x%p), sPresContext=0x%p, sContent=0x%p, " "sActiveIMEContentObserver=0x%p", @@ -590,7 +590,7 @@ IMEStateManager::OnFocusInEditor(nsPresContext* aPresContext, sActiveIMEContentObserver)); if (sPresContext != aPresContext || sContent != aContent) { - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::OnFocusInEditor(), " "an editor not managed by ISM gets focus")); return; @@ -600,7 +600,7 @@ IMEStateManager::OnFocusInEditor(nsPresContext* aPresContext, // we need to recreate the instance. if (sActiveIMEContentObserver) { if (sActiveIMEContentObserver->IsManaging(aPresContext, aContent)) { - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::OnFocusInEditor(), " "the editor is already being managed by sActiveIMEContentObserver")); return; @@ -617,7 +617,7 @@ IMEStateManager::UpdateIMEState(const IMEState& aNewIMEState, nsIContent* aContent, nsIEditor* aEditor) { - MOZ_LOG(sISMLog, LogLevel::Info, + MOZ_LOG(sISMLog, PR_LOG_ALWAYS, ("ISM: IMEStateManager::UpdateIMEState(aNewIMEState={ mEnabled=%s, " "mOpen=%s }, aContent=0x%p, aEditor=0x%p), " "sPresContext=0x%p, sContent=0x%p, sActiveIMEContentObserver=0x%p, " @@ -628,21 +628,21 @@ IMEStateManager::UpdateIMEState(const IMEState& aNewIMEState, GetBoolName(sIsGettingNewIMEState))); if (sIsGettingNewIMEState) { - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::UpdateIMEState(), " "does nothing because of called while getting new IME state")); return; } if (NS_WARN_IF(!sPresContext)) { - MOZ_LOG(sISMLog, LogLevel::Error, + MOZ_LOG(sISMLog, PR_LOG_ERROR, ("ISM: IMEStateManager::UpdateIMEState(), FAILED due to " "no managing nsPresContext")); return; } nsCOMPtr widget = sPresContext->GetRootWidget(); if (NS_WARN_IF(!widget)) { - MOZ_LOG(sISMLog, LogLevel::Error, + MOZ_LOG(sISMLog, PR_LOG_ERROR, ("ISM: IMEStateManager::UpdateIMEState(), FAILED due to " "no widget for the managing nsPresContext")); return; @@ -652,12 +652,12 @@ IMEStateManager::UpdateIMEState(const IMEState& aNewIMEState, // editor with current editable root content due to reframed. In such case, // We should try to reinitialize the IMEContentObserver. if (sActiveIMEContentObserver && IsIMEObserverNeeded(aNewIMEState)) { - MOZ_LOG(sISMLog, LogLevel::Debug, + PR_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::UpdateIMEState(), try to reinitialize the " "active IMEContentObserver")); if (!sActiveIMEContentObserver->MaybeReinitialize(widget, sPresContext, aContent, aEditor)) { - MOZ_LOG(sISMLog, LogLevel::Error, + PR_LOG(sISMLog, PR_LOG_ERROR, ("ISM: IMEStateManager::UpdateIMEState(), failed to reinitialize the " "active IMEContentObserver")); } @@ -697,7 +697,7 @@ IMEState IMEStateManager::GetNewIMEState(nsPresContext* aPresContext, nsIContent* aContent) { - MOZ_LOG(sISMLog, LogLevel::Info, + MOZ_LOG(sISMLog, PR_LOG_ALWAYS, ("ISM: IMEStateManager::GetNewIMEState(aPresContext=0x%p, aContent=0x%p), " "sInstalledMenuKeyboardListener=%s", aPresContext, aContent, GetBoolName(sInstalledMenuKeyboardListener))); @@ -705,14 +705,14 @@ IMEStateManager::GetNewIMEState(nsPresContext* aPresContext, // On Printing or Print Preview, we don't need IME. if (aPresContext->Type() == nsPresContext::eContext_PrintPreview || aPresContext->Type() == nsPresContext::eContext_Print) { - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::GetNewIMEState() returns DISABLED because " "the nsPresContext is for print or print preview")); return IMEState(IMEState::DISABLED); } if (sInstalledMenuKeyboardListener) { - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::GetNewIMEState() returns DISABLED because " "menu keyboard listener was installed")); return IMEState(IMEState::DISABLED); @@ -723,12 +723,12 @@ IMEStateManager::GetNewIMEState(nsPresContext* aPresContext, // editable, such case is design mode. nsIDocument* doc = aPresContext->Document(); if (doc && doc->HasFlag(NODE_IS_EDITABLE)) { - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::GetNewIMEState() returns ENABLED because " "design mode editor has focus")); return IMEState(IMEState::ENABLED); } - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::GetNewIMEState() returns DISABLED because " "no content has focus")); return IMEState(IMEState::DISABLED); @@ -742,7 +742,7 @@ IMEStateManager::GetNewIMEState(nsPresContext* aPresContext, GettingNewIMEStateBlocker blocker; IMEState newIMEState = aContent->GetDesiredIMEState(); - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::GetNewIMEState() returns { mEnabled=%s, " "mOpen=%s }", GetIMEStateEnabledName(newIMEState.mEnabled), @@ -763,7 +763,7 @@ public: nsCOMPtr observerService = services::GetObserverService(); if (observerService) { - MOZ_LOG(sISMLog, LogLevel::Info, + MOZ_LOG(sISMLog, PR_LOG_ALWAYS, ("ISM: IMEEnabledStateChangedEvent::Run(), notifies observers of " "\"ime-enabled-state-changed\"")); nsAutoString state; @@ -785,7 +785,7 @@ IMEStateManager::SetIMEState(const IMEState& aState, nsIWidget* aWidget, InputContextAction aAction) { - MOZ_LOG(sISMLog, LogLevel::Info, + MOZ_LOG(sISMLog, PR_LOG_ALWAYS, ("ISM: IMEStateManager::SetIMEState(aState={ mEnabled=%s, mOpen=%s }, " "aContent=0x%p, aWidget=0x%p, aAction={ mCause=%s, mFocusChange=%s })", GetIMEStateEnabledName(aState.mEnabled), @@ -871,7 +871,7 @@ IMEStateManager::SetIMEState(const IMEState& aState, } - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::SetIMEState(), " "calling nsIWidget::SetInputContext(context={ mIMEState={ mEnabled=%s, " "mOpen=%s }, mHTMLInputType=\"%s\", mHTMLInputInputmode=\"%s\", " @@ -913,7 +913,7 @@ IMEStateManager::DispatchCompositionEvent( EventDispatchingCallback* aCallBack, bool aIsSynthesized) { - MOZ_LOG(sISMLog, LogLevel::Info, + MOZ_LOG(sISMLog, PR_LOG_ALWAYS, ("ISM: IMEStateManager::DispatchCompositionEvent(aNode=0x%p, " "aPresContext=0x%p, aCompositionEvent={ message=%s, " "mFlags={ mIsTrusted=%s, mPropagationStopped=%s } }, " @@ -942,7 +942,7 @@ IMEStateManager::DispatchCompositionEvent( if (NS_WARN_IF(aIsSynthesized)) { return; } - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::DispatchCompositionEvent(), " "adding new TextComposition to the array")); MOZ_ASSERT(aCompositionEvent->message == NS_COMPOSITION_START); @@ -978,7 +978,7 @@ IMEStateManager::DispatchCompositionEvent( TextCompositionArray::index_type i = sTextCompositions->IndexOf(aCompositionEvent->widget); if (i != TextCompositionArray::NoIndex) { - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::DispatchCompositionEvent(), " "removing TextComposition from the array since NS_COMPOSTION_END " "was dispatched")); @@ -996,7 +996,7 @@ IMEStateManager::OnCompositionEventDiscarded( // Note that this method is never called for synthesized events for emulating // commit or cancel composition. - MOZ_LOG(sISMLog, LogLevel::Info, + MOZ_LOG(sISMLog, PR_LOG_ALWAYS, ("ISM: IMEStateManager::OnCompositionEventDiscarded(aCompositionEvent={ " "message=%s, mFlags={ mIsTrusted=%s } })", GetEventMessageName(aCompositionEvent->message), @@ -1019,7 +1019,7 @@ IMEStateManager::OnCompositionEventDiscarded( // a TextComposition instance for the composition was already removed from // the array and destroyed in OnDestroyPresContext(). Therefore, we may // fail to retrieve a TextComposition instance here. - MOZ_LOG(sISMLog, LogLevel::Info, + MOZ_LOG(sISMLog, PR_LOG_ALWAYS, ("ISM: IMEStateManager::OnCompositionEventDiscarded(), " "TextComposition instance for the widget has already gone")); return; @@ -1040,14 +1040,14 @@ IMEStateManager::NotifyIME(IMEMessage aMessage, bool isSynthesizedForTests = composition && composition->IsSynthesizedForTests(); - MOZ_LOG(sISMLog, LogLevel::Info, + MOZ_LOG(sISMLog, PR_LOG_ALWAYS, ("ISM: IMEStateManager::NotifyIME(aMessage=%s, aWidget=0x%p), " "composition=0x%p, composition->IsSynthesizedForTests()=%s", GetNotifyIMEMessageName(aMessage), aWidget, composition.get(), GetBoolName(isSynthesizedForTests))); if (NS_WARN_IF(!aWidget)) { - MOZ_LOG(sISMLog, LogLevel::Error, + MOZ_LOG(sISMLog, PR_LOG_ERROR, ("ISM: IMEStateManager::NotifyIME(), FAILED due to no widget")); return NS_ERROR_INVALID_ARG; } @@ -1075,7 +1075,7 @@ nsresult IMEStateManager::NotifyIME(IMEMessage aMessage, nsPresContext* aPresContext) { - MOZ_LOG(sISMLog, LogLevel::Info, + MOZ_LOG(sISMLog, PR_LOG_ALWAYS, ("ISM: IMEStateManager::NotifyIME(aMessage=%s, aPresContext=0x%p)", GetNotifyIMEMessageName(aMessage), aPresContext)); @@ -1083,7 +1083,7 @@ IMEStateManager::NotifyIME(IMEMessage aMessage, nsIWidget* widget = aPresContext->GetRootWidget(); if (NS_WARN_IF(!widget)) { - MOZ_LOG(sISMLog, LogLevel::Error, + MOZ_LOG(sISMLog, PR_LOG_ERROR, ("ISM: IMEStateManager::NotifyIME(), FAILED due to no widget for the " "nsPresContext")); return NS_ERROR_NOT_AVAILABLE; @@ -1150,18 +1150,18 @@ IMEStateManager::IsIMEObserverNeeded(const IMEState& aState) void IMEStateManager::DestroyIMEContentObserver() { - MOZ_LOG(sISMLog, LogLevel::Info, + MOZ_LOG(sISMLog, PR_LOG_ALWAYS, ("ISM: IMEStateManager::DestroyIMEContentObserver(), " "sActiveIMEContentObserver=0x%p", sActiveIMEContentObserver)); if (!sActiveIMEContentObserver) { - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::DestroyIMEContentObserver() does nothing")); return; } - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::DestroyIMEContentObserver(), destroying " "the active IMEContentObserver...")); nsRefPtr tsm; @@ -1173,7 +1173,7 @@ IMEStateManager::DestroyIMEContentObserver() void IMEStateManager::CreateIMEContentObserver(nsIEditor* aEditor) { - MOZ_LOG(sISMLog, LogLevel::Info, + MOZ_LOG(sISMLog, PR_LOG_ALWAYS, ("ISM: IMEStateManager::CreateIMEContentObserver(aEditor=0x%p), " "sPresContext=0x%p, sContent=0x%p, sActiveIMEContentObserver=0x%p, " "sActiveIMEContentObserver->IsManaging(sPresContext, sContent)=%s", @@ -1182,7 +1182,7 @@ IMEStateManager::CreateIMEContentObserver(nsIEditor* aEditor) sActiveIMEContentObserver->IsManaging(sPresContext, sContent) : false))); if (NS_WARN_IF(sActiveIMEContentObserver)) { - MOZ_LOG(sISMLog, LogLevel::Error, + MOZ_LOG(sISMLog, PR_LOG_ERROR, ("ISM: IMEStateManager::CreateIMEContentObserver(), FAILED due to " "there is already an active IMEContentObserver")); MOZ_ASSERT(sActiveIMEContentObserver->IsManaging(sPresContext, sContent)); @@ -1191,7 +1191,7 @@ IMEStateManager::CreateIMEContentObserver(nsIEditor* aEditor) nsCOMPtr widget = sPresContext->GetRootWidget(); if (!widget) { - MOZ_LOG(sISMLog, LogLevel::Error, + MOZ_LOG(sISMLog, PR_LOG_ERROR, ("ISM: IMEStateManager::CreateIMEContentObserver(), FAILED due to " "there is a root widget for the nsPresContext")); return; // Sometimes, there are no widgets. @@ -1199,13 +1199,13 @@ IMEStateManager::CreateIMEContentObserver(nsIEditor* aEditor) // If it's not text editable, we don't need to create IMEContentObserver. if (!IsIMEObserverNeeded(widget->GetInputContext().mIMEState)) { - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::CreateIMEContentObserver() doesn't create " "IMEContentObserver because of non-editable IME state")); return; } - MOZ_LOG(sISMLog, LogLevel::Debug, + MOZ_LOG(sISMLog, PR_LOG_DEBUG, ("ISM: IMEStateManager::CreateIMEContentObserver() is creating an " "IMEContentObserver instance...")); sActiveIMEContentObserver = new IMEContentObserver(); diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp index 8c65be422405..3c5863fde672 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -238,7 +238,7 @@ public: // Silently cancel if our load has been cancelled. if (IsCancelled()) return NS_OK; - LOG_EVENT(LogLevel::Debug, ("%p Dispatching simple event source error", mElement.get())); + LOG_EVENT(PR_LOG_DEBUG, ("%p Dispatching simple event source error", mElement.get())); return nsContentUtils::DispatchTrustedEvent(mElement->OwnerDoc(), mSource, NS_LITERAL_STRING("error"), @@ -867,7 +867,7 @@ void HTMLMediaElement::SelectResource() nsCOMPtr uri; nsresult rv = NewURIFromString(src, getter_AddRefs(uri)); if (NS_SUCCEEDED(rv)) { - LOG(LogLevel::Debug, ("%p Trying load from src=%s", this, NS_ConvertUTF16toUTF8(src).get())); + LOG(PR_LOG_DEBUG, ("%p Trying load from src=%s", this, NS_ConvertUTF16toUTF8(src).get())); NS_ASSERTION(!mIsLoadingFromSourceChildren, "Should think we're not loading from source children by default"); @@ -900,7 +900,7 @@ void HTMLMediaElement::SelectResource() void HTMLMediaElement::NotifyLoadError() { if (!mIsLoadingFromSourceChildren) { - LOG(LogLevel::Debug, ("NotifyLoadError(), no supported media error")); + LOG(PR_LOG_DEBUG, ("NotifyLoadError(), no supported media error")); NoSupportedMediaSourceError(); } else if (mSourceLoadCandidate) { DispatchAsyncSourceError(mSourceLoadCandidate); @@ -995,7 +995,7 @@ void HTMLMediaElement::LoadFromSourceChildren() ReportLoadError("MediaLoadSourceMediaNotMatched", params, ArrayLength(params)); continue; } - LOG(LogLevel::Debug, ("%p Trying load from =%s type=%s media=%s", this, + LOG(PR_LOG_DEBUG, ("%p Trying load from =%s type=%s media=%s", this, NS_ConvertUTF16toUTF8(src).get(), NS_ConvertUTF16toUTF8(type).get(), NS_ConvertUTF16toUTF8(media).get())); @@ -1453,14 +1453,14 @@ HTMLMediaElement::Seek(double aTime, } if (!mPlayed) { - LOG(LogLevel::Debug, ("HTMLMediaElement::mPlayed not available.")); + LOG(PR_LOG_DEBUG, ("HTMLMediaElement::mPlayed not available.")); aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); return; } if (mCurrentPlayRangeStart != -1.0) { double rangeEndTime = CurrentTime(); - LOG(LogLevel::Debug, ("%p Adding \'played\' a range : [%f, %f]", this, mCurrentPlayRangeStart, rangeEndTime)); + LOG(PR_LOG_DEBUG, ("%p Adding \'played\' a range : [%f, %f]", this, mCurrentPlayRangeStart, rangeEndTime)); // Multiple seek without playing, or seek while playing. if (mCurrentPlayRangeStart != rangeEndTime) { mPlayed->Add(mCurrentPlayRangeStart, rangeEndTime); @@ -1471,13 +1471,13 @@ HTMLMediaElement::Seek(double aTime, } if (!mDecoder) { - LOG(LogLevel::Debug, ("%p SetCurrentTime(%f) failed: no decoder", this, aTime)); + LOG(PR_LOG_DEBUG, ("%p SetCurrentTime(%f) failed: no decoder", this, aTime)); aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); return; } if (mReadyState == nsIDOMHTMLMediaElement::HAVE_NOTHING) { - LOG(LogLevel::Debug, ("%p SetCurrentTime(%f) failed: no source", this, aTime)); + LOG(PR_LOG_DEBUG, ("%p SetCurrentTime(%f) failed: no source", this, aTime)); aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); return; } @@ -1554,7 +1554,7 @@ HTMLMediaElement::Seek(double aTime, mPlayingBeforeSeek = IsPotentiallyPlaying(); // The media backend is responsible for dispatching the timeupdate // event if it changes the playback position as a result of the seek. - LOG(LogLevel::Debug, ("%p SetCurrentTime(%f) starting seek", this, aTime)); + LOG(PR_LOG_DEBUG, ("%p SetCurrentTime(%f) starting seek", this, aTime)); nsresult rv = mDecoder->Seek(aTime, aSeekType); if (NS_FAILED(rv)) { aRv.Throw(rv); @@ -1568,7 +1568,7 @@ NS_IMETHODIMP HTMLMediaElement::SetCurrentTime(double aCurrentTime) { // Detect for a NaN and invalid values. if (mozilla::IsNaN(aCurrentTime)) { - LOG(LogLevel::Debug, ("%p SetCurrentTime(%f) failed: bad time", this, aCurrentTime)); + LOG(PR_LOG_DEBUG, ("%p SetCurrentTime(%f) failed: bad time", this, aCurrentTime)); return NS_ERROR_FAILURE; } @@ -1665,7 +1665,7 @@ void HTMLMediaElement::Pause(ErrorResult& aRv) { if (mNetworkState == nsIDOMHTMLMediaElement::NETWORK_EMPTY) { - LOG(LogLevel::Debug, ("Loading due to Pause()")); + LOG(PR_LOG_DEBUG, ("Loading due to Pause()")); aRv = Load(); if (aRv.Failed()) { return; @@ -2561,7 +2561,7 @@ HTMLMediaElement::ReportEMETelemetry() NS_ASSERTION(NS_IsMainThread(), "Should be on main thread."); if (mIsEncrypted && Preferences::GetBool("media.eme.enabled")) { Telemetry::Accumulate(Telemetry::VIDEO_EME_PLAY_SUCCESS, mLoadedDataFired); - LOG(LogLevel::Debug, ("%p VIDEO_EME_PLAY_SUCCESS = %s", + LOG(PR_LOG_DEBUG, ("%p VIDEO_EME_PLAY_SUCCESS = %s", this, mLoadedDataFired ? "true" : "false")); } } @@ -2613,14 +2613,14 @@ HTMLMediaElement::ReportMSETelemetry() } Telemetry::Accumulate(Telemetry::VIDEO_MSE_UNLOAD_STATE, state); - LOG(LogLevel::Debug, ("%p VIDEO_MSE_UNLOAD_STATE = %d", this, state)); + LOG(PR_LOG_DEBUG, ("%p VIDEO_MSE_UNLOAD_STATE = %d", this, state)); Telemetry::Accumulate(Telemetry::VIDEO_MSE_PLAY_TIME_MS, SECONDS_TO_MS(mPlayTime.Total())); - LOG(LogLevel::Debug, ("%p VIDEO_MSE_PLAY_TIME_MS = %f", this, mPlayTime.Total())); + LOG(PR_LOG_DEBUG, ("%p VIDEO_MSE_PLAY_TIME_MS = %f", this, mPlayTime.Total())); double latency = mJoinLatency.Count() ? mJoinLatency.Total() / mJoinLatency.Count() : 0.0; Telemetry::Accumulate(Telemetry::VIDEO_MSE_JOIN_LATENCY_MS, SECONDS_TO_MS(latency)); - LOG(LogLevel::Debug, ("%p VIDEO_MSE_JOIN_LATENCY = %f (%d ms) count=%d\n", + LOG(PR_LOG_DEBUG, ("%p VIDEO_MSE_JOIN_LATENCY = %f (%d ms) count=%d\n", this, latency, SECONDS_TO_MS(latency), mJoinLatency.Count())); } @@ -2676,7 +2676,7 @@ HTMLMediaElement::CanPlayType(const nsAString& aType, nsAString& aResult) break; } - LOG(LogLevel::Debug, ("%p CanPlayType(%s) = \"%s\"", this, + LOG(PR_LOG_DEBUG, ("%p CanPlayType(%s) = \"%s\"", this, NS_ConvertUTF16toUTF8(aType).get(), NS_ConvertUTF16toUTF8(aResult).get())); @@ -2695,10 +2695,10 @@ nsresult HTMLMediaElement::InitializeDecoderAsClone(MediaDecoder* aOriginal) if (!decoder) return NS_ERROR_FAILURE; - LOG(LogLevel::Debug, ("%p Cloned decoder %p from %p", this, decoder.get(), aOriginal)); + LOG(PR_LOG_DEBUG, ("%p Cloned decoder %p from %p", this, decoder.get(), aOriginal)); if (!decoder->Init(this)) { - LOG(LogLevel::Debug, ("%p Failed to init cloned decoder %p", this, decoder.get())); + LOG(PR_LOG_DEBUG, ("%p Failed to init cloned decoder %p", this, decoder.get())); return NS_ERROR_FAILURE; } @@ -2710,7 +2710,7 @@ nsresult HTMLMediaElement::InitializeDecoderAsClone(MediaDecoder* aOriginal) nsRefPtr resource = originalResource->CloneData(decoder); if (!resource) { - LOG(LogLevel::Debug, ("%p Failed to cloned stream for decoder %p", this, decoder.get())); + LOG(PR_LOG_DEBUG, ("%p Failed to cloned stream for decoder %p", this, decoder.get())); return NS_ERROR_FAILURE; } @@ -2738,7 +2738,7 @@ nsresult HTMLMediaElement::InitializeDecoderForChannel(nsIChannel* aChannel, return NS_ERROR_FAILURE; } - LOG(LogLevel::Debug, ("%p Created decoder %p for type %s", this, decoder.get(), mimeType.get())); + LOG(PR_LOG_DEBUG, ("%p Created decoder %p for type %s", this, decoder.get(), mimeType.get())); nsRefPtr resource = MediaResource::Create(decoder, aChannel); if (!resource) @@ -2798,7 +2798,7 @@ nsresult HTMLMediaElement::FinishDecoderSetup(MediaDecoder* aDecoder, nsresult rv = aDecoder->Load(aListener, aCloneDonor); if (NS_FAILED(rv)) { SetDecoder(nullptr); - LOG(LogLevel::Debug, ("%p Failed to load for decoder %p", this, aDecoder)); + LOG(PR_LOG_DEBUG, ("%p Failed to load for decoder %p", this, aDecoder)); return rv; } @@ -3318,7 +3318,7 @@ void HTMLMediaElement::PlaybackEnded() } if (mSrcStream || (mDecoder && mDecoder->IsInfinite())) { - LOG(LogLevel::Debug, ("%p, got duration by reaching the end of the resource", this)); + LOG(PR_LOG_DEBUG, ("%p, got duration by reaching the end of the resource", this)); DispatchAsyncEvent(NS_LITERAL_STRING("durationchange")); } @@ -3609,7 +3609,7 @@ void HTMLMediaElement::ChangeReadyState(nsMediaReadyState aState) return; } - LOG(LogLevel::Debug, ("%p Ready state changed to %s", this, gReadyStateToString[aState])); + LOG(PR_LOG_DEBUG, ("%p Ready state changed to %s", this, gReadyStateToString[aState])); UpdateAudioChannelPlayingState(); @@ -3664,7 +3664,7 @@ void HTMLMediaElement::ChangeNetworkState(nsMediaNetworkState aState) nsMediaNetworkState oldState = mNetworkState; mNetworkState = aState; - LOG(LogLevel::Debug, ("%p Network state changed to %s", this, gNetworkStateToString[aState])); + LOG(PR_LOG_DEBUG, ("%p Network state changed to %s", this, gNetworkStateToString[aState])); // TODO: |mBegun| reflects the download status. We should be able to remove // it and check |mNetworkState| only. @@ -3759,7 +3759,7 @@ VideoFrameContainer* HTMLMediaElement::GetVideoFrameContainer() nsresult HTMLMediaElement::DispatchEvent(const nsAString& aName) { - LOG_EVENT(LogLevel::Debug, ("%p Dispatching event %s", this, + LOG_EVENT(PR_LOG_DEBUG, ("%p Dispatching event %s", this, NS_ConvertUTF16toUTF8(aName).get())); // Save events that occur while in the bfcache. These will be dispatched @@ -3778,7 +3778,7 @@ nsresult HTMLMediaElement::DispatchEvent(const nsAString& aName) nsresult HTMLMediaElement::DispatchAsyncEvent(const nsAString& aName) { - LOG_EVENT(LogLevel::Debug, ("%p Queuing event %s", this, + LOG_EVENT(PR_LOG_DEBUG, ("%p Queuing event %s", this, NS_ConvertUTF16toUTF8(aName).get())); // Save events that occur while in the bfcache. These will be dispatched @@ -4040,7 +4040,7 @@ HTMLMediaElement::IsNodeOfType(uint32_t aFlags) const void HTMLMediaElement::DispatchAsyncSourceError(nsIContent* aSourceElement) { - LOG_EVENT(LogLevel::Debug, ("%p Queuing simple source error event", this)); + LOG_EVENT(PR_LOG_DEBUG, ("%p Queuing simple source error event", this)); nsCOMPtr event = new nsSourceErrorEventRunner(this, aSourceElement); NS_DispatchToMainThread(event); @@ -4125,7 +4125,7 @@ void HTMLMediaElement::ChangeDelayLoadStatus(bool aDelay) mDelayingLoadEvent = aDelay; - LOG(LogLevel::Debug, ("%p ChangeDelayLoadStatus(%d) doc=0x%p", this, aDelay, mLoadBlockedDoc.get())); + LOG(PR_LOG_DEBUG, ("%p ChangeDelayLoadStatus(%d) doc=0x%p", this, aDelay, mLoadBlockedDoc.get())); if (mDecoder) { mDecoder->SetLoadInBackground(!aDelay); } diff --git a/dom/html/HTMLTrackElement.cpp b/dom/html/HTMLTrackElement.cpp index b9d24d50c4f1..f51b1018dfad 100644 --- a/dom/html/HTMLTrackElement.cpp +++ b/dom/html/HTMLTrackElement.cpp @@ -195,7 +195,7 @@ HTMLTrackElement::LoadResource() nsCOMPtr uri; nsresult rv = NewURIFromString(src, getter_AddRefs(uri)); NS_ENSURE_TRUE_VOID(NS_SUCCEEDED(rv)); - LOG(LogLevel::Info, ("%p Trying to load from src=%s", this, + LOG(PR_LOG_ALWAYS, ("%p Trying to load from src=%s", this, NS_ConvertUTF16toUTF8(src).get())); if (mChannel) { @@ -246,7 +246,7 @@ HTMLTrackElement::LoadResource() NS_ENSURE_TRUE_VOID(NS_SUCCEEDED(rv)); channel->SetNotificationCallbacks(mListener); - LOG(LogLevel::Debug, ("opening webvtt channel")); + LOG(PR_LOG_DEBUG, ("opening webvtt channel")); rv = channel->AsyncOpen(mListener, nullptr); NS_ENSURE_TRUE_VOID(NS_SUCCEEDED(rv)); @@ -269,7 +269,7 @@ HTMLTrackElement::BindToTree(nsIDocument* aDocument, return NS_OK; } - LOG(LogLevel::Debug, ("Track Element bound to tree.")); + LOG(PR_LOG_DEBUG, ("Track Element bound to tree.")); if (!aParent || !aParent->IsNodeOfType(nsINode::eMEDIA)) { return NS_OK; } @@ -281,7 +281,7 @@ HTMLTrackElement::BindToTree(nsIDocument* aDocument, HTMLMediaElement* media = static_cast(aParent); // TODO: separate notification for 'alternate' tracks? media->NotifyAddedSource(); - LOG(LogLevel::Debug, ("Track element sent notification to parent.")); + LOG(PR_LOG_DEBUG, ("Track element sent notification to parent.")); mMediaParent->RunInStableState( NS_NewRunnableMethod(this, &HTMLTrackElement::LoadResource)); diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp index 19c737b53f89..52a2dd7b398b 100644 --- a/dom/indexedDB/ActorsParent.cpp +++ b/dom/indexedDB/ActorsParent.cpp @@ -107,7 +107,7 @@ #define IDB_DEBUG_LOG(_args) \ MOZ_LOG(IndexedDatabaseManager::GetLoggingModule(), \ - LogLevel::Debug, \ + PR_LOG_DEBUG, \ _args ) #if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) diff --git a/dom/indexedDB/ProfilerHelpers.h b/dom/indexedDB/ProfilerHelpers.h index 70a720c02fa8..2466d219e587 100644 --- a/dom/indexedDB/ProfilerHelpers.h +++ b/dom/indexedDB/ProfilerHelpers.h @@ -282,9 +282,9 @@ LoggingHelper(bool aUseProfiler, const char* aFmt, ...) PRLogModuleInfo* logModule = IndexedDatabaseManager::GetLoggingModule(); MOZ_ASSERT(logModule); - static const mozilla::LogLevel logLevel = LogLevel::Warning; + static const PRLogModuleLevel logLevel = PR_LOG_WARNING; - if (MOZ_LOG_TEST(logModule, logLevel) || + if (PR_LOG_TEST(logModule, logLevel) || (aUseProfiler && profiler_is_active())) { nsAutoCString message; diff --git a/dom/ipc/ProcessPriorityManager.cpp b/dom/ipc/ProcessPriorityManager.cpp index 6e2788168bb4..3992a062a568 100644 --- a/dom/ipc/ProcessPriorityManager.cpp +++ b/dom/ipc/ProcessPriorityManager.cpp @@ -77,10 +77,10 @@ return sLog; } # define LOG(fmt, ...) \ - MOZ_LOG(GetPPMLog(), LogLevel::Debug, \ + MOZ_LOG(GetPPMLog(), PR_LOG_DEBUG, \ ("ProcessPriorityManager - " fmt, ##__VA_ARGS__)) # define LOGP(fmt, ...) \ - MOZ_LOG(GetPPMLog(), LogLevel::Debug, \ + MOZ_LOG(GetPPMLog(), PR_LOG_DEBUG, \ ("ProcessPriorityManager[%schild-id=%" PRIu64 ", pid=%d] - " fmt, \ NameWithComma().get(), \ static_cast(ChildID()), Pid(), ##__VA_ARGS__)) diff --git a/dom/media/AudioSink.cpp b/dom/media/AudioSink.cpp index 5fe6b692f56a..a36a27a36c74 100644 --- a/dom/media/AudioSink.cpp +++ b/dom/media/AudioSink.cpp @@ -12,9 +12,9 @@ namespace mozilla { extern PRLogModuleInfo* gMediaDecoderLog; #define SINK_LOG(msg, ...) \ - MOZ_LOG(gMediaDecoderLog, LogLevel::Debug, ("AudioSink=%p " msg, this, ##__VA_ARGS__)) + MOZ_LOG(gMediaDecoderLog, PR_LOG_DEBUG, ("AudioSink=%p " msg, this, ##__VA_ARGS__)) #define SINK_LOG_V(msg, ...) \ - MOZ_LOG(gMediaDecoderLog, LogLevel::Verbose, ("AudioSink=%p " msg, this, ##__VA_ARGS__)) + MOZ_LOG(gMediaDecoderLog, PR_LOG_DEBUG+1, ("AudioSink=%p " msg, this, ##__VA_ARGS__)) AudioSink::OnAudioEndTimeUpdateTask::OnAudioEndTimeUpdateTask( MediaDecoderStateMachine* aStateMachine) diff --git a/dom/media/AudioStream.cpp b/dom/media/AudioStream.cpp index 1c1de6758c55..58aaea265852 100644 --- a/dom/media/AudioStream.cpp +++ b/dom/media/AudioStream.cpp @@ -31,7 +31,7 @@ namespace mozilla { PRLogModuleInfo* gAudioStreamLog = nullptr; // For simple logs -#define LOG(x) MOZ_LOG(gAudioStreamLog, mozilla::LogLevel::Debug, x) +#define LOG(x) MOZ_LOG(gAudioStreamLog, PR_LOG_DEBUG, x) /** * When MOZ_DUMP_AUDIO is set in the environment (to anything), @@ -330,7 +330,7 @@ AudioStream::Init(int32_t aNumChannels, int32_t aRate, return NS_ERROR_FAILURE; } - MOZ_LOG(gAudioStreamLog, LogLevel::Debug, + MOZ_LOG(gAudioStreamLog, PR_LOG_DEBUG, ("%s channels: %d, rate: %d for %p", __FUNCTION__, aNumChannels, aRate, this)); mInRate = mOutRate = aRate; mChannels = aNumChannels; @@ -547,12 +547,12 @@ AudioStream::CheckForStart() if (mLatencyRequest == LowLatency || mNeedsStart) { StartUnlocked(); // mState = STARTED or ERRORED mNeedsStart = false; - MOZ_LOG(gAudioStreamLog, LogLevel::Warning, + MOZ_LOG(gAudioStreamLog, PR_LOG_WARNING, ("Started waiting %s-latency stream", mLatencyRequest == LowLatency ? "low" : "high")); } else { // high latency, not full - OR Pause() was called before we got here - MOZ_LOG(gAudioStreamLog, LogLevel::Debug, + MOZ_LOG(gAudioStreamLog, PR_LOG_DEBUG, ("Not starting waiting %s-latency stream", mLatencyRequest == LowLatency ? "low" : "high")); } @@ -612,7 +612,7 @@ AudioStream::Write(const AudioDataValue* aBuf, uint32_t aFrames, TimeStamp *aTim uint32_t bytesToCopy = FramesToBytes(aFrames); // XXX this will need to change if we want to enable this on-the-fly! - if (MOZ_LOG_TEST(GetLatencyLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) { // Record the position and time this data was inserted int64_t timeMs; if (aTime && !aTime->IsNull()) { @@ -645,7 +645,7 @@ AudioStream::Write(const AudioDataValue* aBuf, uint32_t aFrames, TimeStamp *aTim remains = mBuffer.Length() - bytesToCopy; // Free up just enough space } // account for dropping samples - MOZ_LOG(gAudioStreamLog, LogLevel::Warning, ("Stream %p dropping %u bytes (%u frames)in Write()", + MOZ_LOG(gAudioStreamLog, PR_LOG_WARNING, ("Stream %p dropping %u bytes (%u frames)in Write()", this, mBuffer.Length() - remains, BytesToFrames(mBuffer.Length() - remains))); mReadPoint += BytesToFrames(mBuffer.Length() - remains); mBuffer.ContractTo(remains); @@ -653,14 +653,14 @@ AudioStream::Write(const AudioDataValue* aBuf, uint32_t aFrames, TimeStamp *aTim // If we are not playing, but our buffer is full, start playing to make // room for soon-to-be-decoded data. if (mState != STARTED && mState != RUNNING) { - MOZ_LOG(gAudioStreamLog, LogLevel::Warning, ("Starting stream %p in Write (%u waiting)", + MOZ_LOG(gAudioStreamLog, PR_LOG_WARNING, ("Starting stream %p in Write (%u waiting)", this, bytesToCopy)); StartUnlocked(); if (mState == ERRORED) { return NS_ERROR_FAILURE; } } - MOZ_LOG(gAudioStreamLog, LogLevel::Warning, ("Stream %p waiting in Write() (%u waiting)", + MOZ_LOG(gAudioStreamLog, PR_LOG_WARNING, ("Stream %p waiting in Write() (%u waiting)", this, bytesToCopy)); mon.Wait(); } @@ -1073,16 +1073,16 @@ AudioStream::DataCallback(void* aBuffer, long aFrames) TimeStamp now = TimeStamp::Now(); if (!mStartTime.IsNull()) { int64_t timeMs = (now - mStartTime).ToMilliseconds(); - MOZ_LOG(gAudioStreamLog, LogLevel::Warning, + MOZ_LOG(gAudioStreamLog, PR_LOG_WARNING, ("Stream took %lldms to start after first Write() @ %u", timeMs, mOutRate)); } else { - MOZ_LOG(gAudioStreamLog, LogLevel::Warning, + MOZ_LOG(gAudioStreamLog, PR_LOG_WARNING, ("Stream started before Write() @ %u", mOutRate)); } if (old_len != available) { // Note that we may have dropped samples in Write() as well! - MOZ_LOG(gAudioStreamLog, LogLevel::Warning, + MOZ_LOG(gAudioStreamLog, PR_LOG_WARNING, ("AudioStream %p dropped %u + %u initial frames @ %u", this, mReadPoint, BytesToFrames(old_len - available), mOutRate)); mReadPoint += BytesToFrames(old_len - available); @@ -1123,7 +1123,7 @@ AudioStream::DataCallback(void* aBuffer, long aFrames) uint8_t* rpos = static_cast(aBuffer) + FramesToBytes(aFrames - underrunFrames); memset(rpos, 0, FramesToBytes(underrunFrames)); if (underrunFrames) { - MOZ_LOG(gAudioStreamLog, LogLevel::Warning, + MOZ_LOG(gAudioStreamLog, PR_LOG_WARNING, ("AudioStream %p lost %d frames", this, underrunFrames)); } servicedFrames += underrunFrames; @@ -1133,7 +1133,7 @@ AudioStream::DataCallback(void* aBuffer, long aFrames) WriteDumpFile(mDumpFile, this, aFrames, aBuffer); // Don't log if we're not interested or if the stream is inactive - if (MOZ_LOG_TEST(GetLatencyLog(), LogLevel::Debug) && + if (PR_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG) && mState != SHUTDOWN && insertTime != INT64_MAX && servicedFrames > underrunFrames) { uint32_t latency = UINT32_MAX; diff --git a/dom/media/GraphDriver.cpp b/dom/media/GraphDriver.cpp index c61d2b37b913..f8a7cc046df8 100644 --- a/dom/media/GraphDriver.cpp +++ b/dom/media/GraphDriver.cpp @@ -69,7 +69,7 @@ void GraphDriver::SetGraphTime(GraphDriver* aPreviousDriver, mStateComputedTime = aLastSwitchStateComputedTime; mNextStateComputedTime = aLastSwitchNextStateComputedTime; - STREAM_LOG(LogLevel::Debug, ("Setting previous driver: %p (%s)", aPreviousDriver, aPreviousDriver->AsAudioCallbackDriver() ? "AudioCallbackDriver" : "SystemClockDriver")); + STREAM_LOG(PR_LOG_DEBUG, ("Setting previous driver: %p (%s)", aPreviousDriver, aPreviousDriver->AsAudioCallbackDriver() ? "AudioCallbackDriver" : "SystemClockDriver")); MOZ_ASSERT(!mPreviousDriver); mPreviousDriver = aPreviousDriver; } @@ -182,7 +182,7 @@ public: NS_IMETHOD Run() { char aLocal; - STREAM_LOG(LogLevel::Debug, ("Starting system thread")); + STREAM_LOG(PR_LOG_DEBUG, ("Starting system thread")); profiler_register_thread("MediaStreamGraph", &aLocal); LIFECYCLE_LOG("Starting a new system driver for graph %p\n", mDriver->mGraphImpl); @@ -236,7 +236,7 @@ ThreadedDriver::Revive() { // Note: only called on MainThread, without monitor // We know were weren't in a running state - STREAM_LOG(LogLevel::Debug, ("AudioCallbackDriver reviving.")); + STREAM_LOG(PR_LOG_DEBUG, ("AudioCallbackDriver reviving.")); // If we were switching, switch now. Otherwise, tell thread to run the main // loop again. MonitorAutoLock mon(mGraphImpl->GetMonitor()); @@ -256,7 +256,7 @@ ThreadedDriver::Stop() { NS_ASSERTION(NS_IsMainThread(), "Must be called on main thread"); // mGraph's thread is not running so it's OK to do whatever here - STREAM_LOG(LogLevel::Debug, ("Stopping threads for MediaStreamGraph %p", this)); + STREAM_LOG(PR_LOG_DEBUG, ("Stopping threads for MediaStreamGraph %p", this)); if (mThread) { mThread->Shutdown(); @@ -287,7 +287,7 @@ ThreadedDriver::RunThread() mNextStateComputedTime = mGraphImpl->RoundUpToNextAudioBlock( nextCurrentTime + mGraphImpl->MillisecondsToMediaTime(AUDIO_TARGET_MS)); - STREAM_LOG(LogLevel::Debug, + STREAM_LOG(PR_LOG_DEBUG, ("interval[%ld; %ld] state[%ld; %ld]", (long)mIterationStart, (long)mIterationEnd, (long)mStateComputedTime, (long)mNextStateComputedTime)); @@ -300,7 +300,7 @@ ThreadedDriver::RunThread() mNextStateComputedTime); if (mNextDriver && stillProcessing) { - STREAM_LOG(LogLevel::Debug, ("Switching to AudioCallbackDriver")); + STREAM_LOG(PR_LOG_DEBUG, ("Switching to AudioCallbackDriver")); mNextDriver->SetGraphTime(this, mIterationStart, mIterationEnd, mStateComputedTime, mNextStateComputedTime); mGraphImpl->SetCurrentDriver(mNextDriver); @@ -319,20 +319,20 @@ SystemClockDriver::GetIntervalForIteration(GraphTime& aFrom, GraphTime& aTo) mCurrentTimeStamp = now; - MOZ_LOG(gMediaStreamGraphLog, LogLevel::Verbose, ("Updating current time to %f (real %f, mStateComputedTime %f)", + MOZ_LOG(gMediaStreamGraphLog, PR_LOG_DEBUG+1, ("Updating current time to %f (real %f, mStateComputedTime %f)", mGraphImpl->MediaTimeToSeconds(aTo), (now - mInitialTimeStamp).ToSeconds(), mGraphImpl->MediaTimeToSeconds(StateComputedTime()))); if (mStateComputedTime < aTo) { - STREAM_LOG(LogLevel::Warning, ("Media graph global underrun detected")); + STREAM_LOG(PR_LOG_WARNING, ("Media graph global underrun detected")); aTo = mIterationEnd = mStateComputedTime; } if (aFrom >= aTo) { NS_ASSERTION(aFrom == aTo , "Time can't go backwards!"); // This could happen due to low clock resolution, maybe? - STREAM_LOG(LogLevel::Debug, ("Time did not advance")); + STREAM_LOG(PR_LOG_DEBUG, ("Time did not advance")); } } @@ -363,7 +363,7 @@ SystemClockDriver::WaitForNextIteration() // least once a minute, if we need to wake up at all timeoutMS = std::max(0, std::min(timeoutMS, 60*1000)); timeout = PR_MillisecondsToInterval(uint32_t(timeoutMS)); - STREAM_LOG(LogLevel::Verbose, ("Waiting for next iteration; at %f, timeout=%f", (now - mInitialTimeStamp).ToSeconds(), timeoutMS/1000.0)); + STREAM_LOG(PR_LOG_DEBUG+1, ("Waiting for next iteration; at %f, timeout=%f", (now - mInitialTimeStamp).ToSeconds(), timeoutMS/1000.0)); if (mWaitState == WAITSTATE_WAITING_INDEFINITELY) { mGraphImpl->mGraphDriverAsleep = false; // atomic } @@ -374,7 +374,7 @@ SystemClockDriver::WaitForNextIteration() } if (timeout > 0) { mGraphImpl->GetMonitor().Wait(timeout); - STREAM_LOG(LogLevel::Verbose, ("Resuming after timeout; at %f, elapsed=%f", + STREAM_LOG(PR_LOG_DEBUG+1, ("Resuming after timeout; at %f, elapsed=%f", (TimeStamp::Now() - mInitialTimeStamp).ToSeconds(), (TimeStamp::Now() - now).ToSeconds())); } @@ -439,14 +439,14 @@ OfflineClockDriver::GetIntervalForIteration(GraphTime& aFrom, GraphTime& aTo) aTo = mIterationEnd = IterationEnd() + mGraphImpl->MillisecondsToMediaTime(mSlice); if (mStateComputedTime < aTo) { - STREAM_LOG(LogLevel::Warning, ("Media graph global underrun detected")); + STREAM_LOG(PR_LOG_WARNING, ("Media graph global underrun detected")); aTo = mIterationEnd = mStateComputedTime; } if (aFrom >= aTo) { NS_ASSERTION(aFrom == aTo , "Time can't go backwards!"); // This could happen due to low clock resolution, maybe? - STREAM_LOG(LogLevel::Debug, ("Time did not advance")); + STREAM_LOG(PR_LOG_DEBUG, ("Time did not advance")); } } @@ -545,7 +545,7 @@ AudioCallbackDriver::AudioCallbackDriver(MediaStreamGraphImpl* aGraphImpl, dom:: , mCallbackReceivedWhileSwitching(0) #endif { - STREAM_LOG(LogLevel::Debug, ("AudioCallbackDriver ctor for graph %p", aGraphImpl)); + STREAM_LOG(PR_LOG_DEBUG, ("AudioCallbackDriver ctor for graph %p", aGraphImpl)); } AudioCallbackDriver::~AudioCallbackDriver() @@ -613,21 +613,21 @@ AudioCallbackDriver::Init() StartStream(); - STREAM_LOG(LogLevel::Debug, ("AudioCallbackDriver started.")); + STREAM_LOG(PR_LOG_DEBUG, ("AudioCallbackDriver started.")); } void AudioCallbackDriver::Destroy() { - STREAM_LOG(LogLevel::Debug, ("AudioCallbackDriver destroyed.")); + STREAM_LOG(PR_LOG_DEBUG, ("AudioCallbackDriver destroyed.")); mAudioStream.reset(); } void AudioCallbackDriver::Resume() { - STREAM_LOG(LogLevel::Debug, ("Resuming audio threads for MediaStreamGraph %p", mGraphImpl)); + STREAM_LOG(PR_LOG_DEBUG, ("Resuming audio threads for MediaStreamGraph %p", mGraphImpl)); if (cubeb_stream_start(mAudioStream) != CUBEB_OK) { NS_WARNING("Could not start cubeb stream for MSG."); } @@ -639,12 +639,12 @@ AudioCallbackDriver::Start() // If this is running on the main thread, we can't open the stream directly, // because it is a blocking operation. if (NS_IsMainThread()) { - STREAM_LOG(LogLevel::Debug, ("Starting audio threads for MediaStreamGraph %p from a new thread.", mGraphImpl)); + STREAM_LOG(PR_LOG_DEBUG, ("Starting audio threads for MediaStreamGraph %p from a new thread.", mGraphImpl)); nsRefPtr initEvent = new AsyncCubebTask(this, AsyncCubebOperation::INIT); initEvent->Dispatch(); } else { - STREAM_LOG(LogLevel::Debug, ("Starting audio threads for MediaStreamGraph %p from the previous driver's thread", mGraphImpl)); + STREAM_LOG(PR_LOG_DEBUG, ("Starting audio threads for MediaStreamGraph %p from the previous driver's thread", mGraphImpl)); Init(); // Check if we need to resolve promises because the driver just got switched @@ -689,7 +689,7 @@ AudioCallbackDriver::Revive() { // Note: only called on MainThread, without monitor // We know were weren't in a running state - STREAM_LOG(LogLevel::Debug, ("AudioCallbackDriver reviving.")); + STREAM_LOG(PR_LOG_DEBUG, ("AudioCallbackDriver reviving.")); // If we were switching, switch now. Otherwise, start the audio thread again. MonitorAutoLock mon(mGraphImpl->GetMonitor()); if (mNextDriver) { @@ -698,7 +698,7 @@ AudioCallbackDriver::Revive() mGraphImpl->SetCurrentDriver(mNextDriver); mNextDriver->Start(); } else { - STREAM_LOG(LogLevel::Debug, ("Starting audio threads for MediaStreamGraph %p from a new thread.", mGraphImpl)); + STREAM_LOG(PR_LOG_DEBUG, ("Starting audio threads for MediaStreamGraph %p from a new thread.", mGraphImpl)); nsRefPtr initEvent = new AsyncCubebTask(this, AsyncCubebOperation::INIT); initEvent->Dispatch(); @@ -782,9 +782,9 @@ AudioCallbackDriver::OSXDeviceSwitchingWorkaround() // callback is called "some" number of times, and then stops being called, // and then gets called again. 10 is to be safe, it's a low-enough number // of milliseconds anyways (< 100ms) - //STREAM_LOG(LogLevel::Debug, ("Callbacks during switch: %d", mCallbackReceivedWhileSwitching+1)); + //STREAM_LOG(PR_LOG_DEBUG, ("Callbacks during switch: %d", mCallbackReceivedWhileSwitching+1)); if (mCallbackReceivedWhileSwitching++ >= 10) { - STREAM_LOG(LogLevel::Debug, ("Got %d callbacks, switching back to CallbackDriver", mCallbackReceivedWhileSwitching)); + STREAM_LOG(PR_LOG_DEBUG, ("Got %d callbacks, switching back to CallbackDriver", mCallbackReceivedWhileSwitching)); // If we have a self reference, we have fallen back temporarily on a // system clock driver, but we just got called back, that means the osx // audio backend has switched to the new device. @@ -883,7 +883,7 @@ AudioCallbackDriver::DataCallback(AudioDataValue* aBuffer, long aFrames) // reclock the current time against the state time, here. mIterationEnd = mIterationStart + 0.8 * inGraph; - STREAM_LOG(LogLevel::Debug, ("interval[%ld; %ld] state[%ld; %ld] (frames: %ld) (durationMS: %u) (duration ticks: %ld)\n", + STREAM_LOG(PR_LOG_DEBUG, ("interval[%ld; %ld] state[%ld; %ld] (frames: %ld) (durationMS: %u) (duration ticks: %ld)\n", (long)mIterationStart, (long)mIterationEnd, (long)mStateComputedTime, (long)mNextStateComputedTime, (long)aFrames, (uint32_t)durationMS, @@ -892,7 +892,7 @@ AudioCallbackDriver::DataCallback(AudioDataValue* aBuffer, long aFrames) mCurrentTimeStamp = TimeStamp::Now(); if (mStateComputedTime < mIterationEnd) { - STREAM_LOG(LogLevel::Warning, ("Media graph global underrun detected")); + STREAM_LOG(PR_LOG_WARNING, ("Media graph global underrun detected")); mIterationEnd = mStateComputedTime; } @@ -916,7 +916,7 @@ AudioCallbackDriver::DataCallback(AudioDataValue* aBuffer, long aFrames) return aFrames; } } - STREAM_LOG(LogLevel::Debug, ("Switching to system driver.")); + STREAM_LOG(PR_LOG_DEBUG, ("Switching to system driver.")); mNextDriver->SetGraphTime(this, mIterationStart, mIterationEnd, mStateComputedTime, mNextStateComputedTime); mGraphImpl->SetCurrentDriver(mNextDriver); @@ -936,7 +936,7 @@ AudioCallbackDriver::DataCallback(AudioDataValue* aBuffer, long aFrames) void AudioCallbackDriver::StateCallback(cubeb_state aState) { - STREAM_LOG(LogLevel::Debug, ("AudioCallbackDriver State: %d", aState)); + STREAM_LOG(PR_LOG_DEBUG, ("AudioCallbackDriver State: %d", aState)); } void @@ -1020,7 +1020,7 @@ AudioCallbackDriver::DeviceChangedCallback() { if (mSelfReference) { return; } - STREAM_LOG(LogLevel::Error, ("Switching to SystemClockDriver during output switch")); + STREAM_LOG(PR_LOG_ERROR, ("Switching to SystemClockDriver during output switch")); mSelfReference.Take(this); mCallbackReceivedWhileSwitching = 0; mGraphImpl->mFlushSourcesOnNextIteration = true; diff --git a/dom/media/Latency.cpp b/dom/media/Latency.cpp index 870bc99c98a5..9a620eaaba27 100644 --- a/dom/media/Latency.cpp +++ b/dom/media/Latency.cpp @@ -191,11 +191,11 @@ void AsyncLatencyLogger::WriteLog(LatencyLogIndex aIndex, uint64_t aID, int64_t TimeStamp aTimeStamp) { if (aTimeStamp.IsNull()) { - MOZ_LOG(GetLatencyLog(), LogLevel::Debug, + MOZ_LOG(GetLatencyLog(), PR_LOG_DEBUG, ("Latency: %s,%llu,%lld,%lld", LatencyLogIndex2Strings[aIndex], aID, GetTimeStamp(), aValue)); } else { - MOZ_LOG(GetLatencyLog(), LogLevel::Debug, + MOZ_LOG(GetLatencyLog(), PR_LOG_DEBUG, ("Latency: %s,%llu,%lld,%lld,%lld", LatencyLogIndex2Strings[aIndex], aID, GetTimeStamp(), aValue, static_cast((aTimeStamp - gAsyncLogger->mStart).ToMilliseconds()))); @@ -216,7 +216,7 @@ void AsyncLatencyLogger::Log(LatencyLogIndex aIndex, uint64_t aID, int64_t aValu void AsyncLatencyLogger::Log(LatencyLogIndex aIndex, uint64_t aID, int64_t aValue, TimeStamp &aTime) { - if (MOZ_LOG_TEST(GetLatencyLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) { nsCOMPtr event = new LogEvent(aIndex, aID, aValue, aTime); if (mThread) { mThread->Dispatch(event, NS_DISPATCH_NORMAL); diff --git a/dom/media/MediaCache.cpp b/dom/media/MediaCache.cpp index ab5248faf687..21872e943ac4 100644 --- a/dom/media/MediaCache.cpp +++ b/dom/media/MediaCache.cpp @@ -955,7 +955,7 @@ MediaCache::FreeBlock(int32_t aBlock) return; } - CACHE_LOG(LogLevel::Debug, ("Released block %d", aBlock)); + CACHE_LOG(PR_LOG_DEBUG, ("Released block %d", aBlock)); for (uint32_t i = 0; i < block->mOwners.Length(); ++i) { BlockOwner* bo = &block->mOwners[i]; @@ -1121,17 +1121,17 @@ MediaCache::Update() if (NS_SUCCEEDED(rv)) { // We successfully copied the file data. - CACHE_LOG(LogLevel::Debug, ("Swapping blocks %d and %d (trimming cache)", + CACHE_LOG(PR_LOG_DEBUG, ("Swapping blocks %d and %d (trimming cache)", blockIndex, destinationBlockIndex)); // Swapping the block metadata here lets us maintain the // correct positions in the linked lists SwapBlocks(blockIndex, destinationBlockIndex); //Free the overflowing block even if the copy failed. - CACHE_LOG(LogLevel::Debug, ("Released block %d (trimming cache)", blockIndex)); + CACHE_LOG(PR_LOG_DEBUG, ("Released block %d (trimming cache)", blockIndex)); FreeBlock(blockIndex); } } else { - CACHE_LOG(LogLevel::Debug, ("Could not trim cache block %d (destination %d, predicted next use %f, latest predicted use for overflow %f", + CACHE_LOG(PR_LOG_DEBUG, ("Could not trim cache block %d (destination %d, predicted next use %f, latest predicted use for overflow %f", blockIndex, destinationBlockIndex, PredictNextUse(now, destinationBlockIndex).ToSeconds(), latestPredictedUseForOverflow.ToSeconds())); @@ -1169,7 +1169,7 @@ MediaCache::Update() MediaCacheStream* stream = mStreams[i]; if (stream->mClosed) { - CACHE_LOG(LogLevel::Debug, ("Stream %p closed", stream)); + CACHE_LOG(PR_LOG_DEBUG, ("Stream %p closed", stream)); continue; } @@ -1220,29 +1220,29 @@ MediaCache::Update() // advertised with Content-Length, and we may as well keep reading. // But we don't want to seek to the end of the stream if we're not // already there. - CACHE_LOG(LogLevel::Debug, ("Stream %p at end of stream", stream)); + CACHE_LOG(PR_LOG_DEBUG, ("Stream %p at end of stream", stream)); enableReading = !stream->mCacheSuspended && stream->mStreamLength == stream->mChannelOffset; } else if (desiredOffset < stream->mStreamOffset) { // We're reading to try to catch up to where the current stream // reader wants to be. Better not stop. - CACHE_LOG(LogLevel::Debug, ("Stream %p catching up", stream)); + CACHE_LOG(PR_LOG_DEBUG, ("Stream %p catching up", stream)); enableReading = true; } else if (desiredOffset < stream->mStreamOffset + BLOCK_SIZE) { // The stream reader is waiting for us, or nearly so. Better feed it. - CACHE_LOG(LogLevel::Debug, ("Stream %p feeding reader", stream)); + CACHE_LOG(PR_LOG_DEBUG, ("Stream %p feeding reader", stream)); enableReading = true; } else if (!stream->mIsTransportSeekable && nonSeekableReadaheadBlockCount >= maxBlocks*NONSEEKABLE_READAHEAD_MAX) { // This stream is not seekable and there are already too many blocks // being cached for readahead for nonseekable streams (which we can't // free). So stop reading ahead now. - CACHE_LOG(LogLevel::Debug, ("Stream %p throttling non-seekable readahead", stream)); + CACHE_LOG(PR_LOG_DEBUG, ("Stream %p throttling non-seekable readahead", stream)); enableReading = false; } else if (mIndex.Length() > uint32_t(maxBlocks)) { // We're in the process of bringing the cache size back to the // desired limit, so don't bring in more data yet - CACHE_LOG(LogLevel::Debug, ("Stream %p throttling to reduce cache size", stream)); + CACHE_LOG(PR_LOG_DEBUG, ("Stream %p throttling to reduce cache size", stream)); enableReading = false; } else { TimeDuration predictedNewDataUse = PredictNextUseForIncomingData(stream); @@ -1250,24 +1250,24 @@ MediaCache::Update() if (stream->mCacheSuspended && predictedNewDataUse.ToSeconds() > resumeThreshold) { // Don't need data for a while, so don't bother waking up the stream - CACHE_LOG(LogLevel::Debug, ("Stream %p avoiding wakeup since more data is not needed", stream)); + CACHE_LOG(PR_LOG_DEBUG, ("Stream %p avoiding wakeup since more data is not needed", stream)); enableReading = false; } else if (predictedNewDataUse.ToSeconds() > readaheadLimit) { // Don't read ahead more than this much - CACHE_LOG(LogLevel::Debug, ("Stream %p throttling to avoid reading ahead too far", stream)); + CACHE_LOG(PR_LOG_DEBUG, ("Stream %p throttling to avoid reading ahead too far", stream)); enableReading = false; } else if (freeBlockCount > 0) { // Free blocks in the cache, so keep reading - CACHE_LOG(LogLevel::Debug, ("Stream %p reading since there are free blocks", stream)); + CACHE_LOG(PR_LOG_DEBUG, ("Stream %p reading since there are free blocks", stream)); enableReading = true; } else if (latestNextUse <= TimeDuration(0)) { // No reusable blocks, so can't read anything - CACHE_LOG(LogLevel::Debug, ("Stream %p throttling due to no reusable blocks", stream)); + CACHE_LOG(PR_LOG_DEBUG, ("Stream %p throttling due to no reusable blocks", stream)); enableReading = false; } else { // Read ahead if the data we expect to read is more valuable than // the least valuable block in the main part of the cache - CACHE_LOG(LogLevel::Debug, ("Stream %p predict next data in %f, current worst block is %f", + CACHE_LOG(PR_LOG_DEBUG, ("Stream %p predict next data in %f, current worst block is %f", stream, predictedNewDataUse.ToSeconds(), latestNextUse.ToSeconds())); enableReading = predictedNewDataUse < latestNextUse; } @@ -1282,7 +1282,7 @@ MediaCache::Update() // This block is already going to be read by the other stream. // So don't try to read it from this stream as well. enableReading = false; - CACHE_LOG(LogLevel::Debug, ("Stream %p waiting on same block (%lld) from stream %p", + CACHE_LOG(PR_LOG_DEBUG, ("Stream %p waiting on same block (%lld) from stream %p", stream, desiredOffset/BLOCK_SIZE, other)); break; } @@ -1346,18 +1346,18 @@ MediaCache::Update() switch (actions[i]) { case SEEK: case SEEK_AND_RESUME: - CACHE_LOG(LogLevel::Debug, ("Stream %p CacheSeek to %lld (resume=%d)", stream, + CACHE_LOG(PR_LOG_DEBUG, ("Stream %p CacheSeek to %lld (resume=%d)", stream, (long long)stream->mChannelOffset, actions[i] == SEEK_AND_RESUME)); rv = stream->mClient->CacheClientSeek(stream->mChannelOffset, actions[i] == SEEK_AND_RESUME); break; case RESUME: - CACHE_LOG(LogLevel::Debug, ("Stream %p Resumed", stream)); + CACHE_LOG(PR_LOG_DEBUG, ("Stream %p Resumed", stream)); rv = stream->mClient->CacheClientResume(); QueueSuspendedStatusUpdate(stream->mResourceID); break; case SUSPEND: - CACHE_LOG(LogLevel::Debug, ("Stream %p Suspended", stream)); + CACHE_LOG(PR_LOG_DEBUG, ("Stream %p Suspended", stream)); rv = stream->mClient->CacheClientSuspend(); QueueSuspendedStatusUpdate(stream->mResourceID); break; @@ -1497,7 +1497,7 @@ MediaCache::AllocateAndWriteBlock(MediaCacheStream* aStream, const void* aData, if (stream->mBlocks[streamBlockIndex] >= 0) { // We no longer want to own this block int32_t globalBlockIndex = stream->mBlocks[streamBlockIndex]; - CACHE_LOG(LogLevel::Debug, ("Released block %d from stream %p block %d(%lld)", + CACHE_LOG(PR_LOG_DEBUG, ("Released block %d from stream %p block %d(%lld)", globalBlockIndex, stream, streamBlockIndex, (long long)streamBlockIndex*BLOCK_SIZE)); RemoveBlockOwner(globalBlockIndex, stream); } @@ -1511,7 +1511,7 @@ MediaCache::AllocateAndWriteBlock(MediaCacheStream* aStream, const void* aData, FreeBlock(blockIndex); Block* block = &mIndex[blockIndex]; - CACHE_LOG(LogLevel::Debug, ("Allocated block %d to stream %p block %d(%lld)", + CACHE_LOG(PR_LOG_DEBUG, ("Allocated block %d to stream %p block %d(%lld)", blockIndex, aStream, streamBlockIndex, (long long)streamBlockIndex*BLOCK_SIZE)); mFreeBlocks.RemoveBlock(blockIndex); @@ -1546,7 +1546,7 @@ MediaCache::AllocateAndWriteBlock(MediaCacheStream* aStream, const void* aData, nsresult rv = mFileCache->WriteBlock(blockIndex, reinterpret_cast(aData)); if (NS_FAILED(rv)) { - CACHE_LOG(LogLevel::Debug, ("Released block %d from stream %p block %d(%lld)", + CACHE_LOG(PR_LOG_DEBUG, ("Released block %d from stream %p block %d(%lld)", blockIndex, aStream, streamBlockIndex, (long long)streamBlockIndex*BLOCK_SIZE)); FreeBlock(blockIndex); } @@ -1563,7 +1563,7 @@ MediaCache::OpenStream(MediaCacheStream* aStream) NS_ASSERTION(NS_IsMainThread(), "Only call on main thread"); ReentrantMonitorAutoEnter mon(mReentrantMonitor); - CACHE_LOG(LogLevel::Debug, ("Stream %p opened", aStream)); + CACHE_LOG(PR_LOG_DEBUG, ("Stream %p opened", aStream)); mStreams.AppendElement(aStream); aStream->mResourceID = AllocateResourceID(); @@ -1577,7 +1577,7 @@ MediaCache::ReleaseStream(MediaCacheStream* aStream) NS_ASSERTION(NS_IsMainThread(), "Only call on main thread"); ReentrantMonitorAutoEnter mon(mReentrantMonitor); - CACHE_LOG(LogLevel::Debug, ("Stream %p closed", aStream)); + CACHE_LOG(PR_LOG_DEBUG, ("Stream %p closed", aStream)); mStreams.RemoveElement(aStream); // Update MediaCache again for |mStreams| is changed. @@ -1598,7 +1598,7 @@ MediaCache::ReleaseStreamBlocks(MediaCacheStream* aStream) for (uint32_t i = 0; i < length; ++i) { int32_t blockIndex = aStream->mBlocks[i]; if (blockIndex >= 0) { - CACHE_LOG(LogLevel::Debug, ("Released block %d from stream %p block %d(%lld)", + CACHE_LOG(PR_LOG_DEBUG, ("Released block %d from stream %p block %d(%lld)", blockIndex, aStream, i, (long long)i*BLOCK_SIZE)); RemoveBlockOwner(blockIndex, aStream); } @@ -1769,7 +1769,7 @@ MediaCacheStream::NotifyDataReceived(int64_t aSize, const char* aData, int64_t size = aSize; const char* data = aData; - CACHE_LOG(LogLevel::Debug, ("Stream %p DataReceived at %lld count=%lld", + CACHE_LOG(PR_LOG_DEBUG, ("Stream %p DataReceived at %lld count=%lld", this, (long long)mChannelOffset, (long long)aSize)); // We process the data one block (or part of a block) at a time @@ -1837,7 +1837,7 @@ MediaCacheStream::FlushPartialBlockInternal(bool aNotifyAll) int32_t blockOffset = int32_t(mChannelOffset%BLOCK_SIZE); if (blockOffset > 0) { - CACHE_LOG(LogLevel::Debug, + CACHE_LOG(PR_LOG_DEBUG, ("Stream %p writing partial block: [%d] bytes; " "mStreamOffset [%lld] mChannelOffset[%lld] mStreamLength [%lld] " "notifying: [%s]", @@ -2186,7 +2186,7 @@ MediaCacheStream::Seek(int32_t aWhence, int64_t aOffset) return NS_ERROR_FAILURE; mStreamOffset = newOffset; - CACHE_LOG(LogLevel::Debug, ("Stream %p Seek to %lld", this, (long long)mStreamOffset)); + CACHE_LOG(PR_LOG_DEBUG, ("Stream %p Seek to %lld", this, (long long)mStreamOffset)); gMediaCache->NoteSeek(this, oldOffset); gMediaCache->QueueUpdate(); @@ -2303,7 +2303,7 @@ MediaCacheStream::Read(char* aBuffer, uint32_t aCount, uint32_t* aBytes) // have changed gMediaCache->QueueUpdate(); } - CACHE_LOG(LogLevel::Debug, + CACHE_LOG(PR_LOG_DEBUG, ("Stream %p Read at %lld count=%d", this, (long long)(mStreamOffset-count), count)); *aBytes = count; return NS_OK; diff --git a/dom/media/MediaDecoder.cpp b/dom/media/MediaDecoder.cpp index 495245507260..516d9d1a847b 100644 --- a/dom/media/MediaDecoder.cpp +++ b/dom/media/MediaDecoder.cpp @@ -53,7 +53,7 @@ static const int64_t CAN_PLAY_THROUGH_MARGIN = 1; PRLogModuleInfo* gMediaDecoderLog; #define DECODER_LOG(x, ...) \ - MOZ_LOG(gMediaDecoderLog, LogLevel::Debug, ("Decoder=%p " x, this, ##__VA_ARGS__)) + MOZ_LOG(gMediaDecoderLog, PR_LOG_DEBUG, ("Decoder=%p " x, this, ##__VA_ARGS__)) static const char* const gPlayStateStr[] = { "START", diff --git a/dom/media/MediaDecoderReader.cpp b/dom/media/MediaDecoderReader.cpp index d644e391d984..d6c8707d6180 100644 --- a/dom/media/MediaDecoderReader.cpp +++ b/dom/media/MediaDecoderReader.cpp @@ -22,7 +22,7 @@ namespace mozilla { extern PRLogModuleInfo* gMediaDecoderLog; #define DECODER_LOG(x, ...) \ - MOZ_LOG(gMediaDecoderLog, LogLevel::Debug, ("Decoder=%p " x, mDecoder, ##__VA_ARGS__)) + MOZ_LOG(gMediaDecoderLog, PR_LOG_DEBUG, ("Decoder=%p " x, mDecoder, ##__VA_ARGS__)) // Same workaround as MediaDecoderStateMachine.cpp. #define DECODER_WARN_HELPER(a, b) NS_WARNING b diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp index 6defdb118071..46a5553232d5 100644 --- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -60,11 +60,11 @@ extern PRLogModuleInfo* gMediaSampleLog; #define LOG(m, l, x, ...) \ MOZ_LOG(m, l, ("Decoder=%p " x, mDecoder.get(), ##__VA_ARGS__)) #define DECODER_LOG(x, ...) \ - LOG(gMediaDecoderLog, LogLevel::Debug, x, ##__VA_ARGS__) + LOG(gMediaDecoderLog, PR_LOG_DEBUG, x, ##__VA_ARGS__) #define VERBOSE_LOG(x, ...) \ - LOG(gMediaDecoderLog, LogLevel::Verbose, x, ##__VA_ARGS__) + LOG(gMediaDecoderLog, PR_LOG_DEBUG+1, x, ##__VA_ARGS__) #define SAMPLE_LOG(x, ...) \ - LOG(gMediaSampleLog, LogLevel::Debug, x, ##__VA_ARGS__) + LOG(gMediaSampleLog, PR_LOG_DEBUG, x, ##__VA_ARGS__) // Somehow MSVC doesn't correctly delete the comma before ##__VA_ARGS__ // when __VA_ARGS__ expands to nothing. This is a workaround for it. diff --git a/dom/media/MediaFormatReader.cpp b/dom/media/MediaFormatReader.cpp index 123008532875..f686d3cb0024 100644 --- a/dom/media/MediaFormatReader.cpp +++ b/dom/media/MediaFormatReader.cpp @@ -35,8 +35,8 @@ PRLogModuleInfo* GetFormatDecoderLog() { } return log; } -#define LOG(arg, ...) MOZ_LOG(GetFormatDecoderLog(), mozilla::LogLevel::Debug, ("MediaFormatReader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) -#define LOGV(arg, ...) MOZ_LOG(GetFormatDecoderLog(), mozilla::LogLevel::Verbose, ("MediaFormatReader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) +#define LOG(arg, ...) MOZ_LOG(GetFormatDecoderLog(), PR_LOG_DEBUG, ("MediaFormatReader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) +#define LOGV(arg, ...) MOZ_LOG(GetFormatDecoderLog(), PR_LOG_DEBUG+1, ("MediaFormatReader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) namespace mozilla { diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp index 5dae431b96ff..cdff28dc4010 100644 --- a/dom/media/MediaManager.cpp +++ b/dom/media/MediaManager.cpp @@ -111,7 +111,7 @@ GetMediaManagerLog() sLog = PR_NewLogModule("MediaManager"); return sLog; } -#define LOG(msg) MOZ_LOG(GetMediaManagerLog(), mozilla::LogLevel::Debug, msg) +#define LOG(msg) MOZ_LOG(GetMediaManagerLog(), PR_LOG_DEBUG, msg) using dom::File; using dom::MediaStreamConstraints; diff --git a/dom/media/MediaManager.h b/dom/media/MediaManager.h index 77cb026fab94..97276598df69 100644 --- a/dom/media/MediaManager.h +++ b/dom/media/MediaManager.h @@ -49,7 +49,7 @@ struct MediaTrackConstraintSet; } extern PRLogModuleInfo* GetMediaManagerLog(); -#define MM_LOG(msg) MOZ_LOG(GetMediaManagerLog(), mozilla::LogLevel::Debug, msg) +#define MM_LOG(msg) MOZ_LOG(GetMediaManagerLog(), PR_LOG_DEBUG, msg) /** * This class is an implementation of MediaStreamListener. This is used diff --git a/dom/media/MediaPromise.h b/dom/media/MediaPromise.h index 58f285eb3b1f..f7f9340b63b7 100644 --- a/dom/media/MediaPromise.h +++ b/dom/media/MediaPromise.h @@ -31,7 +31,7 @@ extern PRLogModuleInfo* gMediaPromiseLog; #define PROMISE_LOG(x, ...) \ MOZ_ASSERT(gMediaPromiseLog); \ - MOZ_LOG(gMediaPromiseLog, mozilla::LogLevel::Debug, (x, ##__VA_ARGS__)) + MOZ_LOG(gMediaPromiseLog, PR_LOG_DEBUG, (x, ##__VA_ARGS__)) namespace detail { template diff --git a/dom/media/MediaRecorder.cpp b/dom/media/MediaRecorder.cpp index 5264cde1654f..f0e585bee2d5 100644 --- a/dom/media/MediaRecorder.cpp +++ b/dom/media/MediaRecorder.cpp @@ -168,7 +168,7 @@ class MediaRecorder::Session: public nsIObserver NS_IMETHODIMP Run() { - LOG(LogLevel::Debug, ("Session.PushBlobRunnable s=(%p)", mSession.get())); + LOG(PR_LOG_DEBUG, ("Session.PushBlobRunnable s=(%p)", mSession.get())); MOZ_ASSERT(NS_IsMainThread()); nsRefPtr recorder = mSession->mRecorder; @@ -198,7 +198,7 @@ class MediaRecorder::Session: public nsIObserver NS_IMETHODIMP Run() { - LOG(LogLevel::Debug, ("Session.ErrorNotifyRunnable s=(%p)", mSession.get())); + LOG(PR_LOG_DEBUG, ("Session.ErrorNotifyRunnable s=(%p)", mSession.get())); MOZ_ASSERT(NS_IsMainThread()); nsRefPtr recorder = mSession->mRecorder; @@ -227,7 +227,7 @@ class MediaRecorder::Session: public nsIObserver NS_IMETHODIMP Run() { - LOG(LogLevel::Debug, ("Session.DispatchStartEventRunnable s=(%p)", mSession.get())); + LOG(PR_LOG_DEBUG, ("Session.DispatchStartEventRunnable s=(%p)", mSession.get())); MOZ_ASSERT(NS_IsMainThread()); NS_ENSURE_TRUE(mSession->mRecorder, NS_OK); @@ -259,7 +259,7 @@ class MediaRecorder::Session: public nsIObserver { MOZ_ASSERT(NS_GetCurrentThread() == mSession->mReadThread); - LOG(LogLevel::Debug, ("Session.ExtractRunnable shutdown = %d", mSession->mEncoder->IsShutdown())); + LOG(PR_LOG_DEBUG, ("Session.ExtractRunnable shutdown = %d", mSession->mEncoder->IsShutdown())); if (!mSession->mEncoder->IsShutdown()) { mSession->Extract(false); nsCOMPtr event = new ExtractRunnable(mSession); @@ -304,7 +304,7 @@ class MediaRecorder::Session: public nsIObserver trackTypes |= ContainerWriter::CREATE_VIDEO_TRACK; } - LOG(LogLevel::Debug, ("Session.NotifyTracksAvailable track type = (%d)", trackTypes)); + LOG(PR_LOG_DEBUG, ("Session.NotifyTracksAvailable track type = (%d)", trackTypes)); mSession->InitEncoder(trackTypes); } private: @@ -320,7 +320,7 @@ class MediaRecorder::Session: public nsIObserver NS_IMETHODIMP Run() { - LOG(LogLevel::Debug, ("Session.DestroyRunnable session refcnt = (%d) stopIssued %d s=(%p)", + LOG(PR_LOG_DEBUG, ("Session.DestroyRunnable session refcnt = (%d) stopIssued %d s=(%p)", (int)mSession->mRefCnt, mSession->mStopIssued, mSession.get())); MOZ_ASSERT(NS_IsMainThread() && mSession.get()); nsRefPtr recorder = mSession->mRecorder; @@ -381,7 +381,7 @@ public: void Start() { - LOG(LogLevel::Debug, ("Session.Start %p", this)); + LOG(PR_LOG_DEBUG, ("Session.Start %p", this)); MOZ_ASSERT(NS_IsMainThread()); SetupStreams(); @@ -389,12 +389,12 @@ public: void Stop() { - LOG(LogLevel::Debug, ("Session.Stop %p", this)); + LOG(PR_LOG_DEBUG, ("Session.Stop %p", this)); MOZ_ASSERT(NS_IsMainThread()); mStopIssued = true; CleanupStreams(); if (mNeedSessionEndTask) { - LOG(LogLevel::Debug, ("Session.Stop mNeedSessionEndTask %p", this)); + LOG(PR_LOG_DEBUG, ("Session.Stop mNeedSessionEndTask %p", this)); // End the Session directly if there is no ExtractRunnable. DoSessionEndTask(NS_OK); } @@ -403,7 +403,7 @@ public: nsresult Pause() { - LOG(LogLevel::Debug, ("Session.Pause")); + LOG(PR_LOG_DEBUG, ("Session.Pause")); MOZ_ASSERT(NS_IsMainThread()); NS_ENSURE_TRUE(mTrackUnionStream, NS_ERROR_FAILURE); @@ -414,7 +414,7 @@ public: nsresult Resume() { - LOG(LogLevel::Debug, ("Session.Resume")); + LOG(PR_LOG_DEBUG, ("Session.Resume")); MOZ_ASSERT(NS_IsMainThread()); NS_ENSURE_TRUE(mTrackUnionStream, NS_ERROR_FAILURE); @@ -425,7 +425,7 @@ public: nsresult RequestData() { - LOG(LogLevel::Debug, ("Session.RequestData")); + LOG(PR_LOG_DEBUG, ("Session.RequestData")); MOZ_ASSERT(NS_IsMainThread()); if (NS_FAILED(NS_DispatchToMainThread(new EncoderErrorNotifierRunnable(this))) || @@ -464,7 +464,7 @@ private: // Only DestroyRunnable is allowed to delete Session object. virtual ~Session() { - LOG(LogLevel::Debug, ("Session.~Session (%p)", this)); + LOG(PR_LOG_DEBUG, ("Session.~Session (%p)", this)); CleanupStreams(); } // Pull encoded media data from MediaEncoder and put into EncodedBufferCache. @@ -474,7 +474,7 @@ private: void Extract(bool aForceFlush) { MOZ_ASSERT(NS_GetCurrentThread() == mReadThread); - LOG(LogLevel::Debug, ("Session.Extract %p", this)); + LOG(PR_LOG_DEBUG, ("Session.Extract %p", this)); if (!mIsRegisterProfiler) { char aLocal; @@ -577,11 +577,11 @@ private: void InitEncoder(uint8_t aTrackTypes) { - LOG(LogLevel::Debug, ("Session.InitEncoder %p", this)); + LOG(PR_LOG_DEBUG, ("Session.InitEncoder %p", this)); MOZ_ASSERT(NS_IsMainThread()); if (!mRecorder) { - LOG(LogLevel::Debug, ("Session.InitEncoder failure, mRecorder is null %p", this)); + LOG(PR_LOG_DEBUG, ("Session.InitEncoder failure, mRecorder is null %p", this)); return; } // Allocate encoder and bind with union stream. @@ -595,7 +595,7 @@ private: } if (!mEncoder) { - LOG(LogLevel::Debug, ("Session.InitEncoder !mEncoder %p", this)); + LOG(PR_LOG_DEBUG, ("Session.InitEncoder !mEncoder %p", this)); DoSessionEndTask(NS_ERROR_ABORT); return; } @@ -604,7 +604,7 @@ private: // The Session::stop would clean the mTrackUnionStream. If the AfterTracksAdded // comes after stop command, this function would crash. if (!mTrackUnionStream) { - LOG(LogLevel::Debug, ("Session.InitEncoder !mTrackUnionStream %p", this)); + LOG(PR_LOG_DEBUG, ("Session.InitEncoder !mTrackUnionStream %p", this)); DoSessionEndTask(NS_OK); return; } @@ -613,7 +613,7 @@ private: if (!mReadThread) { nsresult rv = NS_NewNamedThread("Media_Encoder", getter_AddRefs(mReadThread)); if (NS_FAILED(rv)) { - LOG(LogLevel::Debug, ("Session.InitEncoder !mReadThread %p", this)); + LOG(PR_LOG_DEBUG, ("Session.InitEncoder !mReadThread %p", this)); DoSessionEndTask(rv); return; } @@ -626,7 +626,7 @@ private: nsCOMPtr event = new ExtractRunnable(this); if (NS_FAILED(mReadThread->Dispatch(event, NS_DISPATCH_NORMAL))) { NS_WARNING("Failed to dispatch ExtractRunnable at beginning"); - LOG(LogLevel::Debug, ("Session.InitEncoder !ReadThread->Dispatch %p", this)); + LOG(PR_LOG_DEBUG, ("Session.InitEncoder !ReadThread->Dispatch %p", this)); DoSessionEndTask(NS_ERROR_ABORT); } // Set mNeedSessionEndTask to false because the @@ -672,7 +672,7 @@ private: NS_IMETHODIMP Observe(nsISupports *aSubject, const char *aTopic, const char16_t *aData) override { MOZ_ASSERT(NS_IsMainThread()); - LOG(LogLevel::Debug, ("Session.Observe XPCOM_SHUTDOWN %p", this)); + LOG(PR_LOG_DEBUG, ("Session.Observe XPCOM_SHUTDOWN %p", this)); if (strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) { // Force stop Session to terminate Read Thread. mEncoder->Cancel(); @@ -742,7 +742,7 @@ MediaRecorder::~MediaRecorder() mInputPort->Destroy(); mPipeStream->Destroy(); } - LOG(LogLevel::Debug, ("~MediaRecorder (%p)", this)); + LOG(PR_LOG_DEBUG, ("~MediaRecorder (%p)", this)); UnRegisterActivityObserver(); } @@ -832,7 +832,7 @@ MediaRecorder::GetMimeType(nsString &aMimeType) void MediaRecorder::Start(const Optional& aTimeSlice, ErrorResult& aResult) { - LOG(LogLevel::Debug, ("MediaRecorder.Start %p", this)); + LOG(PR_LOG_DEBUG, ("MediaRecorder.Start %p", this)); if (mState != RecordingState::Inactive) { aResult.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); return; @@ -874,7 +874,7 @@ MediaRecorder::Start(const Optional& aTimeSlice, ErrorResult& aResult) void MediaRecorder::Stop(ErrorResult& aResult) { - LOG(LogLevel::Debug, ("MediaRecorder.Stop %p", this)); + LOG(PR_LOG_DEBUG, ("MediaRecorder.Stop %p", this)); MediaRecorderReporter::RemoveMediaRecorder(this); if (mState == RecordingState::Inactive) { aResult.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); @@ -888,7 +888,7 @@ MediaRecorder::Stop(ErrorResult& aResult) void MediaRecorder::Pause(ErrorResult& aResult) { - LOG(LogLevel::Debug, ("MediaRecorder.Pause")); + LOG(PR_LOG_DEBUG, ("MediaRecorder.Pause")); if (mState != RecordingState::Recording) { aResult.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); return; @@ -906,7 +906,7 @@ MediaRecorder::Pause(ErrorResult& aResult) void MediaRecorder::Resume(ErrorResult& aResult) { - LOG(LogLevel::Debug, ("MediaRecorder.Resume")); + LOG(PR_LOG_DEBUG, ("MediaRecorder.Resume")); if (mState != RecordingState::Paused) { aResult.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); return; @@ -1112,7 +1112,7 @@ bool MediaRecorder::CheckPrincipal() void MediaRecorder::RemoveSession(Session* aSession) { - LOG(LogLevel::Debug, ("MediaRecorder.RemoveSession (%p)", aSession)); + LOG(PR_LOG_DEBUG, ("MediaRecorder.RemoveSession (%p)", aSession)); mSessions.RemoveElement(aSession); } @@ -1124,7 +1124,7 @@ MediaRecorder::NotifyOwnerDocumentActivityChanged() nsIDocument* doc = window->GetExtantDoc(); NS_ENSURE_TRUE_VOID(doc); - LOG(LogLevel::Debug, ("MediaRecorder %p document IsActive %d isVisible %d\n", + LOG(PR_LOG_DEBUG, ("MediaRecorder %p document IsActive %d isVisible %d\n", this, doc->IsActive(), doc->IsVisible())); if (!doc->IsActive() || !doc->IsVisible()) { // Stop the session. diff --git a/dom/media/MediaResource.cpp b/dom/media/MediaResource.cpp index 071a5caefb37..c1d9f528a84a 100644 --- a/dom/media/MediaResource.cpp +++ b/dom/media/MediaResource.cpp @@ -34,7 +34,7 @@ #include "nsIContentPolicy.h" PRLogModuleInfo* gMediaResourceLog; -#define RESOURCE_LOG(msg, ...) MOZ_LOG(gMediaResourceLog, mozilla::LogLevel::Debug, \ +#define RESOURCE_LOG(msg, ...) MOZ_LOG(gMediaResourceLog, PR_LOG_DEBUG, \ (msg, ##__VA_ARGS__)) // Debug logging macro with object pointer and class name. #define CMLOG(msg, ...) \ diff --git a/dom/media/MediaShutdownManager.cpp b/dom/media/MediaShutdownManager.cpp index ead32b74edba..4dfd2dd28d2e 100644 --- a/dom/media/MediaShutdownManager.cpp +++ b/dom/media/MediaShutdownManager.cpp @@ -113,7 +113,7 @@ MediaShutdownManager::Shutdown() MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(sInstance); - DECODER_LOG(LogLevel::Debug, ("MediaShutdownManager::Shutdown() start...")); + DECODER_LOG(PR_LOG_DEBUG, ("MediaShutdownManager::Shutdown() start...")); // Mark that we're shutting down, so that Unregister(*) calls don't remove // hashtable entries. If Unregsiter(*) was to remove from the hash table, @@ -139,7 +139,7 @@ MediaShutdownManager::Shutdown() // up after it finishes its notifications. sInstance = nullptr; - DECODER_LOG(LogLevel::Debug, ("MediaShutdownManager::Shutdown() end.")); + DECODER_LOG(PR_LOG_DEBUG, ("MediaShutdownManager::Shutdown() end.")); } } // namespace mozilla diff --git a/dom/media/MediaStreamGraph.cpp b/dom/media/MediaStreamGraph.cpp index b39f02f999dc..bc8bc75e9a54 100644 --- a/dom/media/MediaStreamGraph.cpp +++ b/dom/media/MediaStreamGraph.cpp @@ -68,7 +68,7 @@ MediaStreamGraphImpl::~MediaStreamGraphImpl() { NS_ASSERTION(IsEmpty(), "All streams should have been destroyed by messages from the main thread"); - STREAM_LOG(LogLevel::Debug, ("MediaStreamGraph %p destroyed", this)); + STREAM_LOG(PR_LOG_DEBUG, ("MediaStreamGraph %p destroyed", this)); LIFECYCLE_LOG("MediaStreamGraphImpl::~MediaStreamGraphImpl\n"); } @@ -88,7 +88,7 @@ MediaStreamGraphImpl::FinishStream(MediaStream* aStream) { if (aStream->mFinished) return; - STREAM_LOG(LogLevel::Debug, ("MediaStream %p will finish", aStream)); + STREAM_LOG(PR_LOG_DEBUG, ("MediaStream %p will finish", aStream)); aStream->mFinished = true; aStream->mBuffer.AdvanceKnownTracksTime(STREAM_TIME_MAX); // Force at least one more iteration of the control loop, since we rely @@ -118,11 +118,11 @@ MediaStreamGraphImpl::AddStream(MediaStream* aStream) if (contextSuspended) { aStream->mBufferStartTime = START_TIME_DELAYED; mSuspendedStreams.AppendElement(aStream); - STREAM_LOG(LogLevel::Debug, ("Adding media stream %p to the graph, in the suspended stream array", aStream)); + STREAM_LOG(PR_LOG_DEBUG, ("Adding media stream %p to the graph, in the suspended stream array", aStream)); } else { aStream->mBufferStartTime = IterationEnd(); mStreams.AppendElement(aStream); - STREAM_LOG(LogLevel::Debug, ("Adding media stream %p to the graph", aStream)); + STREAM_LOG(PR_LOG_DEBUG, ("Adding media stream %p to the graph", aStream)); } SetStreamOrderDirty(); @@ -151,7 +151,7 @@ MediaStreamGraphImpl::RemoveStream(MediaStream* aStream) NS_RELEASE(aStream); // probably destroying it - STREAM_LOG(LogLevel::Debug, ("Removing media stream %p from the graph", aStream)); + STREAM_LOG(PR_LOG_DEBUG, ("Removing media stream %p from the graph", aStream)); } void @@ -185,14 +185,14 @@ MediaStreamGraphImpl::ExtractPendingInput(SourceMediaStream* aStream, StreamTime t = GraphTimeToStreamTime(aStream, CurrentDriver()->StateComputedTime()) + (aDesiredUpToTime - CurrentDriver()->StateComputedTime()); - STREAM_LOG(LogLevel::Verbose, ("Calling NotifyPull aStream=%p t=%f current end=%f", aStream, + STREAM_LOG(PR_LOG_DEBUG+1, ("Calling NotifyPull aStream=%p t=%f current end=%f", aStream, MediaTimeToSeconds(t), MediaTimeToSeconds(aStream->mBuffer.GetEnd()))); if (t > aStream->mBuffer.GetEnd()) { *aEnsureNextIteration = true; #ifdef DEBUG if (aStream->mListeners.Length() == 0) { - STREAM_LOG(LogLevel::Error, ("No listeners in NotifyPull aStream=%p desired=%f current end=%f", + STREAM_LOG(PR_LOG_ERROR, ("No listeners in NotifyPull aStream=%p desired=%f current end=%f", aStream, MediaTimeToSeconds(t), MediaTimeToSeconds(aStream->mBuffer.GetEnd()))); aStream->DumpTrackInfo(); @@ -220,7 +220,7 @@ MediaStreamGraphImpl::ExtractPendingInput(SourceMediaStream* aStream, } if (data->mCommands & SourceMediaStream::TRACK_CREATE) { MediaSegment* segment = data->mData.forget(); - STREAM_LOG(LogLevel::Debug, ("SourceMediaStream %p creating track %d, start %lld, initial end %lld", + STREAM_LOG(PR_LOG_DEBUG, ("SourceMediaStream %p creating track %d, start %lld, initial end %lld", aStream, data->mID, int64_t(data->mStart), int64_t(segment->GetDuration()))); @@ -233,7 +233,7 @@ MediaStreamGraphImpl::ExtractPendingInput(SourceMediaStream* aStream, notifiedTrackCreated = true; } else if (data->mData->GetDuration() > 0) { MediaSegment* dest = aStream->mBuffer.FindTrack(data->mID)->GetSegment(); - STREAM_LOG(LogLevel::Verbose, ("SourceMediaStream %p track %d, advancing end from %lld to %lld", + STREAM_LOG(PR_LOG_DEBUG+1, ("SourceMediaStream %p track %d, advancing end from %lld to %lld", aStream, data->mID, int64_t(dest->GetDuration()), int64_t(dest->GetDuration() + data->mData->GetDuration()))); @@ -482,7 +482,7 @@ MediaStreamGraphImpl::UpdateCurrentTimeForStreams(GraphTime aPrevCurrentTime, StreamReadyToFinish(stream); } } - STREAM_LOG(LogLevel::Verbose, + STREAM_LOG(PR_LOG_DEBUG + 1, ("MediaStream %p bufferStartTime=%f blockedTime=%f", stream, MediaTimeToSeconds(stream->mBufferStartTime), MediaTimeToSeconds(blockedTime))); @@ -505,7 +505,7 @@ MediaStreamGraphImpl::WillUnderrun(MediaStream* aStream, GraphTime aTime, INCLUDE_TRAILING_BLOCKED_INTERVAL); #ifdef DEBUG if (bufferEnd < IterationEnd()) { - STREAM_LOG(LogLevel::Error, ("MediaStream %p underrun, " + STREAM_LOG(PR_LOG_ERROR, ("MediaStream %p underrun, " "bufferEnd %f < IterationEnd() %f (%lld < %lld), Streamtime %lld", aStream, MediaTimeToSeconds(bufferEnd), MediaTimeToSeconds(IterationEnd()), bufferEnd, IterationEnd(), aStream->GetBufferEnd())); @@ -515,7 +515,7 @@ MediaStreamGraphImpl::WillUnderrun(MediaStream* aStream, GraphTime aTime, #endif // We should block after bufferEnd. if (bufferEnd <= aTime) { - STREAM_LOG(LogLevel::Verbose, ("MediaStream %p will block due to data underrun at %ld, " + STREAM_LOG(PR_LOG_DEBUG+1, ("MediaStream %p will block due to data underrun at %ld, " "bufferEnd %ld", aStream, aTime, bufferEnd)); return true; @@ -526,7 +526,7 @@ MediaStreamGraphImpl::WillUnderrun(MediaStream* aStream, GraphTime aTime, // but we might as well remain unblocked and play the data we've got while // we can. if (bufferEnd < aEndBlockingDecisions && aStream->mBlocked.GetBefore(aTime)) { - STREAM_LOG(LogLevel::Verbose, ("MediaStream %p will block due to speculative data underrun, " + STREAM_LOG(PR_LOG_DEBUG+1, ("MediaStream %p will block due to speculative data underrun, " "bufferEnd %f (end at %ld)", aStream, MediaTimeToSeconds(bufferEnd), bufferEnd)); return true; @@ -813,7 +813,7 @@ MediaStreamGraphImpl::RecomputeBlocking(GraphTime aEndBlockingDecisions) { bool blockingDecisionsWillChange = false; - STREAM_LOG(LogLevel::Verbose, ("Media graph %p computing blocking for time %f", + STREAM_LOG(PR_LOG_DEBUG+1, ("Media graph %p computing blocking for time %f", this, MediaTimeToSeconds(CurrentDriver()->StateComputedTime()))); nsTArray* runningAndSuspendedPair[2]; runningAndSuspendedPair[0] = &mStreams; @@ -847,7 +847,7 @@ MediaStreamGraphImpl::RecomputeBlocking(GraphTime aEndBlockingDecisions) } } } - STREAM_LOG(LogLevel::Verbose, ("Media graph %p computed blocking for interval %f to %f", + STREAM_LOG(PR_LOG_DEBUG+1, ("Media graph %p computed blocking for interval %f to %f", this, MediaTimeToSeconds(CurrentDriver()->StateComputedTime()), MediaTimeToSeconds(aEndBlockingDecisions))); @@ -925,13 +925,13 @@ MediaStreamGraphImpl::RecomputeBlockingAt(const nsTArray& aStreams GraphTime endTime = StreamTimeToGraphTime(stream, stream->GetStreamBuffer().GetAllTracksEnd()); if (endTime <= aTime) { - STREAM_LOG(LogLevel::Verbose, ("MediaStream %p is blocked due to being finished", stream)); + STREAM_LOG(PR_LOG_DEBUG+1, ("MediaStream %p is blocked due to being finished", stream)); // We'll block indefinitely MarkStreamBlocking(stream); *aEnd = std::min(*aEnd, aEndBlockingDecisions); continue; } else { - STREAM_LOG(LogLevel::Verbose, ("MediaStream %p is finished, but not blocked yet (end at %f, with blocking at %f)", + STREAM_LOG(PR_LOG_DEBUG+1, ("MediaStream %p is finished, but not blocked yet (end at %f, with blocking at %f)", stream, MediaTimeToSeconds(stream->GetBufferEnd()), MediaTimeToSeconds(endTime))); *aEnd = std::min(*aEnd, endTime); @@ -942,7 +942,7 @@ MediaStreamGraphImpl::RecomputeBlockingAt(const nsTArray& aStreams bool explicitBlock = stream->mExplicitBlockerCount.GetAt(aTime, &end) > 0; *aEnd = std::min(*aEnd, end); if (explicitBlock) { - STREAM_LOG(LogLevel::Verbose, ("MediaStream %p is blocked due to explicit blocker", stream)); + STREAM_LOG(PR_LOG_DEBUG+1, ("MediaStream %p is blocked due to explicit blocker", stream)); MarkStreamBlocking(stream); continue; } @@ -1091,7 +1091,7 @@ MediaStreamGraphImpl::PlayAudio(MediaStream* aStream, if (blocked) { output.InsertNullDataAtStart(toWrite); ticksWritten += toWrite; - STREAM_LOG(LogLevel::Verbose, ("MediaStream %p writing %ld blocking-silence samples for %f to %f (%ld to %ld)\n", + STREAM_LOG(PR_LOG_DEBUG+1, ("MediaStream %p writing %ld blocking-silence samples for %f to %f (%ld to %ld)\n", aStream, toWrite, MediaTimeToSeconds(t), MediaTimeToSeconds(end), offset, offset + toWrite)); } else { @@ -1099,7 +1099,7 @@ MediaStreamGraphImpl::PlayAudio(MediaStream* aStream, StreamTime endTicksAvailable = audio->GetDuration(); if (endTicksNeeded <= endTicksAvailable) { - STREAM_LOG(LogLevel::Verbose, + STREAM_LOG(PR_LOG_DEBUG + 1, ("MediaStream %p writing %ld samples for %f to %f " "(samples %ld to %ld)\n", aStream, toWrite, MediaTimeToSeconds(t), @@ -1114,7 +1114,7 @@ MediaStreamGraphImpl::PlayAudio(MediaStream* aStream, if (endTicksNeeded > endTicksAvailable && offset < endTicksAvailable) { output.AppendSlice(*audio, offset, endTicksAvailable); - STREAM_LOG(LogLevel::Verbose, + STREAM_LOG(PR_LOG_DEBUG + 1, ("MediaStream %p writing %ld samples for %f to %f " "(samples %ld to %ld)\n", aStream, toWrite, MediaTimeToSeconds(t), @@ -1125,7 +1125,7 @@ MediaStreamGraphImpl::PlayAudio(MediaStream* aStream, offset = endTicksAvailable; } output.AppendNullData(toWrite); - STREAM_LOG(LogLevel::Verbose, + STREAM_LOG(PR_LOG_DEBUG + 1, ("MediaStream %p writing %ld padding slsamples for %f to " "%f (samples %ld to %ld)\n", aStream, toWrite, MediaTimeToSeconds(t), @@ -1214,7 +1214,7 @@ MediaStreamGraphImpl::PlayVideo(MediaStream* aStream) if (!frame || *frame == aStream->mLastPlayedVideoFrame) return; - STREAM_LOG(LogLevel::Verbose, ("MediaStream %p writing video frame %p (%dx%d)", + STREAM_LOG(PR_LOG_DEBUG+1, ("MediaStream %p writing video frame %p (%dx%d)", aStream, frame->GetImage(), frame->GetIntrinsicSize().width, frame->GetIntrinsicSize().height)); GraphTime startTime = StreamTimeToGraphTime(aStream, @@ -1521,7 +1521,7 @@ MediaStreamGraphImpl::OneIteration(GraphTime aFrom, GraphTime aTo, if (finalUpdate) { // Enter shutdown mode. The stable-state handler will detect this // and complete shutdown. Destroy any streams immediately. - STREAM_LOG(LogLevel::Debug, ("MediaStreamGraph %p waiting for main thread cleanup", this)); + STREAM_LOG(PR_LOG_DEBUG, ("MediaStreamGraph %p waiting for main thread cleanup", this)); // We'll shut down this graph object if it does not get restarted. mLifecycleState = LIFECYCLE_WAITING_FOR_MAIN_THREAD_CLEANUP; // No need to Destroy streams here. The main-thread owner of each @@ -1562,7 +1562,7 @@ void MediaStreamGraphImpl::ForceShutDown() { NS_ASSERTION(NS_IsMainThread(), "Must be called on main thread"); - STREAM_LOG(LogLevel::Debug, ("MediaStreamGraph %p ForceShutdown", this)); + STREAM_LOG(PR_LOG_DEBUG, ("MediaStreamGraph %p ForceShutdown", this)); { MonitorAutoLock lock(mMonitor); mForceShutDown = true; @@ -2767,7 +2767,7 @@ SourceMediaStream::NeedsMixing() void MediaInputPort::Init() { - STREAM_LOG(LogLevel::Debug, ("Adding MediaInputPort %p (from %p to %p) to the graph", + STREAM_LOG(PR_LOG_DEBUG, ("Adding MediaInputPort %p (from %p to %p) to the graph", this, mSource, mDest)); mSource->AddConsumer(this); mDest->AddInput(this); @@ -3045,7 +3045,7 @@ MediaStreamGraph::GetInstance(bool aStartWithAudioDriver, graph = new MediaStreamGraphImpl(true, CubebUtils::PreferredSampleRate(), aStartWithAudioDriver, aChannel); gGraphs.Put(channel, graph); - STREAM_LOG(LogLevel::Debug, ("Starting up MediaStreamGraph %p", graph)); + STREAM_LOG(PR_LOG_DEBUG, ("Starting up MediaStreamGraph %p", graph)); } return graph; @@ -3058,7 +3058,7 @@ MediaStreamGraph::CreateNonRealtimeInstance(TrackRate aSampleRate) MediaStreamGraphImpl* graph = new MediaStreamGraphImpl(false, aSampleRate); - STREAM_LOG(LogLevel::Debug, ("Starting up Offline MediaStreamGraph %p", graph)); + STREAM_LOG(PR_LOG_DEBUG, ("Starting up Offline MediaStreamGraph %p", graph)); return graph; } @@ -3363,7 +3363,7 @@ MediaStreamGraphImpl::MoveStreams(AudioContextOperation aAudioContextOperation, stream->remove(); } - STREAM_LOG(LogLevel::Debug, ("Moving streams between suspended and running" + STREAM_LOG(PR_LOG_DEBUG, ("Moving streams between suspended and running" "state: mStreams: %d, mSuspendedStreams: %d\n", mStreams.Length(), mSuspendedStreams.Length())); #ifdef DEBUG diff --git a/dom/media/MediaTimer.h b/dom/media/MediaTimer.h index 302320f1d04b..d21048c3d2f3 100644 --- a/dom/media/MediaTimer.h +++ b/dom/media/MediaTimer.h @@ -23,7 +23,7 @@ extern PRLogModuleInfo* gMediaTimerLog; #define TIMER_LOG(x, ...) \ MOZ_ASSERT(gMediaTimerLog); \ - MOZ_LOG(gMediaTimerLog, LogLevel::Debug, ("[MediaTimer=%p relative_t=%lld]" x, this, \ + MOZ_LOG(gMediaTimerLog, PR_LOG_DEBUG, ("[MediaTimer=%p relative_t=%lld]" x, this, \ RelativeMicroseconds(TimeStamp::Now()), ##__VA_ARGS__)) // This promise type is only exclusive because so far there isn't a reason for diff --git a/dom/media/RtspMediaResource.cpp b/dom/media/RtspMediaResource.cpp index 5386543c1c5a..6604d9ab54ac 100644 --- a/dom/media/RtspMediaResource.cpp +++ b/dom/media/RtspMediaResource.cpp @@ -21,7 +21,7 @@ using namespace mozilla::net; PRLogModuleInfo* gRtspMediaResourceLog; -#define RTSP_LOG(msg, ...) MOZ_LOG(gRtspMediaResourceLog, mozilla::LogLevel::Debug, \ +#define RTSP_LOG(msg, ...) MOZ_LOG(gRtspMediaResourceLog, PR_LOG_DEBUG, \ (msg, ##__VA_ARGS__)) // Debug logging macro with object pointer and class name. #define RTSPMLOG(msg, ...) \ diff --git a/dom/media/StateMirroring.h b/dom/media/StateMirroring.h index bf8a8734a8fb..eb012ba98667 100644 --- a/dom/media/StateMirroring.h +++ b/dom/media/StateMirroring.h @@ -50,7 +50,7 @@ namespace mozilla { // the same log module. #define MIRROR_LOG(x, ...) \ MOZ_ASSERT(gStateWatchingLog); \ - MOZ_LOG(gStateWatchingLog, LogLevel::Debug, (x, ##__VA_ARGS__)) + MOZ_LOG(gStateWatchingLog, PR_LOG_DEBUG, (x, ##__VA_ARGS__)) template class AbstractMirror; diff --git a/dom/media/StateWatching.h b/dom/media/StateWatching.h index 7872a9768ce8..273f6624c542 100644 --- a/dom/media/StateWatching.h +++ b/dom/media/StateWatching.h @@ -60,7 +60,7 @@ extern PRLogModuleInfo* gStateWatchingLog; #define WATCH_LOG(x, ...) \ MOZ_ASSERT(gStateWatchingLog); \ - MOZ_LOG(gStateWatchingLog, LogLevel::Debug, (x, ##__VA_ARGS__)) + MOZ_LOG(gStateWatchingLog, PR_LOG_DEBUG, (x, ##__VA_ARGS__)) /* * AbstractWatcher is a superclass from which all watchers must inherit. diff --git a/dom/media/StreamBuffer.cpp b/dom/media/StreamBuffer.cpp index ec78594e027d..ede5fce9c343 100644 --- a/dom/media/StreamBuffer.cpp +++ b/dom/media/StreamBuffer.cpp @@ -16,13 +16,13 @@ extern PRLogModuleInfo* gMediaStreamGraphLog; void StreamBuffer::DumpTrackInfo() const { - STREAM_LOG(LogLevel::Info, ("DumpTracks: mTracksKnownTime %lld", mTracksKnownTime)); + STREAM_LOG(PR_LOG_ALWAYS, ("DumpTracks: mTracksKnownTime %lld", mTracksKnownTime)); for (uint32_t i = 0; i < mTracks.Length(); ++i) { Track* track = mTracks[i]; if (track->IsEnded()) { - STREAM_LOG(LogLevel::Info, ("Track[%d] %d: ended", i, track->GetID())); + STREAM_LOG(PR_LOG_ALWAYS, ("Track[%d] %d: ended", i, track->GetID())); } else { - STREAM_LOG(LogLevel::Info, ("Track[%d] %d: %lld", i, track->GetID(), + STREAM_LOG(PR_LOG_ALWAYS, ("Track[%d] %d: %lld", i, track->GetID(), track->GetEnd())); } } diff --git a/dom/media/TrackUnionStream.cpp b/dom/media/TrackUnionStream.cpp index 5771d883ccff..0b9340fd637e 100644 --- a/dom/media/TrackUnionStream.cpp +++ b/dom/media/TrackUnionStream.cpp @@ -196,7 +196,7 @@ TrackUnionStream::TrackUnionStream(DOMMediaStream* aWrapper) : segment->AppendNullData(outputStart); StreamBuffer::Track* track = &mBuffer.AddTrack(id, outputStart, segment.forget()); - STREAM_LOG(LogLevel::Debug, ("TrackUnionStream %p adding track %d for input stream %p track %d, start ticks %lld", + STREAM_LOG(PR_LOG_DEBUG, ("TrackUnionStream %p adding track %d for input stream %p track %d, start ticks %lld", this, id, aPort->GetSource(), aTrack->GetID(), (long long)outputStart)); @@ -264,7 +264,7 @@ TrackUnionStream::TrackUnionStream(DOMMediaStream* aWrapper) : if (interval.mInputIsBlocked) { // Maybe the input track ended? segment->AppendNullData(ticks); - STREAM_LOG(LogLevel::Verbose, ("TrackUnionStream %p appending %lld ticks of null data to track %d", + STREAM_LOG(PR_LOG_DEBUG+1, ("TrackUnionStream %p appending %lld ticks of null data to track %d", this, (long long)ticks, outputTrack->GetID())); } else if (InMutedCycle()) { segment->AppendNullData(ticks); diff --git a/dom/media/WebVTTListener.cpp b/dom/media/WebVTTListener.cpp index 5727e8c71879..b9e47cc0c6a3 100644 --- a/dom/media/WebVTTListener.cpp +++ b/dom/media/WebVTTListener.cpp @@ -29,7 +29,7 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(WebVTTListener) NS_IMPL_CYCLE_COLLECTING_RELEASE(WebVTTListener) PRLogModuleInfo* gTextTrackLog; -# define VTT_LOG(...) MOZ_LOG(gTextTrackLog, LogLevel::Debug, (__VA_ARGS__)) +# define VTT_LOG(...) MOZ_LOG(gTextTrackLog, PR_LOG_DEBUG, (__VA_ARGS__)) WebVTTListener::WebVTTListener(HTMLTrackElement* aElement) : mElement(aElement) diff --git a/dom/media/apple/AppleMP3Reader.cpp b/dom/media/apple/AppleMP3Reader.cpp index 8330f4ffcd52..bb90e1f36f61 100644 --- a/dom/media/apple/AppleMP3Reader.cpp +++ b/dom/media/apple/AppleMP3Reader.cpp @@ -22,9 +22,9 @@ namespace mozilla { extern PRLogModuleInfo* gMediaDecoderLog; -#define LOGE(...) MOZ_LOG(gMediaDecoderLog, mozilla::LogLevel::Error, (__VA_ARGS__)) -#define LOGW(...) MOZ_LOG(gMediaDecoderLog, mozilla::LogLevel::Warning, (__VA_ARGS__)) -#define LOGD(...) MOZ_LOG(gMediaDecoderLog, mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define LOGE(...) MOZ_LOG(gMediaDecoderLog, PR_LOG_ERROR, (__VA_ARGS__)) +#define LOGW(...) MOZ_LOG(gMediaDecoderLog, PR_LOG_WARNING, (__VA_ARGS__)) +#define LOGD(...) MOZ_LOG(gMediaDecoderLog, PR_LOG_DEBUG, (__VA_ARGS__)) #define PROPERTY_ID_FORMAT "%c%c%c%c" #define PROPERTY_ID_PRINT(x) ((x) >> 24), \ diff --git a/dom/media/directshow/AudioSinkFilter.cpp b/dom/media/directshow/AudioSinkFilter.cpp index 3d2b93b46bc8..5384f0346564 100644 --- a/dom/media/directshow/AudioSinkFilter.cpp +++ b/dom/media/directshow/AudioSinkFilter.cpp @@ -24,7 +24,7 @@ using namespace mozilla::media; namespace mozilla { PRLogModuleInfo* GetDirectShowLog(); -#define LOG(...) MOZ_LOG(GetDirectShowLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define LOG(...) MOZ_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__)) AudioSinkFilter::AudioSinkFilter(const wchar_t* aObjectName, HRESULT* aOutResult) : BaseFilter(aObjectName, CLSID_MozAudioSinkFilter), diff --git a/dom/media/directshow/AudioSinkInputPin.cpp b/dom/media/directshow/AudioSinkInputPin.cpp index a313ed35e4f2..cf5918b66a23 100644 --- a/dom/media/directshow/AudioSinkInputPin.cpp +++ b/dom/media/directshow/AudioSinkInputPin.cpp @@ -16,7 +16,7 @@ using namespace mozilla::media; namespace mozilla { PRLogModuleInfo* GetDirectShowLog(); -#define LOG(...) MOZ_LOG(GetDirectShowLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define LOG(...) MOZ_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__)) AudioSinkInputPin::AudioSinkInputPin(wchar_t* aObjectName, AudioSinkFilter* aFilter, diff --git a/dom/media/directshow/DirectShowReader.cpp b/dom/media/directshow/DirectShowReader.cpp index 48b7c1f082dd..425db8a94be5 100644 --- a/dom/media/directshow/DirectShowReader.cpp +++ b/dom/media/directshow/DirectShowReader.cpp @@ -26,7 +26,7 @@ GetDirectShowLog() { return log; } -#define LOG(...) MOZ_LOG(GetDirectShowLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define LOG(...) MOZ_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__)) DirectShowReader::DirectShowReader(AbstractMediaDecoder* aDecoder) : MediaDecoderReader(aDecoder), diff --git a/dom/media/directshow/SampleSink.cpp b/dom/media/directshow/SampleSink.cpp index 54b62508d265..69ac10d06fe6 100644 --- a/dom/media/directshow/SampleSink.cpp +++ b/dom/media/directshow/SampleSink.cpp @@ -15,7 +15,7 @@ using namespace mozilla::media; namespace mozilla { PRLogModuleInfo* GetDirectShowLog(); -#define LOG(...) MOZ_LOG(GetDirectShowLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define LOG(...) MOZ_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__)) SampleSink::SampleSink() : mMonitor("SampleSink"), @@ -65,7 +65,7 @@ SampleSink::Receive(IMediaSample* aSample) mon.Wait(); } - if (MOZ_LOG_TEST(GetDirectShowLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetDirectShowLog(), PR_LOG_DEBUG)) { REFERENCE_TIME start = 0, end = 0; HRESULT hr = aSample->GetMediaTime(&start, &end); LOG("SampleSink::Receive() [%4.2lf-%4.2lf]", @@ -102,7 +102,7 @@ SampleSink::Extract(RefPtr& aOutSample) } aOutSample = mSample; - if (MOZ_LOG_TEST(GetDirectShowLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetDirectShowLog(), PR_LOG_DEBUG)) { int64_t start = 0, end = 0; mSample->GetMediaTime(&start, &end); LOG("SampleSink::Extract() [%4.2lf-%4.2lf]", diff --git a/dom/media/directshow/SourceFilter.cpp b/dom/media/directshow/SourceFilter.cpp index f4dd75c8f805..207d6996ae06 100644 --- a/dom/media/directshow/SourceFilter.cpp +++ b/dom/media/directshow/SourceFilter.cpp @@ -21,7 +21,7 @@ namespace mozilla { #if defined (DEBUG_SOURCE_TRACE) PRLogModuleInfo* GetDirectShowLog(); -#define DIRECTSHOW_LOG(...) MOZ_LOG(GetDirectShowLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define DIRECTSHOW_LOG(...) MOZ_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__)) #else #define DIRECTSHOW_LOG(...) #endif diff --git a/dom/media/eme/EMEUtils.h b/dom/media/eme/EMEUtils.h index 44165b51215e..c02f54686dd3 100644 --- a/dom/media/eme/EMEUtils.h +++ b/dom/media/eme/EMEUtils.h @@ -14,13 +14,13 @@ namespace mozilla { #ifndef EME_LOG PRLogModuleInfo* GetEMELog(); - #define EME_LOG(...) MOZ_LOG(GetEMELog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) - #define EME_LOG_ENABLED() MOZ_LOG_TEST(GetEMELog(), mozilla::LogLevel::Debug) + #define EME_LOG(...) MOZ_LOG(GetEMELog(), PR_LOG_DEBUG, (__VA_ARGS__)) + #define EME_LOG_ENABLED() PR_LOG_TEST(GetEMELog(), PR_LOG_DEBUG) #endif #ifndef EME_VERBOSE_LOG PRLogModuleInfo* GetEMEVerboseLog(); - #define EME_VERBOSE_LOG(...) MOZ_LOG(GetEMEVerboseLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) + #define EME_VERBOSE_LOG(...) MOZ_LOG(GetEMEVerboseLog(), PR_LOG_DEBUG, (__VA_ARGS__)) #else #ifndef EME_LOG #define EME_LOG(...) diff --git a/dom/media/encoder/MediaEncoder.cpp b/dom/media/encoder/MediaEncoder.cpp index f9bf75a0e4f5..67bb4b89f6d7 100644 --- a/dom/media/encoder/MediaEncoder.cpp +++ b/dom/media/encoder/MediaEncoder.cpp @@ -62,7 +62,7 @@ MediaEncoder::NotifyEvent(MediaStreamGraph* aGraph, MediaStreamListener::MediaStreamGraphEvent event) { // In case that MediaEncoder does not receive a TRACK_EVENT_ENDED event. - LOG(LogLevel::Debug, ("NotifyRemoved in [MediaEncoder].")); + LOG(PR_LOG_DEBUG, ("NotifyRemoved in [MediaEncoder].")); if (mAudioEncoder) { mAudioEncoder->NotifyEvent(aGraph, event); } @@ -87,7 +87,7 @@ MediaEncoder::CreateEncoder(const nsAString& aMIMEType, uint8_t aTrackTypes) nsRefPtr encoder; nsString mimeType; if (!aTrackTypes) { - LOG(LogLevel::Error, ("NO TrackTypes!!!")); + LOG(PR_LOG_ERROR, ("NO TrackTypes!!!")); return nullptr; } #ifdef MOZ_WEBM_ENCODER @@ -138,10 +138,10 @@ MediaEncoder::CreateEncoder(const nsAString& aMIMEType, uint8_t aTrackTypes) mimeType = NS_LITERAL_STRING(AUDIO_OGG); } else { - LOG(LogLevel::Error, ("Can not find any encoder to record this media stream")); + LOG(PR_LOG_ERROR, ("Can not find any encoder to record this media stream")); return nullptr; } - LOG(LogLevel::Debug, ("Create encoder result:a[%d] v[%d] w[%d] mimeType = %s.", + LOG(PR_LOG_DEBUG, ("Create encoder result:a[%d] v[%d] w[%d] mimeType = %s.", audioEncoder != nullptr, videoEncoder != nullptr, writer != nullptr, mimeType.get())); encoder = new MediaEncoder(writer.forget(), audioEncoder.forget(), @@ -187,15 +187,15 @@ MediaEncoder::GetEncodedData(nsTArray >* aOutputBufs, while (reloop) { switch (mState) { case ENCODE_METADDATA: { - LOG(LogLevel::Debug, ("ENCODE_METADDATA TimeStamp = %f", GetEncodeTimeStamp())); + LOG(PR_LOG_DEBUG, ("ENCODE_METADDATA TimeStamp = %f", GetEncodeTimeStamp())); nsresult rv = CopyMetadataToMuxer(mAudioEncoder.get()); if (NS_FAILED(rv)) { - LOG(LogLevel::Error, ("Error! Fail to Set Audio Metadata")); + LOG(PR_LOG_ERROR, ("Error! Fail to Set Audio Metadata")); break; } rv = CopyMetadataToMuxer(mVideoEncoder.get()); if (NS_FAILED(rv)) { - LOG(LogLevel::Error, ("Error! Fail to Set Video Metadata")); + LOG(PR_LOG_ERROR, ("Error! Fail to Set Video Metadata")); break; } @@ -205,31 +205,31 @@ MediaEncoder::GetEncodedData(nsTArray >* aOutputBufs, mSizeOfBuffer = aOutputBufs->SizeOfExcludingThis(MallocSizeOf); } if (NS_FAILED(rv)) { - LOG(LogLevel::Error,("Error! writer fail to generate header!")); + LOG(PR_LOG_ERROR,("Error! writer fail to generate header!")); mState = ENCODE_ERROR; break; } - LOG(LogLevel::Debug, ("Finish ENCODE_METADDATA TimeStamp = %f", GetEncodeTimeStamp())); + LOG(PR_LOG_DEBUG, ("Finish ENCODE_METADDATA TimeStamp = %f", GetEncodeTimeStamp())); mState = ENCODE_TRACK; break; } case ENCODE_TRACK: { - LOG(LogLevel::Debug, ("ENCODE_TRACK TimeStamp = %f", GetEncodeTimeStamp())); + LOG(PR_LOG_DEBUG, ("ENCODE_TRACK TimeStamp = %f", GetEncodeTimeStamp())); EncodedFrameContainer encodedData; nsresult rv = NS_OK; rv = WriteEncodedDataToMuxer(mAudioEncoder.get()); if (NS_FAILED(rv)) { - LOG(LogLevel::Error, ("Error! Fail to write audio encoder data to muxer")); + LOG(PR_LOG_ERROR, ("Error! Fail to write audio encoder data to muxer")); break; } - LOG(LogLevel::Debug, ("Audio encoded TimeStamp = %f", GetEncodeTimeStamp())); + LOG(PR_LOG_DEBUG, ("Audio encoded TimeStamp = %f", GetEncodeTimeStamp())); rv = WriteEncodedDataToMuxer(mVideoEncoder.get()); if (NS_FAILED(rv)) { - LOG(LogLevel::Error, ("Fail to write video encoder data to muxer")); + LOG(PR_LOG_ERROR, ("Fail to write video encoder data to muxer")); break; } - LOG(LogLevel::Debug, ("Video encoded TimeStamp = %f", GetEncodeTimeStamp())); + LOG(PR_LOG_DEBUG, ("Video encoded TimeStamp = %f", GetEncodeTimeStamp())); // In audio only or video only case, let unavailable track's flag to be true. bool isAudioCompleted = (mAudioEncoder && mAudioEncoder->IsEncodingComplete()) || !mAudioEncoder; bool isVideoCompleted = (mVideoEncoder && mVideoEncoder->IsEncodingComplete()) || !mVideoEncoder; @@ -244,7 +244,7 @@ MediaEncoder::GetEncodedData(nsTArray >* aOutputBufs, reloop = false; } mState = (mWriter->IsWritingComplete()) ? ENCODE_DONE : ENCODE_TRACK; - LOG(LogLevel::Debug, ("END ENCODE_TRACK TimeStamp = %f " + LOG(PR_LOG_DEBUG, ("END ENCODE_TRACK TimeStamp = %f " "mState = %d aComplete %d vComplete %d", GetEncodeTimeStamp(), mState, isAudioCompleted, isVideoCompleted)); break; @@ -252,7 +252,7 @@ MediaEncoder::GetEncodedData(nsTArray >* aOutputBufs, case ENCODE_DONE: case ENCODE_ERROR: - LOG(LogLevel::Debug, ("MediaEncoder has been shutdown.")); + LOG(PR_LOG_DEBUG, ("MediaEncoder has been shutdown.")); mSizeOfBuffer = 0; mShutdown = true; reloop = false; @@ -280,7 +280,7 @@ MediaEncoder::WriteEncodedDataToMuxer(TrackEncoder *aTrackEncoder) nsresult rv = aTrackEncoder->GetEncodedTrack(encodedVideoData); if (NS_FAILED(rv)) { // Encoding might be canceled. - LOG(LogLevel::Error, ("Error! Fail to get encoded data from video encoder.")); + LOG(PR_LOG_ERROR, ("Error! Fail to get encoded data from video encoder.")); mState = ENCODE_ERROR; return rv; } @@ -288,7 +288,7 @@ MediaEncoder::WriteEncodedDataToMuxer(TrackEncoder *aTrackEncoder) aTrackEncoder->IsEncodingComplete() ? ContainerWriter::END_OF_STREAM : 0); if (NS_FAILED(rv)) { - LOG(LogLevel::Error, ("Error! Fail to write encoded video track to the media container.")); + LOG(PR_LOG_ERROR, ("Error! Fail to write encoded video track to the media container.")); mState = ENCODE_ERROR; } return rv; @@ -306,14 +306,14 @@ MediaEncoder::CopyMetadataToMuxer(TrackEncoder *aTrackEncoder) nsRefPtr meta = aTrackEncoder->GetMetadata(); if (meta == nullptr) { - LOG(LogLevel::Error, ("Error! metadata = null")); + LOG(PR_LOG_ERROR, ("Error! metadata = null")); mState = ENCODE_ERROR; return NS_ERROR_ABORT; } nsresult rv = mWriter->SetMetadata(meta); if (NS_FAILED(rv)) { - LOG(LogLevel::Error, ("Error! SetMetadata fail")); + LOG(PR_LOG_ERROR, ("Error! SetMetadata fail")); mState = ENCODE_ERROR; } return rv; diff --git a/dom/media/encoder/TrackEncoder.cpp b/dom/media/encoder/TrackEncoder.cpp index f77c10993ec8..ee65b0653a45 100644 --- a/dom/media/encoder/TrackEncoder.cpp +++ b/dom/media/encoder/TrackEncoder.cpp @@ -58,7 +58,7 @@ AudioTrackEncoder::NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, // Check and initialize parameters for codec encoder. if (!mInitialized) { mAudioInitCounter++; - TRACK_LOG(LogLevel::Debug, ("Init the audio encoder %d times", mAudioInitCounter)); + TRACK_LOG(PR_LOG_DEBUG, ("Init the audio encoder %d times", mAudioInitCounter)); AudioSegment::ChunkIterator iter(const_cast(audio)); while (!iter.IsEnded()) { AudioChunk chunk = *iter; @@ -184,7 +184,7 @@ VideoTrackEncoder::NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, // Check and initialize parameters for codec encoder. if (!mInitialized) { mVideoInitCounter++; - TRACK_LOG(LogLevel::Debug, ("Init the video encoder %d times", mVideoInitCounter)); + TRACK_LOG(PR_LOG_DEBUG, ("Init the video encoder %d times", mVideoInitCounter)); VideoSegment::ChunkIterator iter(const_cast(video)); while (!iter.IsEnded()) { VideoChunk chunk = *iter; diff --git a/dom/media/encoder/VP8TrackEncoder.cpp b/dom/media/encoder/VP8TrackEncoder.cpp index 28d109ed270c..626cafb6cd13 100644 --- a/dom/media/encoder/VP8TrackEncoder.cpp +++ b/dom/media/encoder/VP8TrackEncoder.cpp @@ -16,7 +16,7 @@ namespace mozilla { PRLogModuleInfo* gVP8TrackEncoderLog; -#define VP8LOG(msg, ...) MOZ_LOG(gVP8TrackEncoderLog, mozilla::LogLevel::Debug, \ +#define VP8LOG(msg, ...) MOZ_LOG(gVP8TrackEncoderLog, PR_LOG_DEBUG, \ (msg, ##__VA_ARGS__)) // Debug logging macro with object pointer and class name. diff --git a/dom/media/encoder/VorbisTrackEncoder.cpp b/dom/media/encoder/VorbisTrackEncoder.cpp index e40253bf985d..5599f9d4a52e 100644 --- a/dom/media/encoder/VorbisTrackEncoder.cpp +++ b/dom/media/encoder/VorbisTrackEncoder.cpp @@ -18,7 +18,7 @@ namespace mozilla { #undef LOG PRLogModuleInfo* gVorbisTrackEncoderLog; -#define VORBISLOG(msg, ...) MOZ_LOG(gVorbisTrackEncoderLog, mozilla::LogLevel::Debug, \ +#define VORBISLOG(msg, ...) MOZ_LOG(gVorbisTrackEncoderLog, PR_LOG_DEBUG, \ (msg, ##__VA_ARGS__)) VorbisTrackEncoder::VorbisTrackEncoder() diff --git a/dom/media/fmp4/MP4Reader.cpp b/dom/media/fmp4/MP4Reader.cpp index 919a0fa8c886..af275b099045 100644 --- a/dom/media/fmp4/MP4Reader.cpp +++ b/dom/media/fmp4/MP4Reader.cpp @@ -40,8 +40,8 @@ PRLogModuleInfo* GetDemuxerLog() { } return log; } -#define LOG(arg, ...) MOZ_LOG(GetDemuxerLog(), mozilla::LogLevel::Debug, ("MP4Reader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) -#define VLOG(arg, ...) MOZ_LOG(GetDemuxerLog(), mozilla::LogLevel::Debug, ("MP4Reader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) +#define LOG(arg, ...) MOZ_LOG(GetDemuxerLog(), PR_LOG_DEBUG, ("MP4Reader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) +#define VLOG(arg, ...) MOZ_LOG(GetDemuxerLog(), PR_LOG_DEBUG, ("MP4Reader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) using namespace mp4_demuxer; diff --git a/dom/media/gmp/GMPAudioDecoderParent.cpp b/dom/media/gmp/GMPAudioDecoderParent.cpp index 2b801b454339..719bf52c0380 100644 --- a/dom/media/gmp/GMPAudioDecoderParent.cpp +++ b/dom/media/gmp/GMPAudioDecoderParent.cpp @@ -19,7 +19,7 @@ namespace mozilla { extern PRLogModuleInfo* GetGMPLog(); -#define LOGD(msg) MOZ_LOG(GetGMPLog(), mozilla::LogLevel::Debug, msg) +#define LOGD(msg) MOZ_LOG(GetGMPLog(), PR_LOG_DEBUG, msg) #define LOG(level, msg) MOZ_LOG(GetGMPLog(), (level), msg) namespace gmp { diff --git a/dom/media/gmp/GMPChild.cpp b/dom/media/gmp/GMPChild.cpp index 6c86f63166d5..621f95e46f47 100644 --- a/dom/media/gmp/GMPChild.cpp +++ b/dom/media/gmp/GMPChild.cpp @@ -47,7 +47,7 @@ namespace mozilla { extern PRLogModuleInfo* GetGMPLog(); #define LOG(level, x, ...) MOZ_LOG(GetGMPLog(), (level), (x, ##__VA_ARGS__)) -#define LOGD(x, ...) LOG(mozilla::LogLevel::Debug, "GMPChild[pid=%d] " x, (int)base::GetCurrentProcId(), ##__VA_ARGS__) +#define LOGD(x, ...) LOG(PR_LOG_DEBUG, "GMPChild[pid=%d] " x, (int)base::GetCurrentProcId(), ##__VA_ARGS__) namespace gmp { diff --git a/dom/media/gmp/GMPContentParent.cpp b/dom/media/gmp/GMPContentParent.cpp index 2e692a0e573f..30153b9e7c0d 100644 --- a/dom/media/gmp/GMPContentParent.cpp +++ b/dom/media/gmp/GMPContentParent.cpp @@ -22,7 +22,7 @@ namespace mozilla { extern PRLogModuleInfo* GetGMPLog(); -#define LOGD(msg) MOZ_LOG(GetGMPLog(), mozilla::LogLevel::Debug, msg) +#define LOGD(msg) MOZ_LOG(GetGMPLog(), PR_LOG_DEBUG, msg) #define LOG(level, msg) MOZ_LOG(GetGMPLog(), (level), msg) #ifdef __CLASS__ diff --git a/dom/media/gmp/GMPParent.cpp b/dom/media/gmp/GMPParent.cpp index 41cdd155ca8e..f674b5c222d8 100644 --- a/dom/media/gmp/GMPParent.cpp +++ b/dom/media/gmp/GMPParent.cpp @@ -44,7 +44,7 @@ namespace mozilla { extern PRLogModuleInfo* GetGMPLog(); #define LOG(level, x, ...) MOZ_LOG(GetGMPLog(), (level), (x, ##__VA_ARGS__)) -#define LOGD(x, ...) LOG(mozilla::LogLevel::Debug, "GMPParent[%p|childPid=%d] " x, this, mChildPid, ##__VA_ARGS__) +#define LOGD(x, ...) LOG(PR_LOG_DEBUG, "GMPParent[%p|childPid=%d] " x, this, mChildPid, ##__VA_ARGS__) #ifdef __CLASS__ #undef __CLASS__ diff --git a/dom/media/gmp/GMPService.cpp b/dom/media/gmp/GMPService.cpp index 6ccced653e45..af56424a94c6 100644 --- a/dom/media/gmp/GMPService.cpp +++ b/dom/media/gmp/GMPService.cpp @@ -52,7 +52,7 @@ GetGMPLog() return sLog; } -#define LOGD(msg) MOZ_LOG(GetGMPLog(), mozilla::LogLevel::Debug, msg) +#define LOGD(msg) MOZ_LOG(GetGMPLog(), PR_LOG_DEBUG, msg) #define LOG(level, msg) MOZ_LOG(GetGMPLog(), (level), msg) #ifdef __CLASS__ diff --git a/dom/media/gmp/GMPServiceChild.cpp b/dom/media/gmp/GMPServiceChild.cpp index bd98bb93acd4..66febd185d2d 100644 --- a/dom/media/gmp/GMPServiceChild.cpp +++ b/dom/media/gmp/GMPServiceChild.cpp @@ -20,7 +20,7 @@ namespace mozilla { #undef LOG #endif -#define LOGD(msg) MOZ_LOG(GetGMPLog(), mozilla::LogLevel::Debug, msg) +#define LOGD(msg) MOZ_LOG(GetGMPLog(), PR_LOG_DEBUG, msg) #define LOG(level, msg) MOZ_LOG(GetGMPLog(), (level), msg) #ifdef __CLASS__ diff --git a/dom/media/gmp/GMPServiceParent.cpp b/dom/media/gmp/GMPServiceParent.cpp index 45bbc271c72e..7ce7c83fcfaa 100644 --- a/dom/media/gmp/GMPServiceParent.cpp +++ b/dom/media/gmp/GMPServiceParent.cpp @@ -41,7 +41,7 @@ namespace mozilla { #undef LOG #endif -#define LOGD(msg) MOZ_LOG(GetGMPLog(), mozilla::LogLevel::Debug, msg) +#define LOGD(msg) MOZ_LOG(GetGMPLog(), PR_LOG_DEBUG, msg) #define LOG(level, msg) MOZ_LOG(GetGMPLog(), (level), msg) #ifdef __CLASS__ diff --git a/dom/media/gmp/GMPStorageParent.cpp b/dom/media/gmp/GMPStorageParent.cpp index a72ca2df476a..596337761ebe 100644 --- a/dom/media/gmp/GMPStorageParent.cpp +++ b/dom/media/gmp/GMPStorageParent.cpp @@ -28,7 +28,7 @@ namespace mozilla { extern PRLogModuleInfo* GetGMPLog(); -#define LOGD(msg) MOZ_LOG(GetGMPLog(), mozilla::LogLevel::Debug, msg) +#define LOGD(msg) MOZ_LOG(GetGMPLog(), PR_LOG_DEBUG, msg) #define LOG(level, msg) MOZ_LOG(GetGMPLog(), (level), msg) #ifdef __CLASS__ diff --git a/dom/media/gmp/GMPTimerParent.cpp b/dom/media/gmp/GMPTimerParent.cpp index 2496564673c3..e42c3f526f78 100644 --- a/dom/media/gmp/GMPTimerParent.cpp +++ b/dom/media/gmp/GMPTimerParent.cpp @@ -15,7 +15,7 @@ namespace mozilla { extern PRLogModuleInfo* GetGMPLog(); -#define LOGD(msg) MOZ_LOG(GetGMPLog(), mozilla::LogLevel::Debug, msg) +#define LOGD(msg) MOZ_LOG(GetGMPLog(), PR_LOG_DEBUG, msg) #define LOG(level, msg) MOZ_LOG(GetGMPLog(), (level), msg) #ifdef __CLASS__ diff --git a/dom/media/gmp/GMPVideoDecoderParent.cpp b/dom/media/gmp/GMPVideoDecoderParent.cpp index ef695ed00d26..857a35786c34 100644 --- a/dom/media/gmp/GMPVideoDecoderParent.cpp +++ b/dom/media/gmp/GMPVideoDecoderParent.cpp @@ -23,7 +23,7 @@ namespace mozilla { extern PRLogModuleInfo* GetGMPLog(); -#define LOGD(msg) MOZ_LOG(GetGMPLog(), mozilla::LogLevel::Debug, msg) +#define LOGD(msg) MOZ_LOG(GetGMPLog(), PR_LOG_DEBUG, msg) #define LOG(level, msg) MOZ_LOG(GetGMPLog(), (level), msg) namespace gmp { @@ -245,7 +245,7 @@ GMPVideoDecoderParent::RecvDecoded(const GMPVideoi420FrameData& aDecodedFrame) } if (!GMPVideoi420FrameImpl::CheckFrameData(aDecodedFrame)) { - LOG(LogLevel::Error, ("%s: Decoded frame corrupt, ignoring", __FUNCTION__)); + LOG(PR_LOG_ERROR, ("%s: Decoded frame corrupt, ignoring", __FUNCTION__)); return false; } auto f = new GMPVideoi420FrameImpl(aDecodedFrame, &mVideoHost); @@ -361,7 +361,7 @@ GMPVideoDecoderParent::AnswerNeedShmem(const uint32_t& aFrameBufferSize, aFrameBufferSize, ipc::SharedMemory::TYPE_BASIC, &mem)) { - LOG(LogLevel::Error, ("%s: Failed to get a shared mem buffer for Child! size %u", + LOG(PR_LOG_ERROR, ("%s: Failed to get a shared mem buffer for Child! size %u", __FUNCTION__, aFrameBufferSize)); return false; } diff --git a/dom/media/gmp/GMPVideoEncoderParent.cpp b/dom/media/gmp/GMPVideoEncoderParent.cpp index 0a0a75bdfc96..1a34ae371e62 100644 --- a/dom/media/gmp/GMPVideoEncoderParent.cpp +++ b/dom/media/gmp/GMPVideoEncoderParent.cpp @@ -25,7 +25,7 @@ namespace mozilla { extern PRLogModuleInfo* GetGMPLog(); -#define LOGD(msg) MOZ_LOG(GetGMPLog(), mozilla::LogLevel::Debug, msg) +#define LOGD(msg) MOZ_LOG(GetGMPLog(), PR_LOG_DEBUG, msg) #define LOG(level, msg) MOZ_LOG(GetGMPLog(), (level), msg) #ifdef __CLASS__ @@ -352,7 +352,7 @@ GMPVideoEncoderParent::AnswerNeedShmem(const uint32_t& aEncodedBufferSize, aEncodedBufferSize, ipc::SharedMemory::TYPE_BASIC, &mem)) { - LOG(LogLevel::Error, ("%s::%s: Failed to get a shared mem buffer for Child! size %u", + LOG(PR_LOG_ERROR, ("%s::%s: Failed to get a shared mem buffer for Child! size %u", __CLASS__, __FUNCTION__, aEncodedBufferSize)); return false; } diff --git a/dom/media/gstreamer/GStreamerReader.cpp b/dom/media/gstreamer/GStreamerReader.cpp index 9a3782653222..350bb6effff5 100644 --- a/dom/media/gstreamer/GStreamerReader.cpp +++ b/dom/media/gstreamer/GStreamerReader.cpp @@ -131,7 +131,7 @@ nsresult GStreamerReader::Init(MediaDecoderReader* aCloneDonor) mPlayBin = gst_element_factory_make("playbin2", nullptr); #endif if (!mPlayBin) { - LOG(LogLevel::Error, "couldn't create playbin"); + LOG(PR_LOG_ERROR, "couldn't create playbin"); return NS_ERROR_FAILURE; } g_object_set(mPlayBin, "buffer-size", 0, nullptr); @@ -298,12 +298,12 @@ void GStreamerReader::PlayBinSourceSetup(GstAppSrc* aSource) /* let the demuxer work in pull mode for local files (or very short files) * so that we get optimal seeking accuracy/performance */ - LOG(LogLevel::Debug, "configuring random access, len %lld", resourceLength); + LOG(PR_LOG_DEBUG, "configuring random access, len %lld", resourceLength); gst_app_src_set_stream_type(mSource, GST_APP_STREAM_TYPE_RANDOM_ACCESS); } else { /* make the demuxer work in push mode so that seeking is kept to a minimum */ - LOG(LogLevel::Debug, "configuring push mode, len %lld", resourceLength); + LOG(PR_LOG_DEBUG, "configuring push mode, len %lld", resourceLength); gst_app_src_set_stream_type(mSource, GST_APP_STREAM_TYPE_SEEKABLE); } @@ -420,9 +420,9 @@ nsresult GStreamerReader::ReadMetadata(MediaInfo* aInfo, gst_object_unref(filter); } - LOG(LogLevel::Debug, "starting metadata pipeline"); + LOG(PR_LOG_DEBUG, "starting metadata pipeline"); if (gst_element_set_state(mPlayBin, GST_STATE_PAUSED) == GST_STATE_CHANGE_FAILURE) { - LOG(LogLevel::Debug, "metadata pipeline state change failed"); + LOG(PR_LOG_DEBUG, "metadata pipeline state change failed"); ret = NS_ERROR_FAILURE; continue; } @@ -433,19 +433,19 @@ nsresult GStreamerReader::ReadMetadata(MediaInfo* aInfo, message = gst_bus_timed_pop_filtered(mBus, GST_CLOCK_TIME_NONE, (GstMessageType)(GST_MESSAGE_ASYNC_DONE | GST_MESSAGE_ERROR | GST_MESSAGE_EOS)); if (GST_MESSAGE_TYPE(message) == GST_MESSAGE_ASYNC_DONE) { - LOG(LogLevel::Debug, "read metadata pipeline prerolled"); + LOG(PR_LOG_DEBUG, "read metadata pipeline prerolled"); gst_message_unref(message); ret = NS_OK; break; } else { - LOG(LogLevel::Debug, "read metadata pipeline failed to preroll: %s", + LOG(PR_LOG_DEBUG, "read metadata pipeline failed to preroll: %s", gst_message_type_get_name (GST_MESSAGE_TYPE (message))); if (GST_MESSAGE_TYPE(message) == GST_MESSAGE_ERROR) { GError* error; gchar* debug; gst_message_parse_error(message, &error, &debug); - LOG(LogLevel::Error, "read metadata error: %s: %s", error->message, debug); + LOG(PR_LOG_ERROR, "read metadata error: %s: %s", error->message, debug); g_error_free(error); g_free(debug); } @@ -475,7 +475,7 @@ nsresult GStreamerReader::ReadMetadata(MediaInfo* aInfo, mLastParserDuration = mMP3FrameParser.GetDuration(); mDecoder->SetMediaDuration(mLastParserDuration); } else { - LOG(LogLevel::Debug, "querying duration"); + LOG(PR_LOG_DEBUG, "querying duration"); // Otherwise use the gstreamer duration. #if GST_VERSION_MAJOR >= 1 if (gst_element_query_duration(GST_ELEMENT(mPlayBin), @@ -486,7 +486,7 @@ nsresult GStreamerReader::ReadMetadata(MediaInfo* aInfo, &format, &duration) && format == GST_FORMAT_TIME) { #endif ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor()); - LOG(LogLevel::Debug, "have duration %" GST_TIME_FORMAT, GST_TIME_ARGS(duration)); + LOG(PR_LOG_DEBUG, "have duration %" GST_TIME_FORMAT, GST_TIME_ARGS(duration)); duration = GST_TIME_AS_USECONDS (duration); mDecoder->SetMediaDuration(duration); } @@ -618,7 +618,7 @@ nsresult GStreamerReader::ResetDecode() { nsresult res = NS_OK; - LOG(LogLevel::Debug, "reset decode"); + LOG(PR_LOG_DEBUG, "reset decode"); if (NS_FAILED(MediaDecoderReader::ResetDecode())) { res = NS_ERROR_FAILURE; @@ -635,7 +635,7 @@ nsresult GStreamerReader::ResetDecode() mConfigureAlignment = true; #endif - LOG(LogLevel::Debug, "reset decode done"); + LOG(PR_LOG_DEBUG, "reset decode done"); return res; } @@ -798,7 +798,7 @@ bool GStreamerReader::DecodeVideoFrame(bool &aKeyFrameSkip, duration = gst_util_uint64_scale(GST_USECOND, fpsDen, fpsNum); if (timestamp < aTimeThreshold) { - LOG(LogLevel::Debug, "skipping frame %" GST_TIME_FORMAT + LOG(PR_LOG_DEBUG, "skipping frame %" GST_TIME_FORMAT " threshold %" GST_TIME_FORMAT, GST_TIME_ARGS(timestamp * 1000), GST_TIME_ARGS(aTimeThreshold * 1000)); @@ -851,7 +851,7 @@ GStreamerReader::Seek(int64_t aTarget, int64_t aEndTime) MOZ_ASSERT(OnTaskQueue()); gint64 seekPos = aTarget * GST_USECOND; - LOG(LogLevel::Debug, "%p About to seek to %" GST_TIME_FORMAT, + LOG(PR_LOG_DEBUG, "%p About to seek to %" GST_TIME_FORMAT, mDecoder, GST_TIME_ARGS(seekPos)); int flags = GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT; @@ -859,14 +859,14 @@ GStreamerReader::Seek(int64_t aTarget, int64_t aEndTime) GST_FORMAT_TIME, static_cast(flags), seekPos)) { - LOG(LogLevel::Error, "seek failed"); + LOG(PR_LOG_ERROR, "seek failed"); return SeekPromise::CreateAndReject(NS_ERROR_FAILURE, __func__); } - LOG(LogLevel::Debug, "seek succeeded"); + LOG(PR_LOG_DEBUG, "seek succeeded"); GstMessage* message = gst_bus_timed_pop_filtered(mBus, GST_CLOCK_TIME_NONE, (GstMessageType)(GST_MESSAGE_ASYNC_DONE | GST_MESSAGE_ERROR)); gst_message_unref(message); - LOG(LogLevel::Debug, "seek completed"); + LOG(PR_LOG_DEBUG, "seek completed"); return SeekPromise::CreateAndResolve(aTarget, __func__); } @@ -894,7 +894,7 @@ media::TimeIntervals GStreamerReader::GetBuffered() duration = mDecoder->GetMediaDuration(); } - LOG(LogLevel::Debug, "complete range [0, %f] for [0, %li]", + LOG(PR_LOG_DEBUG, "complete range [0, %f] for [0, %li]", (double) duration / GST_MSECOND, GetDataLength()); buffered += media::TimeInterval(media::TimeUnit::FromMicroseconds(0), @@ -923,7 +923,7 @@ media::TimeIntervals GStreamerReader::GetBuffered() continue; #endif - LOG(LogLevel::Debug, "adding range [%f, %f] for [%li %li] size %li", + LOG(PR_LOG_DEBUG, "adding range [%f, %f] for [%li %li] size %li", (double) GST_TIME_AS_USECONDS (startTime) / GST_MSECOND, (double) GST_TIME_AS_USECONDS (endTime) / GST_MSECOND, startOffset, endOffset, GetDataLength()); @@ -973,16 +973,16 @@ void GStreamerReader::ReadAndPushData(guint aLength) GstFlowReturn ret = gst_app_src_push_buffer(mSource, gst_buffer_ref(buffer)); if (ret != GST_FLOW_OK) { - LOG(LogLevel::Error, "ReadAndPushData push ret %s(%d)", gst_flow_get_name(ret), ret); + LOG(PR_LOG_ERROR, "ReadAndPushData push ret %s(%d)", gst_flow_get_name(ret), ret); } if (NS_FAILED(rv)) { /* Terminate the stream if there is an error in reading */ - LOG(LogLevel::Error, "ReadAndPushData read error, rv=%x", rv); + LOG(PR_LOG_ERROR, "ReadAndPushData read error, rv=%x", rv); gst_app_src_end_of_stream(mSource); } else if (bytesRead < aLength) { /* If we read less than what we wanted, we reached the end */ - LOG(LogLevel::Warning, "ReadAndPushData read underflow, " + LOG(PR_LOG_WARNING, "ReadAndPushData read underflow, " "bytesRead=%u, aLength=%u, offset(%lld,%lld)", bytesRead, aLength, offset1, offset2); gst_app_src_end_of_stream(mSource); @@ -1051,7 +1051,7 @@ gboolean GStreamerReader::SeekData(GstAppSrc* aSrc, guint64 aOffset) } if (NS_FAILED(rv)) { - LOG(LogLevel::Error, "seek at %lu failed", aOffset); + LOG(PR_LOG_ERROR, "seek at %lu failed", aOffset); } else { MOZ_ASSERT(aOffset == static_cast(resource->Tell())); } @@ -1074,7 +1074,7 @@ GstFlowReturn GStreamerReader::NewPrerollCb(GstAppSink* aSink, void GStreamerReader::AudioPreroll() { /* The first audio buffer has reached the audio sink. Get rate and channels */ - LOG(LogLevel::Debug, "Audio preroll"); + LOG(PR_LOG_DEBUG, "Audio preroll"); GstPad* sinkpad = gst_element_get_static_pad(GST_ELEMENT(mAudioAppSink), "sink"); #if GST_VERSION_MAJOR >= 1 GstCaps *caps = gst_pad_get_current_caps(sinkpad); @@ -1096,7 +1096,7 @@ void GStreamerReader::AudioPreroll() void GStreamerReader::VideoPreroll() { /* The first video buffer has reached the video sink. Get width and height */ - LOG(LogLevel::Debug, "Video preroll"); + LOG(PR_LOG_DEBUG, "Video preroll"); GstPad* sinkpad = gst_element_get_static_pad(GST_ELEMENT(mVideoAppSink), "sink"); int PARNumerator, PARDenominator; #if GST_VERSION_MAJOR >= 1 @@ -1130,7 +1130,7 @@ void GStreamerReader::VideoPreroll() gst_structure_get_fraction(structure, "framerate", &fpsNum, &fpsDen); mInfo.mVideo.mDisplay = displaySize; } else { - LOG(LogLevel::Debug, "invalid video region"); + LOG(PR_LOG_DEBUG, "invalid video region"); Eos(); } gst_caps_unref(caps); @@ -1364,7 +1364,7 @@ GstPadProbeReturn GStreamerReader::EventProbe(GstPad *aPad, GstEvent *aEvent) { GstElement* parent = GST_ELEMENT(gst_pad_get_parent(aPad)); - LOG(LogLevel::Debug, "event probe %s", GST_EVENT_TYPE_NAME (aEvent)); + LOG(PR_LOG_DEBUG, "event probe %s", GST_EVENT_TYPE_NAME (aEvent)); switch(GST_EVENT_TYPE(aEvent)) { case GST_EVENT_SEGMENT: diff --git a/dom/media/imagecapture/ImageCapture.h b/dom/media/imagecapture/ImageCapture.h index ea1039b3c275..28052dbc7255 100644 --- a/dom/media/imagecapture/ImageCapture.h +++ b/dom/media/imagecapture/ImageCapture.h @@ -15,7 +15,7 @@ namespace mozilla { #ifndef IC_LOG PRLogModuleInfo* GetICLog(); -#define IC_LOG(...) MOZ_LOG(GetICLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define IC_LOG(...) MOZ_LOG(GetICLog(), PR_LOG_DEBUG, (__VA_ARGS__)) #endif namespace dom { diff --git a/dom/media/mediasource/ContainerParser.cpp b/dom/media/mediasource/ContainerParser.cpp index 7b71016eaeab..ee17396ac2d6 100644 --- a/dom/media/mediasource/ContainerParser.cpp +++ b/dom/media/mediasource/ContainerParser.cpp @@ -26,7 +26,7 @@ extern PRLogModuleInfo* GetMediaSourceLog(); #define STRINGIFY(x) #x #define TOSTRING(x) STRINGIFY(x) -#define MSE_DEBUG(name, arg, ...) MOZ_LOG(GetMediaSourceLog(), mozilla::LogLevel::Debug, (TOSTRING(name) "(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__)) +#define MSE_DEBUG(name, arg, ...) MOZ_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, (TOSTRING(name) "(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__)) namespace mozilla { diff --git a/dom/media/mediasource/MediaSource.cpp b/dom/media/mediasource/MediaSource.cpp index 113cb65150db..fe22de9b55d0 100644 --- a/dom/media/mediasource/MediaSource.cpp +++ b/dom/media/mediasource/MediaSource.cpp @@ -57,8 +57,8 @@ PRLogModuleInfo* GetMediaSourceAPILog() return sLogModule; } -#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), mozilla::LogLevel::Debug, ("MediaSource(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) -#define MSE_API(arg, ...) MOZ_LOG(GetMediaSourceAPILog(), mozilla::LogLevel::Debug, ("MediaSource(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) +#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("MediaSource(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) +#define MSE_API(arg, ...) MOZ_LOG(GetMediaSourceAPILog(), PR_LOG_DEBUG, ("MediaSource(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) // Arbitrary limit. static const unsigned int MAX_SOURCE_BUFFERS = 16; diff --git a/dom/media/mediasource/MediaSourceDecoder.cpp b/dom/media/mediasource/MediaSourceDecoder.cpp index 6b0a76447997..84daf182eccc 100644 --- a/dom/media/mediasource/MediaSourceDecoder.cpp +++ b/dom/media/mediasource/MediaSourceDecoder.cpp @@ -17,8 +17,8 @@ extern PRLogModuleInfo* GetMediaSourceLog(); -#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), mozilla::LogLevel::Debug, ("MediaSourceDecoder(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) -#define MSE_DEBUGV(arg, ...) MOZ_LOG(GetMediaSourceLog(), mozilla::LogLevel::Verbose, ("MediaSourceDecoder(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) +#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("MediaSourceDecoder(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) +#define MSE_DEBUGV(arg, ...) MOZ_LOG(GetMediaSourceLog(), PR_LOG_DEBUG + 1, ("MediaSourceDecoder(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) namespace mozilla { diff --git a/dom/media/mediasource/MediaSourceReader.cpp b/dom/media/mediasource/MediaSourceReader.cpp index ef20ed7ed0a4..72eb4001b73a 100644 --- a/dom/media/mediasource/MediaSourceReader.cpp +++ b/dom/media/mediasource/MediaSourceReader.cpp @@ -25,8 +25,8 @@ extern PRLogModuleInfo* GetMediaSourceLog(); -#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), mozilla::LogLevel::Debug, ("MediaSourceReader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) -#define MSE_DEBUGV(arg, ...) MOZ_LOG(GetMediaSourceLog(), mozilla::LogLevel::Verbose, ("MediaSourceReader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) +#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("MediaSourceReader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) +#define MSE_DEBUGV(arg, ...) MOZ_LOG(GetMediaSourceLog(), PR_LOG_DEBUG + 1, ("MediaSourceReader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) // When a stream hits EOS it needs to decide what other stream to switch to. Due // to inaccuracies is determining buffer end frames (Bug 1065207) and rounding diff --git a/dom/media/mediasource/MediaSourceResource.h b/dom/media/mediasource/MediaSourceResource.h index b6736124bd3e..80275fad3dee 100644 --- a/dom/media/mediasource/MediaSourceResource.h +++ b/dom/media/mediasource/MediaSourceResource.h @@ -13,7 +13,7 @@ extern PRLogModuleInfo* GetMediaSourceLog(); -#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), mozilla::LogLevel::Debug, ("MediaSourceResource(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__)) +#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("MediaSourceResource(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__)) #define UNIMPLEMENTED() MSE_DEBUG("UNIMPLEMENTED FUNCTION at %s:%d", __FILE__, __LINE__) diff --git a/dom/media/mediasource/ResourceQueue.cpp b/dom/media/mediasource/ResourceQueue.cpp index 83f4ee07808b..23859c9c3506 100644 --- a/dom/media/mediasource/ResourceQueue.cpp +++ b/dom/media/mediasource/ResourceQueue.cpp @@ -15,8 +15,8 @@ extern PRLogModuleInfo* GetSourceBufferResourceLog(); #define __func__ __FUNCTION__ #endif -#define SBR_DEBUG(arg, ...) MOZ_LOG(GetSourceBufferResourceLog(), mozilla::LogLevel::Debug, ("ResourceQueue(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) -#define SBR_DEBUGV(arg, ...) MOZ_LOG(GetSourceBufferResourceLog(), mozilla::LogLevel::Verbose, ("ResourceQueue(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) +#define SBR_DEBUG(arg, ...) MOZ_LOG(GetSourceBufferResourceLog(), PR_LOG_DEBUG, ("ResourceQueue(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) +#define SBR_DEBUGV(arg, ...) MOZ_LOG(GetSourceBufferResourceLog(), PR_LOG_DEBUG+1, ("ResourceQueue(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) namespace mozilla { diff --git a/dom/media/mediasource/SourceBuffer.cpp b/dom/media/mediasource/SourceBuffer.cpp index 6869e6cf1469..d11f45d43084 100644 --- a/dom/media/mediasource/SourceBuffer.cpp +++ b/dom/media/mediasource/SourceBuffer.cpp @@ -29,9 +29,9 @@ class JSObject; extern PRLogModuleInfo* GetMediaSourceLog(); extern PRLogModuleInfo* GetMediaSourceAPILog(); -#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), mozilla::LogLevel::Debug, ("SourceBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__)) -#define MSE_DEBUGV(arg, ...) MOZ_LOG(GetMediaSourceLog(), mozilla::LogLevel::Verbose, ("SourceBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__)) -#define MSE_API(arg, ...) MOZ_LOG(GetMediaSourceAPILog(), mozilla::LogLevel::Debug, ("SourceBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__)) +#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("SourceBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__)) +#define MSE_DEBUGV(arg, ...) MOZ_LOG(GetMediaSourceLog(), PR_LOG_DEBUG + 1, ("SourceBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__)) +#define MSE_API(arg, ...) MOZ_LOG(GetMediaSourceAPILog(), PR_LOG_DEBUG, ("SourceBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__)) namespace mozilla { diff --git a/dom/media/mediasource/SourceBufferDecoder.cpp b/dom/media/mediasource/SourceBufferDecoder.cpp index 038831b68e74..e72bd2384fda 100644 --- a/dom/media/mediasource/SourceBufferDecoder.cpp +++ b/dom/media/mediasource/SourceBufferDecoder.cpp @@ -16,7 +16,7 @@ extern PRLogModuleInfo* GetMediaSourceLog(); #define __func__ __FUNCTION__ #endif -#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), mozilla::LogLevel::Debug, ("SourceBufferDecoder(%p:%s)::%s: " arg, this, mResource->GetContentType().get(), __func__, ##__VA_ARGS__)) +#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("SourceBufferDecoder(%p:%s)::%s: " arg, this, mResource->GetContentType().get(), __func__, ##__VA_ARGS__)) namespace mozilla { diff --git a/dom/media/mediasource/SourceBufferList.cpp b/dom/media/mediasource/SourceBufferList.cpp index 71279e08e595..39ab7f5872aa 100644 --- a/dom/media/mediasource/SourceBufferList.cpp +++ b/dom/media/mediasource/SourceBufferList.cpp @@ -19,8 +19,8 @@ extern PRLogModuleInfo* GetMediaSourceLog(); extern PRLogModuleInfo* GetMediaSourceAPILog(); -#define MSE_API(arg, ...) MOZ_LOG(GetMediaSourceAPILog(), mozilla::LogLevel::Debug, ("SourceBufferList(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) -#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), mozilla::LogLevel::Debug, ("SourceBufferList(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) +#define MSE_API(arg, ...) MOZ_LOG(GetMediaSourceAPILog(), PR_LOG_DEBUG, ("SourceBufferList(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) +#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("SourceBufferList(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) struct JSContext; class JSObject; diff --git a/dom/media/mediasource/SourceBufferResource.cpp b/dom/media/mediasource/SourceBufferResource.cpp index 4946af56a285..3e624031df6b 100644 --- a/dom/media/mediasource/SourceBufferResource.cpp +++ b/dom/media/mediasource/SourceBufferResource.cpp @@ -22,8 +22,8 @@ PRLogModuleInfo* GetSourceBufferResourceLog() return sLogModule; } -#define SBR_DEBUG(arg, ...) MOZ_LOG(GetSourceBufferResourceLog(), mozilla::LogLevel::Debug, ("SourceBufferResource(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__)) -#define SBR_DEBUGV(arg, ...) MOZ_LOG(GetSourceBufferResourceLog(), mozilla::LogLevel::Verbose, ("SourceBufferResource(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__)) +#define SBR_DEBUG(arg, ...) MOZ_LOG(GetSourceBufferResourceLog(), PR_LOG_DEBUG, ("SourceBufferResource(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__)) +#define SBR_DEBUGV(arg, ...) MOZ_LOG(GetSourceBufferResourceLog(), PR_LOG_DEBUG+1, ("SourceBufferResource(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__)) namespace mozilla { diff --git a/dom/media/mediasource/TrackBuffer.cpp b/dom/media/mediasource/TrackBuffer.cpp index 5148cfcc19b4..401e62348f8f 100644 --- a/dom/media/mediasource/TrackBuffer.cpp +++ b/dom/media/mediasource/TrackBuffer.cpp @@ -24,7 +24,7 @@ extern PRLogModuleInfo* GetMediaSourceLog(); -#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), mozilla::LogLevel::Debug, ("TrackBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__)) +#define MSE_DEBUG(arg, ...) MOZ_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("TrackBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__)) // Time in seconds to substract from the current time when deciding the // time point to evict data before in a decoder. This is used to help diff --git a/dom/media/ogg/OggCodecState.cpp b/dom/media/ogg/OggCodecState.cpp index e0761d0fb774..e05cdc8a71fc 100644 --- a/dom/media/ogg/OggCodecState.cpp +++ b/dom/media/ogg/OggCodecState.cpp @@ -117,18 +117,18 @@ bool OggCodecState::AddVorbisComment(MetadataTags* aTags, { const char* div = (const char*)memchr(aComment, '=', aLength); if (!div) { - LOG(LogLevel::Debug, ("Skipping comment: no separator")); + LOG(PR_LOG_DEBUG, ("Skipping comment: no separator")); return false; } nsCString key = nsCString(aComment, div-aComment); if (!IsValidVorbisTagName(key)) { - LOG(LogLevel::Debug, ("Skipping comment: invalid tag name")); + LOG(PR_LOG_DEBUG, ("Skipping comment: invalid tag name")); return false; } uint32_t valueLength = aLength - (div-aComment); nsCString value = nsCString(div + 1, valueLength); if (!IsUTF8(value)) { - LOG(LogLevel::Debug, ("Skipping comment: invalid UTF-8 in value")); + LOG(PR_LOG_DEBUG, ("Skipping comment: invalid UTF-8 in value")); return false; } aTags->Put(key, value); @@ -835,7 +835,7 @@ nsresult OpusState::Reset(bool aStart) return NS_ERROR_FAILURE; } - LOG(LogLevel::Debug, ("Opus decoder reset, to skip %d", mSkip)); + LOG(PR_LOG_DEBUG, ("Opus decoder reset, to skip %d", mSkip)); return res; } @@ -858,7 +858,7 @@ bool OpusState::Init(void) mSkip = mParser->mPreSkip; - LOG(LogLevel::Debug, ("Opus decoder init, to skip %d", mSkip)); + LOG(PR_LOG_DEBUG, ("Opus decoder init, to skip %d", mSkip)); return error == OPUS_OK; } @@ -1187,7 +1187,7 @@ bool SkeletonState::DecodeIndex(ogg_packet* aPacket) int64_t timeDenom = LittleEndian::readInt64(aPacket->packet + INDEX_TIME_DENOM_OFFSET); if (timeDenom == 0) { - LOG(LogLevel::Debug, ("Ogg Skeleton Index packet for stream %u has 0 " + LOG(PR_LOG_DEBUG, ("Ogg Skeleton Index packet for stream %u has 0 " "timestamp denominator.", serialno)); return (mActive = false); } @@ -1230,7 +1230,7 @@ bool SkeletonState::DecodeIndex(ogg_packet* aPacket) // possibly contain as many packets as it claims to, so the numKeyPoints // field is possibly malicious. Don't try decoding this index, we may run // out of memory. - LOG(LogLevel::Debug, ("Possibly malicious number of key points reported " + LOG(PR_LOG_DEBUG, ("Possibly malicious number of key points reported " "(%lld) in index packet for stream %u.", numKeyPoints, serialno)); @@ -1278,7 +1278,7 @@ bool SkeletonState::DecodeIndex(ogg_packet* aPacket) mIndex.Put(serialno, keyPoints.forget()); } - LOG(LogLevel::Debug, ("Loaded %d keypoints for Skeleton on stream %u", + LOG(PR_LOG_DEBUG, ("Loaded %d keypoints for Skeleton on stream %u", keyPointsRead, serialno)); return true; } @@ -1342,7 +1342,7 @@ nsresult SkeletonState::IndexedSeekTarget(int64_t aTarget, if (r.IsNull()) { return NS_ERROR_FAILURE; } - LOG(LogLevel::Debug, ("Indexed seek target for time %lld is offset %lld", + LOG(PR_LOG_DEBUG, ("Indexed seek target for time %lld is offset %lld", aTarget, r.mKeyPoint.mOffset)); aResult = r; return NS_OK; @@ -1482,7 +1482,7 @@ bool SkeletonState::DecodeHeader(ogg_packet* aPacket) // Extract the segment length. mLength = LittleEndian::readInt64(aPacket->packet + SKELETON_FILE_LENGTH_OFFSET); - LOG(LogLevel::Debug, ("Skeleton segment length: %lld", mLength)); + LOG(PR_LOG_DEBUG, ("Skeleton segment length: %lld", mLength)); // Initialize the serialno-to-index map. return true; diff --git a/dom/media/ogg/OggReader.cpp b/dom/media/ogg/OggReader.cpp index 46afbd1985c6..808a5f251b87 100644 --- a/dom/media/ogg/OggReader.cpp +++ b/dom/media/ogg/OggReader.cpp @@ -291,7 +291,7 @@ void OggReader::SetupTargetSkeleton(SkeletonState* aSkeletonState) if (NS_SUCCEEDED(aSkeletonState->GetDuration(tracks, duration))) { ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor()); mDecoder->SetMediaDuration(duration); - LOG(LogLevel::Debug, ("Got duration from Skeleton index %lld", duration)); + LOG(PR_LOG_DEBUG, ("Got duration from Skeleton index %lld", duration)); } } } @@ -492,7 +492,7 @@ nsresult OggReader::ReadMetadata(MediaInfo* aInfo, } if (endTime != -1) { mDecoder->SetMediaEndTime(endTime); - LOG(LogLevel::Debug, ("Got Ogg duration from seeking to end %lld", endTime)); + LOG(PR_LOG_DEBUG, ("Got Ogg duration from seeking to end %lld", endTime)); } } } else { @@ -613,7 +613,7 @@ nsresult OggReader::DecodeOpus(ogg_packet* aPacket) { if (skipFrames == frames) { // discard the whole packet mOpusState->mSkip -= frames; - LOG(LogLevel::Debug, ("Opus decoder skipping %d frames" + LOG(PR_LOG_DEBUG, ("Opus decoder skipping %d frames" " (whole packet)", frames)); return NS_OK; } @@ -628,7 +628,7 @@ nsresult OggReader::DecodeOpus(ogg_packet* aPacket) { buffer = trimBuffer; mOpusState->mSkip -= skipFrames; - LOG(LogLevel::Debug, ("Opus decoder skipping %d frames", skipFrames)); + LOG(PR_LOG_DEBUG, ("Opus decoder skipping %d frames", skipFrames)); } // Save this packet's granule position in case we need to perform end // trimming on the next packet. @@ -659,7 +659,7 @@ nsresult OggReader::DecodeOpus(ogg_packet* aPacket) { return NS_ERROR_FAILURE; } - LOG(LogLevel::Debug, ("Opus decoder pushing %d frames", frames)); + LOG(PR_LOG_DEBUG, ("Opus decoder pushing %d frames", frames)); int64_t startTime = mOpusState->Time(startFrame); int64_t endTime = mOpusState->Time(endFrame); mAudioQueue.Push(new AudioData(mDecoder->GetResource()->Tell(), @@ -787,7 +787,7 @@ bool OggReader::ReadOggChain() (mVorbisState->mInfo.channels == newVorbisState->mInfo.channels)) { SetupTargetVorbis(newVorbisState); - LOG(LogLevel::Debug, ("New vorbis ogg link, serial=%d\n", mVorbisSerial)); + LOG(PR_LOG_DEBUG, ("New vorbis ogg link, serial=%d\n", mVorbisSerial)); if (msgInfo) { InitTrack(TrackInfo::kAudioTrack, msgInfo, &mInfo.mAudio, true); @@ -1292,7 +1292,7 @@ OggReader::IndexedSeekResult OggReader::SeekToKeyframeUsingIndex(int64_t aTarget // Index must be invalid. return RollbackIndexedSeek(tell); } - LOG(LogLevel::Debug, ("Seeking using index to keyframe at offset %lld\n", + LOG(PR_LOG_DEBUG, ("Seeking using index to keyframe at offset %lld\n", keyframe.mKeyPoint.mOffset)); nsresult res = resource->Seek(nsISeekableStream::NS_SEEK_SET, keyframe.mKeyPoint.mOffset); @@ -1315,7 +1315,7 @@ OggReader::IndexedSeekResult OggReader::SeekToKeyframeUsingIndex(int64_t aTarget skippedBytes); NS_ENSURE_TRUE(syncres != PAGE_SYNC_ERROR, SEEK_FATAL_ERROR); if (syncres != PAGE_SYNC_OK || skippedBytes != 0) { - LOG(LogLevel::Debug, ("Indexed-seek failure: Ogg Skeleton Index is invalid " + LOG(PR_LOG_DEBUG, ("Indexed-seek failure: Ogg Skeleton Index is invalid " "or sync error after seek")); return RollbackIndexedSeek(tell); } @@ -1344,7 +1344,7 @@ nsresult OggReader::SeekInBufferedRange(int64_t aTarget, const nsTArray& aRanges, const SeekRange& aRange) { - LOG(LogLevel::Debug, ("%p Seeking in buffered data to %lld using bisection search", mDecoder, aTarget)); + LOG(PR_LOG_DEBUG, ("%p Seeking in buffered data to %lld using bisection search", mDecoder, aTarget)); nsresult res = NS_OK; if (HasVideo() || aAdjustedTarget >= aTarget) { // We know the exact byte range in which the target must lie. It must @@ -1377,7 +1377,7 @@ nsresult OggReader::SeekInBufferedRange(int64_t aTarget, int shift = mTheoraState->mInfo.keyframe_granule_shift; int64_t keyframeGranulepos = (video->mTimecode >> shift) << shift; int64_t keyframeTime = mTheoraState->StartTime(keyframeGranulepos); - SEEK_LOG(LogLevel::Debug, ("Keyframe for %lld is at %lld, seeking back to it", + SEEK_LOG(PR_LOG_DEBUG, ("Keyframe for %lld is at %lld, seeking back to it", video->mTime, keyframeTime)); aAdjustedTarget = std::min(aAdjustedTarget, keyframeTime); } @@ -1398,7 +1398,7 @@ nsresult OggReader::SeekInUnbuffered(int64_t aTarget, int64_t aEndTime, const nsTArray& aRanges) { - LOG(LogLevel::Debug, ("%p Seeking in unbuffered data to %lld using bisection search", mDecoder, aTarget)); + LOG(PR_LOG_DEBUG, ("%p Seeking in unbuffered data to %lld using bisection search", mDecoder, aTarget)); // If we've got an active Theora bitstream, determine the maximum possible // time in usecs which a keyframe could be before a given interframe. We @@ -1443,7 +1443,7 @@ nsresult OggReader::SeekInternal(int64_t aTarget, int64_t aEndTime) MOZ_ASSERT(OnTaskQueue()); if (mIsChained) return NS_ERROR_FAILURE; - LOG(LogLevel::Debug, ("%p About to seek to %lld", mDecoder, aTarget)); + LOG(PR_LOG_DEBUG, ("%p About to seek to %lld", mDecoder, aTarget)); nsresult res; MediaResource* resource = mDecoder->GetResource(); NS_ENSURE_TRUE(resource != nullptr, NS_ERROR_FAILURE); @@ -1657,7 +1657,7 @@ nsresult OggReader::SeekBisection(int64_t aTarget, // Our interval is empty, we've found the optimal seek point, as the // page at the start offset is before the seek target, and the page // at the end offset is after the seek target. - SEEK_LOG(LogLevel::Debug, ("Interval narrowed, terminating bisection.")); + SEEK_LOG(PR_LOG_DEBUG, ("Interval narrowed, terminating bisection.")); break; } @@ -1672,7 +1672,7 @@ nsresult OggReader::SeekBisection(int64_t aTarget, // probably because we ran out of data to decode. This usually happens // when we guess very close to the end offset. So reduce the guess // offset using an exponential backoff until we determine the time. - SEEK_LOG(LogLevel::Debug, ("Backing off %d bytes, backsteps=%d", + SEEK_LOG(PR_LOG_DEBUG, ("Backing off %d bytes, backsteps=%d", static_cast(PAGE_STEP * pow(2.0, backsteps)), backsteps)); guess -= PAGE_STEP * static_cast(pow(2.0, backsteps)); @@ -1695,7 +1695,7 @@ nsresult OggReader::SeekBisection(int64_t aTarget, } guess = std::max(guess, startOffset + startLength); - SEEK_LOG(LogLevel::Debug, ("Seek loop start[o=%lld..%lld t=%lld] " + SEEK_LOG(PR_LOG_DEBUG, ("Seek loop start[o=%lld..%lld t=%lld] " "end[o=%lld t=%lld] " "interval=%lld target=%lf guess=%lld", startOffset, (startOffset+startLength), startTime, @@ -1725,7 +1725,7 @@ nsresult OggReader::SeekBisection(int64_t aTarget, // page. Backoff exponentially from the end point, in case the last // page/frame/sample is huge. mustBackoff = true; - SEEK_LOG(LogLevel::Debug, ("Hit the end of range, backing off")); + SEEK_LOG(PR_LOG_DEBUG, ("Hit the end of range, backing off")); continue; } @@ -1808,7 +1808,7 @@ nsresult OggReader::SeekBisection(int64_t aTarget, if (interval == 0) { // Seek termination condition; we've found the page boundary of the // last page before the target, and the first page after the target. - SEEK_LOG(LogLevel::Debug, ("Terminating seek at offset=%lld", startOffset)); + SEEK_LOG(PR_LOG_DEBUG, ("Terminating seek at offset=%lld", startOffset)); NS_ASSERTION(startTime < aTarget, "Start time must always be less than target"); res = resource->Seek(nsISeekableStream::NS_SEEK_SET, startOffset); NS_ENSURE_SUCCESS(res,res); @@ -1818,7 +1818,7 @@ nsresult OggReader::SeekBisection(int64_t aTarget, break; } - SEEK_LOG(LogLevel::Debug, ("Time at offset %lld is %lld", guess, granuleTime)); + SEEK_LOG(PR_LOG_DEBUG, ("Time at offset %lld is %lld", guess, granuleTime)); if (granuleTime < seekTarget && granuleTime > seekLowerBound) { // We're within the fuzzy region in which we want to terminate the search. res = resource->Seek(nsISeekableStream::NS_SEEK_SET, pageOffset); @@ -1826,7 +1826,7 @@ nsresult OggReader::SeekBisection(int64_t aTarget, if (NS_FAILED(ResetDecode())) { return NS_ERROR_FAILURE; } - SEEK_LOG(LogLevel::Debug, ("Terminating seek at offset=%lld", pageOffset)); + SEEK_LOG(PR_LOG_DEBUG, ("Terminating seek at offset=%lld", pageOffset)); break; } @@ -1847,7 +1847,7 @@ nsresult OggReader::SeekBisection(int64_t aTarget, NS_ASSERTION(endTime >= seekTarget, "End must be after seek target"); } - SEEK_LOG(LogLevel::Debug, ("Seek complete in %d bisections.", hops)); + SEEK_LOG(PR_LOG_DEBUG, ("Seek complete in %d bisections.", hops)); return NS_OK; } @@ -1984,14 +1984,14 @@ VideoData* OggReader::FindStartTime(int64_t& aOutStartTime) videoData = DecodeToFirstVideoData(); if (videoData) { videoStartTime = videoData->mTime; - LOG(LogLevel::Debug, ("OggReader::FindStartTime() video=%lld", videoStartTime)); + LOG(PR_LOG_DEBUG, ("OggReader::FindStartTime() video=%lld", videoStartTime)); } } if (HasAudio()) { AudioData* audioData = DecodeToFirstAudioData(); if (audioData) { audioStartTime = audioData->mTime; - LOG(LogLevel::Debug, ("OggReader::FindStartTime() audio=%lld", audioStartTime)); + LOG(PR_LOG_DEBUG, ("OggReader::FindStartTime() audio=%lld", audioStartTime)); } } diff --git a/dom/media/ogg/OpusParser.cpp b/dom/media/ogg/OpusParser.cpp index 8bdaf7f55017..e2b01772c4c2 100644 --- a/dom/media/ogg/OpusParser.cpp +++ b/dom/media/ogg/OpusParser.cpp @@ -45,7 +45,7 @@ OpusParser::OpusParser(): bool OpusParser::DecodeHeader(unsigned char* aData, size_t aLength) { if (aLength < 19 || memcmp(aData, "OpusHead", 8)) { - OPUS_LOG(LogLevel::Debug, ("Invalid Opus file: unrecognized header")); + OPUS_LOG(PR_LOG_DEBUG, ("Invalid Opus file: unrecognized header")); return false; } @@ -54,13 +54,13 @@ bool OpusParser::DecodeHeader(unsigned char* aData, size_t aLength) int version = aData[8]; // Accept file format versions 0.x. if ((version & 0xf0) != 0) { - OPUS_LOG(LogLevel::Debug, ("Rejecting unknown Opus file version %d", version)); + OPUS_LOG(PR_LOG_DEBUG, ("Rejecting unknown Opus file version %d", version)); return false; } mChannels = aData[9]; if (mChannels<1) { - OPUS_LOG(LogLevel::Debug, ("Invalid Opus file: Number of channels %d", mChannels)); + OPUS_LOG(PR_LOG_DEBUG, ("Invalid Opus file: Number of channels %d", mChannels)); return false; } @@ -78,7 +78,7 @@ bool OpusParser::DecodeHeader(unsigned char* aData, size_t aLength) if (mChannelMapping == 0) { // Mapping family 0 only allows two channels if (mChannels>2) { - OPUS_LOG(LogLevel::Debug, ("Invalid Opus file: too many channels (%d) for" + OPUS_LOG(PR_LOG_DEBUG, ("Invalid Opus file: too many channels (%d) for" " mapping family 0.", mChannels)); return false; } @@ -89,7 +89,7 @@ bool OpusParser::DecodeHeader(unsigned char* aData, size_t aLength) } else if (mChannelMapping == 1) { // Currently only up to 8 channels are defined for mapping family 1 if (mChannels>8) { - OPUS_LOG(LogLevel::Debug, ("Invalid Opus file: too many channels (%d) for" + OPUS_LOG(PR_LOG_DEBUG, ("Invalid Opus file: too many channels (%d) for" " mapping family 1.", mChannels)); return false; } @@ -100,34 +100,34 @@ bool OpusParser::DecodeHeader(unsigned char* aData, size_t aLength) for (i=0; i mStreams) { - OPUS_LOG(LogLevel::Debug, ("Invalid Opus file: more coupled streams (%d) than " + OPUS_LOG(PR_LOG_DEBUG, ("Invalid Opus file: more coupled streams (%d) than " "total streams (%d)", mCoupledStreams, mStreams)); return false; } #ifdef DEBUG - OPUS_LOG(LogLevel::Debug, ("Opus stream header:")); - OPUS_LOG(LogLevel::Debug, (" channels: %d", mChannels)); - OPUS_LOG(LogLevel::Debug, (" preskip: %d", mPreSkip)); - OPUS_LOG(LogLevel::Debug, (" original: %d Hz", mNominalRate)); - OPUS_LOG(LogLevel::Debug, (" gain: %.2f dB", gain_dB)); - OPUS_LOG(LogLevel::Debug, ("Channel Mapping:")); - OPUS_LOG(LogLevel::Debug, (" family: %d", mChannelMapping)); - OPUS_LOG(LogLevel::Debug, (" streams: %d", mStreams)); + OPUS_LOG(PR_LOG_DEBUG, ("Opus stream header:")); + OPUS_LOG(PR_LOG_DEBUG, (" channels: %d", mChannels)); + OPUS_LOG(PR_LOG_DEBUG, (" preskip: %d", mPreSkip)); + OPUS_LOG(PR_LOG_DEBUG, (" original: %d Hz", mNominalRate)); + OPUS_LOG(PR_LOG_DEBUG, (" gain: %.2f dB", gain_dB)); + OPUS_LOG(PR_LOG_DEBUG, ("Channel Mapping:")); + OPUS_LOG(PR_LOG_DEBUG, (" family: %d", mChannelMapping)); + OPUS_LOG(PR_LOG_DEBUG, (" streams: %d", mStreams)); #endif return true; } @@ -180,10 +180,10 @@ bool OpusParser::DecodeTags(unsigned char* aData, size_t aLength) } #ifdef DEBUG - OPUS_LOG(LogLevel::Debug, ("Opus metadata header:")); - OPUS_LOG(LogLevel::Debug, (" vendor: %s", mVendorString.get())); + OPUS_LOG(PR_LOG_DEBUG, ("Opus metadata header:")); + OPUS_LOG(PR_LOG_DEBUG, (" vendor: %s", mVendorString.get())); for (uint32_t i = 0; i < mTags.Length(); i++) { - OPUS_LOG(LogLevel::Debug, (" %s", mTags[i].get())); + OPUS_LOG(PR_LOG_DEBUG, (" %s", mTags[i].get())); } #endif return true; diff --git a/dom/media/omx/AudioOffloadPlayer.cpp b/dom/media/omx/AudioOffloadPlayer.cpp index cbf54a06041f..19141e0b62d9 100644 --- a/dom/media/omx/AudioOffloadPlayer.cpp +++ b/dom/media/omx/AudioOffloadPlayer.cpp @@ -135,7 +135,7 @@ status_t AudioOffloadPlayer::Start(bool aSourceAlreadyStarted) } if (mapMimeToAudioFormat(audioFormat, mime) != OK) { - AUDIO_OFFLOAD_LOG(LogLevel::Error, ("Couldn't map mime type \"%s\" to a valid " + AUDIO_OFFLOAD_LOG(PR_LOG_ERROR, ("Couldn't map mime type \"%s\" to a valid " "AudioSystem::audio_format", mime)); audioFormat = AUDIO_FORMAT_INVALID; } @@ -149,7 +149,7 @@ status_t AudioOffloadPlayer::Start(bool aSourceAlreadyStarted) offloadInfo.has_video = false; offloadInfo.is_streaming = false; - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("isOffloadSupported: SR=%u, CM=0x%x, " + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("isOffloadSupported: SR=%u, CM=0x%x, " "Format=0x%x, StreamType=%d, BitRate=%u, duration=%lld us, has_video=%d", offloadInfo.sample_rate, offloadInfo.channel_mask, offloadInfo.format, offloadInfo.stream_type, offloadInfo.bit_rate, offloadInfo.duration_us, @@ -210,7 +210,7 @@ status_t AudioOffloadPlayer::ChangeState(MediaDecoder::PlayState aState) static void ResetCallback(nsITimer* aTimer, void* aClosure) { - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("%s", __FUNCTION__)); + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("%s", __FUNCTION__)); AudioOffloadPlayer* player = static_cast(aClosure); if (player) { player->Reset(); @@ -291,7 +291,7 @@ void AudioOffloadPlayer::Reset() CHECK(mAudioSink.get()); - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("reset: mPlaying=%d mReachedEOS=%d", + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("reset: mPlaying=%d mReachedEOS=%d", mPlaying, mReachedEOS)); mAudioSink->Stop(); @@ -313,7 +313,7 @@ void AudioOffloadPlayer::Reset() // source is able to stop(). if (mInputBuffer) { - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("Releasing input buffer")); + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("Releasing input buffer")); mInputBuffer->release(); mInputBuffer = nullptr; @@ -349,7 +349,7 @@ status_t AudioOffloadPlayer::DoSeek() MOZ_ASSERT(mSeekTarget.IsValid()); CHECK(mAudioSink.get()); - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("DoSeek ( %lld )", mSeekTarget.mTime)); + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("DoSeek ( %lld )", mSeekTarget.mTime)); mReachedEOS = false; mPositionTimeMediaUs = -1; @@ -375,7 +375,7 @@ status_t AudioOffloadPlayer::DoSeek() } if (!mSeekPromise.IsEmpty()) { - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("Fake seek complete during pause")); + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("Fake seek complete during pause")); // We do not reset mSeekTarget here. MediaDecoder::SeekResolveValue val(mReachedEOS, mSeekTarget.mEventVisibility); mSeekPromise.Resolve(val, __func__); @@ -468,23 +468,23 @@ size_t AudioOffloadPlayer::AudioSinkCallback(GonkAudioSink* aAudioSink, switch (aEvent) { case GonkAudioSink::CB_EVENT_FILL_BUFFER: - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("Notify Audio position changed")); + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("Notify Audio position changed")); me->NotifyPositionChanged(); return me->FillBuffer(aBuffer, aSize); case GonkAudioSink::CB_EVENT_STREAM_END: - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("Notify Audio EOS")); + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("Notify Audio EOS")); me->mReachedEOS = true; me->NotifyAudioEOS(); break; case GonkAudioSink::CB_EVENT_TEAR_DOWN: - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("Notify Tear down event")); + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("Notify Tear down event")); me->NotifyAudioTearDown(); break; default: - AUDIO_OFFLOAD_LOG(LogLevel::Error, ("Unknown event %d from audio sink", + AUDIO_OFFLOAD_LOG(PR_LOG_ERROR, ("Unknown event %d from audio sink", aEvent)); break; } @@ -532,7 +532,7 @@ size_t AudioOffloadPlayer::FillBuffer(void* aData, size_t aSize) if (mSeekTarget.IsValid()) { mSeekTarget.Reset(); } - AUDIO_OFFLOAD_LOG(LogLevel::Error, ("Error while reading media source %d " + AUDIO_OFFLOAD_LOG(PR_LOG_ERROR, ("Error while reading media source %d " "Ok to receive EOS error at end", err)); if (!mReachedEOS) { // After seek there is a possible race condition if @@ -544,8 +544,8 @@ size_t AudioOffloadPlayer::FillBuffer(void* aData, size_t aSize) // there will be an unnecessary call to the parser // after parser signalled EOS. if (sizeDone > 0) { - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("send Partial buffer down")); - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("skip calling stop till next" + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("send Partial buffer down")); + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("skip calling stop till next" " fillBuffer")); break; } @@ -565,12 +565,12 @@ size_t AudioOffloadPlayer::FillBuffer(void* aData, size_t aSize) MOZ_ASSERT(mSeekTarget.IsValid()); mSeekTarget.Reset(); if (!mSeekPromise.IsEmpty()) { - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("FillBuffer posting SEEK_COMPLETE")); + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("FillBuffer posting SEEK_COMPLETE")); MediaDecoder::SeekResolveValue val(mReachedEOS, mSeekTarget.mEventVisibility); mSeekPromise.Resolve(val, __func__); } } else if (mSeekTarget.IsValid()) { - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("seek is updated during unlocking mLock")); + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("seek is updated during unlocking mLock")); } if (refreshSeekTime) { @@ -579,7 +579,7 @@ size_t AudioOffloadPlayer::FillBuffer(void* aData, size_t aSize) // need to adjust the mStartPosUs for offload decoding since parser // might not be able to get the exact seek time requested. mStartPosUs = mPositionTimeMediaUs; - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("Adjust seek time to: %.2f", + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("Adjust seek time to: %.2f", mStartPosUs / 1E6)); } } @@ -613,7 +613,7 @@ void AudioOffloadPlayer::SetElementVisibility(bool aIsVisible) MOZ_ASSERT(NS_IsMainThread()); mIsElementVisible = aIsVisible; if (mIsElementVisible) { - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("Element is visible. Start time update")); + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("Element is visible. Start time update")); StartTimeUpdate(); } } @@ -709,7 +709,7 @@ void AudioOffloadPlayer::SendMetaDataToHal(sp& aSink, param.addInt(String8(AUDIO_OFFLOAD_CODEC_PADDING_SAMPLES), paddingSamples); } - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("SendMetaDataToHal: bitRate %d," + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("SendMetaDataToHal: bitRate %d," " sampleRate %d, chanMask %d, delaySample %d, paddingSample %d", bitRate, sampleRate, channelMask, delaySamples, paddingSamples)); @@ -727,7 +727,7 @@ void AudioOffloadPlayer::SetVolume(double aVolume) void AudioOffloadPlayer::WakeLockCreate() { MOZ_ASSERT(NS_IsMainThread()); - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("%s", __FUNCTION__)); + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("%s", __FUNCTION__)); if (!mWakeLock) { nsRefPtr pmService = dom::power::PowerManagerService::GetInstance(); @@ -741,7 +741,7 @@ void AudioOffloadPlayer::WakeLockCreate() void AudioOffloadPlayer::WakeLockRelease() { MOZ_ASSERT(NS_IsMainThread()); - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("%s", __FUNCTION__)); + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("%s", __FUNCTION__)); if (mWakeLock) { ErrorResult rv; mWakeLock->Unlock(rv); diff --git a/dom/media/omx/AudioOutput.cpp b/dom/media/omx/AudioOutput.cpp index 9754da32b3d0..6fff747f5b09 100644 --- a/dom/media/omx/AudioOutput.cpp +++ b/dom/media/omx/AudioOutput.cpp @@ -96,13 +96,13 @@ status_t AudioOutput::Open(uint32_t aSampleRate, return BAD_VALUE; } - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("open(%u, %d, 0x%x, 0x%x, %d 0x%x)", + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("open(%u, %d, 0x%x, 0x%x, %d 0x%x)", aSampleRate, aChannelCount, aChannelMask, aFormat, mSessionId, aFlags)); if (aChannelMask == CHANNEL_MASK_USE_CHANNEL_ORDER) { aChannelMask = audio_channel_out_mask_from_count(aChannelCount); if (0 == aChannelMask) { - AUDIO_OFFLOAD_LOG(LogLevel::Error, ("open() error, can\'t derive mask for" + AUDIO_OFFLOAD_LOG(PR_LOG_ERROR, ("open() error, can\'t derive mask for" " %d audio channels", aChannelCount)); return NO_INIT; } @@ -127,7 +127,7 @@ status_t AudioOutput::Open(uint32_t aSampleRate, mUid); if ((!t.get()) || (t->initCheck() != NO_ERROR)) { - AUDIO_OFFLOAD_LOG(LogLevel::Error, ("Unable to create audio track")); + AUDIO_OFFLOAD_LOG(PR_LOG_ERROR, ("Unable to create audio track")); delete newcbd; return NO_INIT; } @@ -141,7 +141,7 @@ status_t AudioOutput::Open(uint32_t aSampleRate, status_t AudioOutput::Start() { - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("%s", __PRETTY_FUNCTION__)); + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("%s", __PRETTY_FUNCTION__)); if (!mTrack.get()) { return NO_INIT; } @@ -151,7 +151,7 @@ status_t AudioOutput::Start() void AudioOutput::Stop() { - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("%s", __PRETTY_FUNCTION__)); + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("%s", __PRETTY_FUNCTION__)); if (mTrack.get()) { mTrack->stop(); } @@ -173,7 +173,7 @@ void AudioOutput::Pause() void AudioOutput::Close() { - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("%s", __PRETTY_FUNCTION__)); + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("%s", __PRETTY_FUNCTION__)); mTrack.clear(); delete mCallbackData; @@ -215,19 +215,19 @@ void AudioOutput::CallbackWrapper(int aEvent, void* aCookie, void* aInfo) } break; case AudioTrack::EVENT_STREAM_END: - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("Callback wrapper: EVENT_STREAM_END")); + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("Callback wrapper: EVENT_STREAM_END")); (*me->mCallback)(me, nullptr /* buffer */, 0 /* size */, me->mCallbackCookie, CB_EVENT_STREAM_END); break; case AudioTrack::EVENT_NEW_IAUDIOTRACK : - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("Callback wrapper: EVENT_TEAR_DOWN")); + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("Callback wrapper: EVENT_TEAR_DOWN")); (*me->mCallback)(me, nullptr /* buffer */, 0 /* size */, me->mCallbackCookie, CB_EVENT_TEAR_DOWN); break; default: - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("received unknown event type: %d in" + AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("received unknown event type: %d in" " Callback wrapper!", aEvent)); break; } diff --git a/dom/media/omx/I420ColorConverterHelper.cpp b/dom/media/omx/I420ColorConverterHelper.cpp index 8afcbc4cb073..a16ee4fb4d28 100644 --- a/dom/media/omx/I420ColorConverterHelper.cpp +++ b/dom/media/omx/I420ColorConverterHelper.cpp @@ -11,7 +11,7 @@ #include "mozilla/Logging.h" PRLogModuleInfo *gI420ColorConverterHelperLog; -#define LOG(msg...) MOZ_LOG(gI420ColorConverterHelperLog, mozilla::LogLevel::Warning, (msg)) +#define LOG(msg...) MOZ_LOG(gI420ColorConverterHelperLog, PR_LOG_WARNING, (msg)) namespace android { diff --git a/dom/media/omx/MediaOmxCommonDecoder.cpp b/dom/media/omx/MediaOmxCommonDecoder.cpp index 0c721bc10b67..92b1130d4a89 100644 --- a/dom/media/omx/MediaOmxCommonDecoder.cpp +++ b/dom/media/omx/MediaOmxCommonDecoder.cpp @@ -65,7 +65,7 @@ MediaOmxCommonDecoder::FirstFrameLoaded(nsAutoPtr aInfo, ReentrantMonitorAutoEnter mon(GetReentrantMonitor()); if (!CheckDecoderCanOffloadAudio()) { - DECODER_LOG(LogLevel::Debug, ("In %s Offload Audio check failed", + DECODER_LOG(PR_LOG_DEBUG, ("In %s Offload Audio check failed", __PRETTY_FUNCTION__)); return; } @@ -82,7 +82,7 @@ MediaOmxCommonDecoder::FirstFrameLoaded(nsAutoPtr aInfo, if (err != OK) { mAudioOffloadPlayer = nullptr; mFallbackToStateMachine = true; - DECODER_LOG(LogLevel::Debug, ("In %s Unable to start offload audio %d." + DECODER_LOG(PR_LOG_DEBUG, ("In %s Unable to start offload audio %d." "Switching to normal mode", __PRETTY_FUNCTION__, err)); return; } @@ -105,7 +105,7 @@ MediaOmxCommonDecoder::PauseStateMachine() { MOZ_ASSERT(NS_IsMainThread()); GetReentrantMonitor().AssertCurrentThreadIn(); - DECODER_LOG(LogLevel::Debug, ("%s", __PRETTY_FUNCTION__)); + DECODER_LOG(PR_LOG_DEBUG, ("%s", __PRETTY_FUNCTION__)); if (mShuttingDown) { return; @@ -128,7 +128,7 @@ MediaOmxCommonDecoder::ResumeStateMachine() { MOZ_ASSERT(NS_IsMainThread()); ReentrantMonitorAutoEnter mon(GetReentrantMonitor()); - DECODER_LOG(LogLevel::Debug, ("%s current time %f", __PRETTY_FUNCTION__, mLogicalPosition)); + DECODER_LOG(PR_LOG_DEBUG, ("%s current time %f", __PRETTY_FUNCTION__, mLogicalPosition)); if (mShuttingDown) { return; @@ -167,7 +167,7 @@ void MediaOmxCommonDecoder::AudioOffloadTearDown() { MOZ_ASSERT(NS_IsMainThread()); - DECODER_LOG(LogLevel::Debug, ("%s", __PRETTY_FUNCTION__)); + DECODER_LOG(PR_LOG_DEBUG, ("%s", __PRETTY_FUNCTION__)); // mAudioOffloadPlayer can be null here if ResumeStateMachine was called // just before because of some other error. diff --git a/dom/media/omx/MediaOmxCommonReader.cpp b/dom/media/omx/MediaOmxCommonReader.cpp index ce4d6d0ae32b..d23f75ec5120 100644 --- a/dom/media/omx/MediaOmxCommonReader.cpp +++ b/dom/media/omx/MediaOmxCommonReader.cpp @@ -60,13 +60,13 @@ void MediaOmxCommonReader::CheckAudioOffload() // aren't supported and also duration would be less than a minute bool isTypeMusic = mAudioChannel == dom::AudioChannel::Content; - DECODER_LOG(LogLevel::Debug, ("%s meta %p, no video %d, no streaming %d," + DECODER_LOG(PR_LOG_DEBUG, ("%s meta %p, no video %d, no streaming %d," " channel type %d", __FUNCTION__, meta.get(), hasNoVideo, isNotStreaming, mAudioChannel)); if ((meta.get()) && hasNoVideo && isNotStreaming && isTypeMusic && canOffloadStream(meta, false, false, AUDIO_STREAM_MUSIC)) { - DECODER_LOG(LogLevel::Debug, ("Can offload this audio stream")); + DECODER_LOG(PR_LOG_DEBUG, ("Can offload this audio stream")); mDecoder->SetPlatformCanOffloadAudio(true); } } diff --git a/dom/media/omx/OmxDecoder.cpp b/dom/media/omx/OmxDecoder.cpp index fdad289abe05..cd41caf48bc4 100644 --- a/dom/media/omx/OmxDecoder.cpp +++ b/dom/media/omx/OmxDecoder.cpp @@ -440,7 +440,7 @@ bool OmxDecoder::SetVideoFormat() { NS_WARNING("rotation not available, assuming 0"); } - LOG(LogLevel::Debug, "display width: %d display height %d width: %d height: %d component: %s format: %d stride: %d sliceHeight: %d rotation: %d", + LOG(PR_LOG_DEBUG, "display width: %d display height %d width: %d height: %d component: %s format: %d stride: %d sliceHeight: %d rotation: %d", mDisplayWidth, mDisplayHeight, mVideoWidth, mVideoHeight, componentName, mVideoColorFormat, mVideoStride, mVideoSliceHeight, mVideoRotation); @@ -454,7 +454,7 @@ bool OmxDecoder::SetAudioFormat() { return false; } - LOG(LogLevel::Debug, "channelCount: %d sampleRate: %d", + LOG(PR_LOG_DEBUG, "channelCount: %d sampleRate: %d", mAudioChannels, mAudioSampleRate); return true; @@ -535,7 +535,7 @@ bool OmxDecoder::ToVideoFrame(VideoFrame *aFrame, int64_t aTimeUs, void *aData, SemiPlanarYVU420Frame(aFrame, aTimeUs, aData, aSize, aKeyFrame); break; default: - LOG(LogLevel::Debug, "Unknown video color format %08x", mVideoColorFormat); + LOG(PR_LOG_DEBUG, "Unknown video color format %08x", mVideoColorFormat); return false; } return true; @@ -668,7 +668,7 @@ bool OmxDecoder::ReadVideo(VideoFrame *aFrame, int64_t aTimeUs, char *data = static_cast(mVideoBuffer->data()) + mVideoBuffer->range_offset(); if (unreadable) { - LOG(LogLevel::Debug, "video frame is unreadable"); + LOG(PR_LOG_DEBUG, "video frame is unreadable"); } if (!ToVideoFrame(aFrame, timeUs, data, length, keyFrame)) { @@ -692,13 +692,13 @@ bool OmxDecoder::ReadVideo(VideoFrame *aFrame, int64_t aTimeUs, return false; } else if (err == -ETIMEDOUT) { - LOG(LogLevel::Debug, "OmxDecoder::ReadVideo timed out, will retry"); + LOG(PR_LOG_DEBUG, "OmxDecoder::ReadVideo timed out, will retry"); return true; } else { // UNKNOWN_ERROR is sometimes is used to mean "out of memory", but // regardless, don't keep trying to decode if the decoder doesn't want to. - LOG(LogLevel::Debug, "OmxDecoder::ReadVideo failed, err=%d", err); + LOG(PR_LOG_DEBUG, "OmxDecoder::ReadVideo failed, err=%d", err); return false; } @@ -753,11 +753,11 @@ bool OmxDecoder::ReadAudio(AudioFrame *aFrame, int64_t aSeekTimeUs) } } else if (err == -ETIMEDOUT) { - LOG(LogLevel::Debug, "OmxDecoder::ReadAudio timed out, will retry"); + LOG(PR_LOG_DEBUG, "OmxDecoder::ReadAudio timed out, will retry"); return true; } else if (err != OK) { - LOG(LogLevel::Debug, "OmxDecoder::ReadAudio failed, err=%d", err); + LOG(PR_LOG_DEBUG, "OmxDecoder::ReadAudio failed, err=%d", err); return false; } diff --git a/dom/media/platforms/apple/AppleATDecoder.cpp b/dom/media/platforms/apple/AppleATDecoder.cpp index 465d8c89ce77..5f71b14f8ab7 100644 --- a/dom/media/platforms/apple/AppleATDecoder.cpp +++ b/dom/media/platforms/apple/AppleATDecoder.cpp @@ -13,7 +13,7 @@ #include "mozilla/Logging.h" PRLogModuleInfo* GetAppleMediaLog(); -#define LOG(...) MOZ_LOG(GetAppleMediaLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define LOG(...) MOZ_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__)) #define FourCC2Str(n) ((char[5]){(char)(n >> 24), (char)(n >> 16), (char)(n >> 8), (char)(n), 0}) namespace mozilla { diff --git a/dom/media/platforms/apple/AppleCMLinker.cpp b/dom/media/platforms/apple/AppleCMLinker.cpp index 473c4439eea0..1476fe4c663a 100644 --- a/dom/media/platforms/apple/AppleCMLinker.cpp +++ b/dom/media/platforms/apple/AppleCMLinker.cpp @@ -13,7 +13,7 @@ #include "nsDebug.h" PRLogModuleInfo* GetAppleMediaLog(); -#define LOG(...) MOZ_LOG(GetAppleMediaLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define LOG(...) MOZ_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__)) namespace mozilla { diff --git a/dom/media/platforms/apple/AppleVDADecoder.cpp b/dom/media/platforms/apple/AppleVDADecoder.cpp index f0059252afde..83a794d23cd6 100644 --- a/dom/media/platforms/apple/AppleVDADecoder.cpp +++ b/dom/media/platforms/apple/AppleVDADecoder.cpp @@ -24,7 +24,7 @@ #include "gfxPlatform.h" PRLogModuleInfo* GetAppleMediaLog(); -#define LOG(...) MOZ_LOG(GetAppleMediaLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define LOG(...) MOZ_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__)) //#define LOG_MEDIA_SHA1 namespace mozilla { diff --git a/dom/media/platforms/apple/AppleVDALinker.cpp b/dom/media/platforms/apple/AppleVDALinker.cpp index c89c4adbd275..d97565104414 100644 --- a/dom/media/platforms/apple/AppleVDALinker.cpp +++ b/dom/media/platforms/apple/AppleVDALinker.cpp @@ -11,7 +11,7 @@ #include "nsDebug.h" PRLogModuleInfo* GetAppleMediaLog(); -#define LOG(...) MOZ_LOG(GetAppleMediaLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define LOG(...) MOZ_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__)) namespace mozilla { diff --git a/dom/media/platforms/apple/AppleVTDecoder.cpp b/dom/media/platforms/apple/AppleVTDecoder.cpp index 59df489aa4db..0936df45fe94 100644 --- a/dom/media/platforms/apple/AppleVTDecoder.cpp +++ b/dom/media/platforms/apple/AppleVTDecoder.cpp @@ -21,7 +21,7 @@ #include "gfxPlatform.h" PRLogModuleInfo* GetAppleMediaLog(); -#define LOG(...) MOZ_LOG(GetAppleMediaLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define LOG(...) MOZ_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__)) //#define LOG_MEDIA_SHA1 #ifdef LOG_MEDIA_SHA1 diff --git a/dom/media/platforms/apple/AppleVTLinker.cpp b/dom/media/platforms/apple/AppleVTLinker.cpp index 63ef392c1f59..501bafdc70cf 100644 --- a/dom/media/platforms/apple/AppleVTLinker.cpp +++ b/dom/media/platforms/apple/AppleVTLinker.cpp @@ -12,7 +12,7 @@ #include "nsDebug.h" PRLogModuleInfo* GetAppleMediaLog(); -#define LOG(...) MOZ_LOG(GetAppleMediaLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define LOG(...) MOZ_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__)) namespace mozilla { diff --git a/dom/media/platforms/ffmpeg/FFmpegLog.h b/dom/media/platforms/ffmpeg/FFmpegLog.h index 920ab3f053f3..d518f41614ca 100644 --- a/dom/media/platforms/ffmpeg/FFmpegLog.h +++ b/dom/media/platforms/ffmpeg/FFmpegLog.h @@ -8,6 +8,6 @@ #define __FFmpegLog_h__ extern PRLogModuleInfo* GetFFmpegDecoderLog(); -#define FFMPEG_LOG(...) MOZ_LOG(GetFFmpegDecoderLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define FFMPEG_LOG(...) MOZ_LOG(GetFFmpegDecoderLog(), PR_LOG_DEBUG, (__VA_ARGS__)) #endif // __FFmpegLog_h__ diff --git a/dom/media/platforms/gonk/GonkAudioDecoderManager.cpp b/dom/media/platforms/gonk/GonkAudioDecoderManager.cpp index b873e7f92187..d48780ac575a 100644 --- a/dom/media/platforms/gonk/GonkAudioDecoderManager.cpp +++ b/dom/media/platforms/gonk/GonkAudioDecoderManager.cpp @@ -26,7 +26,7 @@ #define GADM_LOG(...) __android_log_print(ANDROID_LOG_DEBUG, "GonkAudioDecoderManager", __VA_ARGS__) PRLogModuleInfo* GetDemuxerLog(); -#define LOG(...) MOZ_LOG(GetDemuxerLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define LOG(...) MOZ_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__)) #define READ_OUTPUT_BUFFER_TIMEOUT_US 3000 using namespace android; diff --git a/dom/media/platforms/gonk/GonkMediaDataDecoder.cpp b/dom/media/platforms/gonk/GonkMediaDataDecoder.cpp index 6c478414d015..b06bd34d3d42 100644 --- a/dom/media/platforms/gonk/GonkMediaDataDecoder.cpp +++ b/dom/media/platforms/gonk/GonkMediaDataDecoder.cpp @@ -14,7 +14,7 @@ #define GMDD_LOG(...) __android_log_print(ANDROID_LOG_DEBUG, "GonkMediaDataDecoder", __VA_ARGS__) PRLogModuleInfo* GetDemuxerLog(); -#define LOG(...) MOZ_LOG(GetDemuxerLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define LOG(...) MOZ_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__)) using namespace android; diff --git a/dom/media/platforms/gonk/GonkVideoDecoderManager.cpp b/dom/media/platforms/gonk/GonkVideoDecoderManager.cpp index b0916c3c2eb4..13875aa45ee5 100644 --- a/dom/media/platforms/gonk/GonkVideoDecoderManager.cpp +++ b/dom/media/platforms/gonk/GonkVideoDecoderManager.cpp @@ -32,7 +32,7 @@ #define GVDM_LOG(...) __android_log_print(ANDROID_LOG_DEBUG, "GonkVideoDecoderManager", __VA_ARGS__) PRLogModuleInfo* GetDemuxerLog(); -#define LOG(...) MOZ_LOG(GetDemuxerLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define LOG(...) MOZ_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__)) using namespace mozilla::layers; using namespace android; typedef android::MediaCodecProxy MediaCodecProxy; diff --git a/dom/media/platforms/wmf/MFTDecoder.cpp b/dom/media/platforms/wmf/MFTDecoder.cpp index 9a3a6f4ba329..5fac9fdba1f4 100644 --- a/dom/media/platforms/wmf/MFTDecoder.cpp +++ b/dom/media/platforms/wmf/MFTDecoder.cpp @@ -10,7 +10,7 @@ #include "mozilla/Logging.h" PRLogModuleInfo* GetDemuxerLog(); -#define LOG(...) MOZ_LOG(GetDemuxerLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define LOG(...) MOZ_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__)) namespace mozilla { diff --git a/dom/media/platforms/wmf/WMFAudioMFTManager.cpp b/dom/media/platforms/wmf/WMFAudioMFTManager.cpp index 4f0b88ec7348..9968a68fe698 100644 --- a/dom/media/platforms/wmf/WMFAudioMFTManager.cpp +++ b/dom/media/platforms/wmf/WMFAudioMFTManager.cpp @@ -13,7 +13,7 @@ #include "mozilla/Logging.h" PRLogModuleInfo* GetDemuxerLog(); -#define LOG(...) MOZ_LOG(GetDemuxerLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define LOG(...) MOZ_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__)) namespace mozilla { diff --git a/dom/media/platforms/wmf/WMFMediaDataDecoder.cpp b/dom/media/platforms/wmf/WMFMediaDataDecoder.cpp index 0927d3876d36..52c0328c42b9 100644 --- a/dom/media/platforms/wmf/WMFMediaDataDecoder.cpp +++ b/dom/media/platforms/wmf/WMFMediaDataDecoder.cpp @@ -13,7 +13,7 @@ #include "mozilla/Logging.h" PRLogModuleInfo* GetDemuxerLog(); -#define LOG(...) MOZ_LOG(GetDemuxerLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define LOG(...) MOZ_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__)) namespace mozilla { diff --git a/dom/media/platforms/wmf/WMFVideoMFTManager.cpp b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp index 6b459297a98b..d50e0d7a749d 100644 --- a/dom/media/platforms/wmf/WMFVideoMFTManager.cpp +++ b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp @@ -22,7 +22,7 @@ #include "mozilla/WindowsVersion.h" PRLogModuleInfo* GetDemuxerLog(); -#define LOG(...) MOZ_LOG(GetDemuxerLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define LOG(...) MOZ_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__)) using mozilla::layers::Image; using mozilla::layers::IMFYCbCrImage; diff --git a/dom/media/systemservices/LoadManager.cpp b/dom/media/systemservices/LoadManager.cpp index cbafae34ddc8..e294625dc893 100644 --- a/dom/media/systemservices/LoadManager.cpp +++ b/dom/media/systemservices/LoadManager.cpp @@ -21,8 +21,8 @@ PRLogModuleInfo *gLoadManagerLog = nullptr; #undef LOG #undef LOG_ENABLED -#define LOG(args) MOZ_LOG(gLoadManagerLog, mozilla::LogLevel::Debug, args) -#define LOG_ENABLED() MOZ_LOG_TEST(gLoadManagerLog, mozilla::LogLevel::Verbose) +#define LOG(args) MOZ_LOG(gLoadManagerLog, PR_LOG_DEBUG, args) +#define LOG_ENABLED() PR_LOG_TEST(gLoadManagerLog, 5) namespace mozilla { diff --git a/dom/media/systemservices/LoadMonitor.cpp b/dom/media/systemservices/LoadMonitor.cpp index d5ba1174b7f1..ee6f4a7a79ed 100644 --- a/dom/media/systemservices/LoadMonitor.cpp +++ b/dom/media/systemservices/LoadMonitor.cpp @@ -56,9 +56,9 @@ // NSPR_LOG_MODULES=LoadManager:5 #undef LOG #undef LOG_ENABLED -#define LOG(args) MOZ_LOG(gLoadManagerLog, mozilla::LogLevel::Debug, args) -#define LOG_ENABLED() MOZ_LOG_TEST(gLoadManagerLog, mozilla::LogLevel::Debug) -#define LOG_MANY_ENABLED() MOZ_LOG_TEST(gLoadManagerLog, mozilla::LogLevel::Verbose) +#define LOG(args) MOZ_LOG(gLoadManagerLog, PR_LOG_DEBUG, args) +#define LOG_ENABLED() PR_LOG_TEST(gLoadManagerLog, 4) +#define LOG_MANY_ENABLED() PR_LOG_TEST(gLoadManagerLog, 5) namespace mozilla { diff --git a/dom/media/systemservices/MediaChild.cpp b/dom/media/systemservices/MediaChild.cpp index 49aecfba9c37..4e32578ff2b8 100644 --- a/dom/media/systemservices/MediaChild.cpp +++ b/dom/media/systemservices/MediaChild.cpp @@ -15,7 +15,7 @@ #undef LOG PRLogModuleInfo *gMediaChildLog; -#define LOG(args) MOZ_LOG(gMediaChildLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gMediaChildLog, PR_LOG_DEBUG, args) namespace mozilla { namespace media { diff --git a/dom/media/systemservices/MediaParent.cpp b/dom/media/systemservices/MediaParent.cpp index 9ce989f996c5..c5b20f19d881 100644 --- a/dom/media/systemservices/MediaParent.cpp +++ b/dom/media/systemservices/MediaParent.cpp @@ -21,7 +21,7 @@ #undef LOG PRLogModuleInfo *gMediaParentLog; -#define LOG(args) MOZ_LOG(gMediaParentLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gMediaParentLog, PR_LOG_DEBUG, args) // A file in the profile dir is used to persist mOriginKeys used to anonymize // deviceIds to be unique per origin, to avoid them being supercookies. diff --git a/dom/media/systemservices/OpenSLESProvider.cpp b/dom/media/systemservices/OpenSLESProvider.cpp index c15d71a22f78..f19e84e55420 100644 --- a/dom/media/systemservices/OpenSLESProvider.cpp +++ b/dom/media/systemservices/OpenSLESProvider.cpp @@ -15,8 +15,8 @@ #undef LOG #undef LOG_ENABLED PRLogModuleInfo *gOpenSLESProviderLog; -#define LOG(args) MOZ_LOG(gOpenSLESProviderLog, mozilla::LogLevel::Debug, args) -#define LOG_ENABLED() MOZ_LOG_TEST(gOpenSLESProviderLog, mozilla::LogLevel::Debug) +#define LOG(args) MOZ_LOG(gOpenSLESProviderLog, PR_LOG_DEBUG, args) +#define LOG_ENABLED() PR_LOG_TEST(gOpenSLESProviderLog, PR_LOG_DEBUG) namespace mozilla { diff --git a/dom/media/wave/WaveReader.cpp b/dom/media/wave/WaveReader.cpp index 40b82926ad6d..c790c88fe415 100644 --- a/dom/media/wave/WaveReader.cpp +++ b/dom/media/wave/WaveReader.cpp @@ -254,7 +254,7 @@ nsRefPtr WaveReader::Seek(int64_t aTarget, int64_t aEndTime) { MOZ_ASSERT(OnTaskQueue()); - LOG(LogLevel::Debug, ("%p About to seek to %lld", mDecoder, aTarget)); + LOG(PR_LOG_DEBUG, ("%p About to seek to %lld", mDecoder, aTarget)); if (NS_FAILED(ResetDecode())) { return SeekPromise::CreateAndReject(NS_ERROR_FAILURE, __func__); diff --git a/dom/media/webm/IntelWebMVideoDecoder.cpp b/dom/media/webm/IntelWebMVideoDecoder.cpp index 1da89eb0ef64..773079e15dd3 100644 --- a/dom/media/webm/IntelWebMVideoDecoder.cpp +++ b/dom/media/webm/IntelWebMVideoDecoder.cpp @@ -21,7 +21,7 @@ #undef LOG PRLogModuleInfo* GetDemuxerLog(); -#define LOG(...) MOZ_LOG(GetDemuxerLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define LOG(...) MOZ_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__)) using namespace mp4_demuxer; diff --git a/dom/media/webm/WebMReader.cpp b/dom/media/webm/WebMReader.cpp index 68f39edae065..7515dc452803 100644 --- a/dom/media/webm/WebMReader.cpp +++ b/dom/media/webm/WebMReader.cpp @@ -104,7 +104,7 @@ static void webm_log(nestegg * context, unsigned int severity, char const * format, ...) { - if (!MOZ_LOG_TEST(gNesteggLog, LogLevel::Debug)) { + if (!PR_LOG_TEST(gNesteggLog, PR_LOG_DEBUG)) { return; } @@ -137,7 +137,7 @@ static void webm_log(nestegg * context, PR_snprintf(msg, sizeof(msg), "%p [Nestegg-%s] ", context, sevStr); PR_vsnprintf(msg+strlen(msg), sizeof(msg)-strlen(msg), format, args); - MOZ_LOG(gNesteggLog, LogLevel::Debug, (msg)); + MOZ_LOG(gNesteggLog, PR_LOG_DEBUG, (msg)); va_end(args); } @@ -528,7 +528,7 @@ nsresult WebMReader::ReadMetadata(MediaInfo* aInfo, if (int64_t(mCodecDelay) != FramesToUsecs(mOpusParser->mPreSkip, mOpusParser->mRate).value()) { - LOG(LogLevel::Warning, + LOG(PR_LOG_WARNING, ("Invalid Opus header: CodecDelay and pre-skip do not match!")); Cleanup(); return NS_ERROR_FAILURE; @@ -613,7 +613,7 @@ bool WebMReader::DecodeAudioPacket(NesteggPacketHolder* aHolder) #ifdef DEBUG int64_t gap_frames = tstamp_frames.value() - decoded_frames.value(); CheckedInt64 usecs = FramesToUsecs(gap_frames, mInfo.mAudio.mRate); - LOG(LogLevel::Debug, ("WebMReader detected gap of %lld, %lld frames, in audio", + LOG(PR_LOG_DEBUG, ("WebMReader detected gap of %lld, %lld frames, in audio", usecs.isValid() ? usecs.value() : -1, gap_frames)); #endif @@ -732,7 +732,7 @@ bool WebMReader::DecodeOpus(const unsigned char* aData, size_t aLength, if (mPaddingDiscarded) { // Discard padding should be used only on the final packet, so // decoding after a padding discard is invalid. - LOG(LogLevel::Debug, ("Opus error, discard padding on interstitial packet")); + LOG(PR_LOG_DEBUG, ("Opus error, discard padding on interstitial packet")); mHitAudioDecodeError = true; return false; } @@ -772,7 +772,7 @@ bool WebMReader::DecodeOpus(const unsigned char* aData, size_t aLength, if (mSkip > 0) { int32_t skipFrames = std::min(mSkip, frames); int32_t keepFrames = frames - skipFrames; - LOG(LogLevel::Debug, ("Opus decoder skipping %d of %d frames", + LOG(PR_LOG_DEBUG, ("Opus decoder skipping %d of %d frames", skipFrames, frames)); PodMove(buffer.get(), buffer.get() + skipFrames * channels, @@ -786,7 +786,7 @@ bool WebMReader::DecodeOpus(const unsigned char* aData, size_t aLength, (void) nestegg_packet_discard_padding(aPacket, &discardPadding); if (discardPadding < 0) { // Negative discard padding is invalid. - LOG(LogLevel::Debug, ("Opus error, negative discard padding")); + LOG(PR_LOG_DEBUG, ("Opus error, negative discard padding")); mHitAudioDecodeError = true; } if (discardPadding > 0) { @@ -798,11 +798,11 @@ bool WebMReader::DecodeOpus(const unsigned char* aData, size_t aLength, } if (discardFrames.value() > frames) { // Discarding more than the entire packet is invalid. - LOG(LogLevel::Debug, ("Opus error, discard padding larger than packet")); + LOG(PR_LOG_DEBUG, ("Opus error, discard padding larger than packet")); mHitAudioDecodeError = true; return false; } - LOG(LogLevel::Debug, ("Opus decoder discarding %d of %d frames", + LOG(PR_LOG_DEBUG, ("Opus decoder discarding %d of %d frames", int32_t(discardFrames.value()), frames)); // Padding discard is only supposed to happen on the final packet. // Record the discard so we can return an error if another packet is @@ -1042,7 +1042,7 @@ bool WebMReader::ShouldSkipVideoFrame(int64_t aTimeThreshold) bool WebMReader::DecodeVideoFrame(bool &aKeyframeSkip, int64_t aTimeThreshold) { if (!(aKeyframeSkip && ShouldSkipVideoFrame(aTimeThreshold))) { - LOG(LogLevel::Verbose, ("Reader [%p]: set the aKeyframeSkip to false.",this)); + LOG(PR_LOG_DEBUG+1, ("Reader [%p]: set the aKeyframeSkip to false.",this)); aKeyframeSkip = false; } return mVideoDecoder->DecodeVideoFrame(aKeyframeSkip, aTimeThreshold); @@ -1072,7 +1072,7 @@ nsresult WebMReader::SeekInternal(int64_t aTarget) NS_ENSURE_SUCCESS(rv, rv); } - LOG(LogLevel::Debug, ("Reader [%p] for Decoder [%p]: About to seek to %fs", + LOG(PR_LOG_DEBUG, ("Reader [%p] for Decoder [%p]: About to seek to %fs", this, mDecoder, double(aTarget) / USECS_PER_S)); if (NS_FAILED(ResetDecode())) { return NS_ERROR_FAILURE; @@ -1086,7 +1086,7 @@ nsresult WebMReader::SeekInternal(int64_t aTarget) } int r = nestegg_track_seek(mContext, trackToSeek, target); if (r != 0) { - LOG(LogLevel::Debug, ("Reader [%p]: track_seek for track %u failed, r=%d", + LOG(PR_LOG_DEBUG, ("Reader [%p]: track_seek for track %u failed, r=%d", this, trackToSeek, r)); // Try seeking directly based on cluster information in memory. @@ -1097,7 +1097,7 @@ nsresult WebMReader::SeekInternal(int64_t aTarget) } r = nestegg_offset_seek(mContext, offset); - LOG(LogLevel::Debug, ("Reader [%p]: attempted offset_seek to %lld r=%d", + LOG(PR_LOG_DEBUG, ("Reader [%p]: attempted offset_seek to %lld r=%d", this, offset, r)); if (r != 0) { return NS_ERROR_FAILURE; diff --git a/dom/media/webrtc/MediaEngineCameraVideoSource.cpp b/dom/media/webrtc/MediaEngineCameraVideoSource.cpp index 8226ba727dd4..046e192f2d04 100644 --- a/dom/media/webrtc/MediaEngineCameraVideoSource.cpp +++ b/dom/media/webrtc/MediaEngineCameraVideoSource.cpp @@ -16,8 +16,8 @@ using dom::ConstrainDoubleRange; using dom::MediaTrackConstraintSet; extern PRLogModuleInfo* GetMediaManagerLog(); -#define LOG(msg) MOZ_LOG(GetMediaManagerLog(), mozilla::LogLevel::Debug, msg) -#define LOGFRAME(msg) MOZ_LOG(GetMediaManagerLog(), mozilla::LogLevel::Verbose, msg) +#define LOG(msg) MOZ_LOG(GetMediaManagerLog(), PR_LOG_DEBUG, msg) +#define LOGFRAME(msg) MOZ_LOG(GetMediaManagerLog(), 6, msg) // guts for appending data to the MSG track bool MediaEngineCameraVideoSource::AppendToTrack(SourceMediaStream* aSource, @@ -218,7 +218,7 @@ MediaEngineCameraVideoSource::ChooseCapability( const dom::MediaTrackConstraints &aConstraints, const MediaEnginePrefs &aPrefs) { - if (MOZ_LOG_TEST(GetMediaManagerLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetMediaManagerLog(), PR_LOG_DEBUG)) { LOG(("ChooseCapability: prefs: %dx%d @%d-%dfps", aPrefs.GetWidth(), aPrefs.GetHeight(), aPrefs.mFPS, aPrefs.mMinFPS)); diff --git a/dom/media/webrtc/MediaEngineGonkVideoSource.cpp b/dom/media/webrtc/MediaEngineGonkVideoSource.cpp index 29693cdbfc2c..e2abcaff99ca 100644 --- a/dom/media/webrtc/MediaEngineGonkVideoSource.cpp +++ b/dom/media/webrtc/MediaEngineGonkVideoSource.cpp @@ -26,8 +26,8 @@ using namespace android; #undef LOG extern PRLogModuleInfo* GetMediaManagerLog(); -#define LOG(msg) MOZ_LOG(GetMediaManagerLog(), mozilla::LogLevel::Debug, msg) -#define LOGFRAME(msg) MOZ_LOG(GetMediaManagerLog(), mozilla::LogLevel::Verbose, msg) +#define LOG(msg) MOZ_LOG(GetMediaManagerLog(), PR_LOG_DEBUG, msg) +#define LOGFRAME(msg) MOZ_LOG(GetMediaManagerLog(), 6, msg) class MediaBufferListener : public GonkCameraSource::DirectBufferListener { public: diff --git a/dom/media/webrtc/MediaEngineWebRTC.cpp b/dom/media/webrtc/MediaEngineWebRTC.cpp index 8771ef79af7c..5a1cab054eed 100644 --- a/dom/media/webrtc/MediaEngineWebRTC.cpp +++ b/dom/media/webrtc/MediaEngineWebRTC.cpp @@ -8,8 +8,6 @@ #include "CSFLog.h" #include "prenv.h" -#include "mozilla/Logging.h" - static PRLogModuleInfo* GetUserMediaLog() { @@ -37,7 +35,7 @@ GetUserMediaLog() #endif #undef LOG -#define LOG(args) MOZ_LOG(GetUserMediaLog(), mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(GetUserMediaLog(), PR_LOG_DEBUG, args) namespace mozilla { diff --git a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp index 2dd504375e78..5b3cc1a993a5 100644 --- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp +++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp @@ -37,8 +37,8 @@ namespace mozilla { #endif extern PRLogModuleInfo* GetMediaManagerLog(); -#define LOG(msg) MOZ_LOG(GetMediaManagerLog(), mozilla::LogLevel::Debug, msg) -#define LOG_FRAMES(msg) MOZ_LOG(GetMediaManagerLog(), mozilla::LogLevel::Verbose, msg) +#define LOG(msg) MOZ_LOG(GetMediaManagerLog(), PR_LOG_DEBUG, msg) +#define LOG_FRAMES(msg) MOZ_LOG(GetMediaManagerLog(), 6, msg) /** * Webrtc audio source. @@ -275,7 +275,7 @@ MediaEngineWebRTCAudioSource::Allocate(const dom::MediaTrackConstraints &aConstr LOG(("Audio device is not initalized")); return NS_ERROR_FAILURE; } - } else if (MOZ_LOG_TEST(GetMediaManagerLog(), LogLevel::Debug)) { + } else if (PR_LOG_TEST(GetMediaManagerLog(), PR_LOG_DEBUG)) { MonitorAutoLock lock(mMonitor); if (mSources.IsEmpty()) { LOG(("Audio device %d reallocated", mCapIndex)); diff --git a/dom/media/webrtc/MediaEngineWebRTCVideo.cpp b/dom/media/webrtc/MediaEngineWebRTCVideo.cpp index de5b00c02773..1d2d1b6150d5 100644 --- a/dom/media/webrtc/MediaEngineWebRTCVideo.cpp +++ b/dom/media/webrtc/MediaEngineWebRTCVideo.cpp @@ -19,8 +19,8 @@ using dom::ConstrainDoubleRange; using dom::MediaTrackConstraintSet; extern PRLogModuleInfo* GetMediaManagerLog(); -#define LOG(msg) MOZ_LOG(GetMediaManagerLog(), mozilla::LogLevel::Debug, msg) -#define LOGFRAME(msg) MOZ_LOG(GetMediaManagerLog(), mozilla::LogLevel::Verbose, msg) +#define LOG(msg) MOZ_LOG(GetMediaManagerLog(), PR_LOG_DEBUG, msg) +#define LOGFRAME(msg) MOZ_LOG(GetMediaManagerLog(), 6, msg) /** * Webrtc video source. @@ -227,7 +227,7 @@ MediaEngineWebRTCVideoSource::Allocate(const dom::MediaTrackConstraints &aConstr } mState = kAllocated; LOG(("Video device %d allocated", mCaptureIndex)); - } else if (MOZ_LOG_TEST(GetMediaManagerLog(), LogLevel::Debug)) { + } else if (PR_LOG_TEST(GetMediaManagerLog(), PR_LOG_DEBUG)) { MonitorAutoLock lock(mMonitor); if (mSources.IsEmpty()) { LOG(("Video device %d reallocated", mCaptureIndex)); diff --git a/dom/media/webspeech/recognition/SpeechRecognition.cpp b/dom/media/webspeech/recognition/SpeechRecognition.cpp index 2001e2e9ae91..0666153d999a 100644 --- a/dom/media/webspeech/recognition/SpeechRecognition.cpp +++ b/dom/media/webspeech/recognition/SpeechRecognition.cpp @@ -58,7 +58,7 @@ GetSpeechRecognitionLog() return sLog; } -#define SR_LOG(...) MOZ_LOG(GetSpeechRecognitionLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define SR_LOG(...) MOZ_LOG(GetSpeechRecognitionLog(), PR_LOG_DEBUG, (__VA_ARGS__)) already_AddRefed GetSpeechRecognitionService() diff --git a/dom/media/webspeech/recognition/SpeechRecognition.h b/dom/media/webspeech/recognition/SpeechRecognition.h index 7f43493087b6..4079d31ffadd 100644 --- a/dom/media/webspeech/recognition/SpeechRecognition.h +++ b/dom/media/webspeech/recognition/SpeechRecognition.h @@ -45,7 +45,7 @@ class GlobalObject; class SpeechEvent; PRLogModuleInfo* GetSpeechRecognitionLog(); -#define SR_LOG(...) MOZ_LOG(GetSpeechRecognitionLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define SR_LOG(...) MOZ_LOG(GetSpeechRecognitionLog(), PR_LOG_DEBUG, (__VA_ARGS__)) already_AddRefed GetSpeechRecognitionService(); diff --git a/dom/media/webspeech/synth/SpeechSynthesis.cpp b/dom/media/webspeech/synth/SpeechSynthesis.cpp index 156a8cf6f5ce..e039a7a2e762 100644 --- a/dom/media/webspeech/synth/SpeechSynthesis.cpp +++ b/dom/media/webspeech/synth/SpeechSynthesis.cpp @@ -145,7 +145,7 @@ SpeechSynthesis::Speak(SpeechSynthesisUtterance& aUtterance) void SpeechSynthesis::AdvanceQueue() { - LOG(LogLevel::Debug, + LOG(PR_LOG_DEBUG, ("SpeechSynthesis::AdvanceQueue length=%d", mSpeechQueue.Length())); if (mSpeechQueue.IsEmpty()) { diff --git a/dom/media/webspeech/synth/nsSpeechTask.cpp b/dom/media/webspeech/synth/nsSpeechTask.cpp index 1182ea537b86..c6e73845b1c6 100644 --- a/dom/media/webspeech/synth/nsSpeechTask.cpp +++ b/dom/media/webspeech/synth/nsSpeechTask.cpp @@ -114,7 +114,7 @@ nsSpeechTask::nsSpeechTask(float aVolume, const nsAString& aText) nsSpeechTask::~nsSpeechTask() { - LOG(LogLevel::Debug, ("~nsSpeechTask")); + LOG(PR_LOG_DEBUG, ("~nsSpeechTask")); if (mStream) { if (!mStream->IsDestroyed()) { mStream->Destroy(); @@ -148,7 +148,7 @@ nsSpeechTask::Setup(nsISpeechTaskCallback* aCallback, { MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default); - LOG(LogLevel::Debug, ("nsSpeechTask::Setup")); + LOG(PR_LOG_DEBUG, ("nsSpeechTask::Setup")); mCallback = aCallback; @@ -290,7 +290,7 @@ nsSpeechTask::DispatchStartImpl() nsresult nsSpeechTask::DispatchStartImpl(const nsAString& aUri) { - LOG(LogLevel::Debug, ("nsSpeechTask::DispatchStart")); + LOG(PR_LOG_DEBUG, ("nsSpeechTask::DispatchStart")); MOZ_ASSERT(mUtterance); NS_ENSURE_TRUE(mUtterance->mState == SpeechSynthesisUtterance::STATE_PENDING, @@ -318,7 +318,7 @@ nsSpeechTask::DispatchEnd(float aElapsedTime, uint32_t aCharIndex) nsresult nsSpeechTask::DispatchEndImpl(float aElapsedTime, uint32_t aCharIndex) { - LOG(LogLevel::Debug, ("nsSpeechTask::DispatchEnd\n")); + LOG(PR_LOG_DEBUG, ("nsSpeechTask::DispatchEnd\n")); MOZ_ASSERT(mUtterance); NS_ENSURE_FALSE(mUtterance->mState == SpeechSynthesisUtterance::STATE_ENDED, @@ -361,7 +361,7 @@ nsSpeechTask::DispatchPause(float aElapsedTime, uint32_t aCharIndex) nsresult nsSpeechTask::DispatchPauseImpl(float aElapsedTime, uint32_t aCharIndex) { - LOG(LogLevel::Debug, ("nsSpeechTask::DispatchPause")); + LOG(PR_LOG_DEBUG, ("nsSpeechTask::DispatchPause")); MOZ_ASSERT(mUtterance); NS_ENSURE_FALSE(mUtterance->mPaused, NS_ERROR_NOT_AVAILABLE); NS_ENSURE_FALSE(mUtterance->mState == SpeechSynthesisUtterance::STATE_ENDED, @@ -388,7 +388,7 @@ nsSpeechTask::DispatchResume(float aElapsedTime, uint32_t aCharIndex) nsresult nsSpeechTask::DispatchResumeImpl(float aElapsedTime, uint32_t aCharIndex) { - LOG(LogLevel::Debug, ("nsSpeechTask::DispatchResume")); + LOG(PR_LOG_DEBUG, ("nsSpeechTask::DispatchResume")); MOZ_ASSERT(mUtterance); NS_ENSURE_TRUE(mUtterance->mPaused, NS_ERROR_NOT_AVAILABLE); NS_ENSURE_FALSE(mUtterance->mState == SpeechSynthesisUtterance::STATE_ENDED, @@ -515,7 +515,7 @@ nsSpeechTask::Cancel() { MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default); - LOG(LogLevel::Debug, ("nsSpeechTask::Cancel")); + LOG(PR_LOG_DEBUG, ("nsSpeechTask::Cancel")); if (mCallback) { DebugOnly rv = mCallback->OnCancel(); diff --git a/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp b/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp index 4cea67bd8fd9..1c78a8857ec3 100644 --- a/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp +++ b/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp @@ -125,7 +125,7 @@ nsSynthVoiceRegistry::nsSynthVoiceRegistry() nsSynthVoiceRegistry::~nsSynthVoiceRegistry() { - LOG(LogLevel::Debug, ("~nsSynthVoiceRegistry")); + LOG(PR_LOG_DEBUG, ("~nsSynthVoiceRegistry")); // mSpeechSynthChild's lifecycle is managed by the Content protocol. mSpeechSynthChild = nullptr; @@ -164,7 +164,7 @@ nsSynthVoiceRegistry::GetInstanceForService() void nsSynthVoiceRegistry::Shutdown() { - LOG(LogLevel::Debug, ("[%s] nsSynthVoiceRegistry::Shutdown()", + LOG(PR_LOG_DEBUG, ("[%s] nsSynthVoiceRegistry::Shutdown()", (XRE_GetProcessType() == GeckoProcessType_Content) ? "Content" : "Default")); gSynthVoiceRegistry = nullptr; } @@ -230,7 +230,7 @@ nsSynthVoiceRegistry::AddVoice(nsISpeechService* aService, const nsAString& aLang, bool aLocalService) { - LOG(LogLevel::Debug, + LOG(PR_LOG_DEBUG, ("nsSynthVoiceRegistry::AddVoice uri='%s' name='%s' lang='%s' local=%s", NS_ConvertUTF16toUTF8(aUri).get(), NS_ConvertUTF16toUTF8(aName).get(), NS_ConvertUTF16toUTF8(aLang).get(), @@ -247,7 +247,7 @@ NS_IMETHODIMP nsSynthVoiceRegistry::RemoveVoice(nsISpeechService* aService, const nsAString& aUri) { - LOG(LogLevel::Debug, + LOG(PR_LOG_DEBUG, ("nsSynthVoiceRegistry::RemoveVoice uri='%s' (%s)", NS_ConvertUTF16toUTF8(aUri).get(), (XRE_GetProcessType() == GeckoProcessType_Content) ? "child" : "parent")); @@ -281,7 +281,7 @@ nsSynthVoiceRegistry::SetDefaultVoice(const nsAString& aUri, mDefaultVoices.RemoveElement(retval); - LOG(LogLevel::Debug, ("nsSynthVoiceRegistry::SetDefaultVoice %s %s", + LOG(PR_LOG_DEBUG, ("nsSynthVoiceRegistry::SetDefaultVoice %s %s", NS_ConvertUTF16toUTF8(aUri).get(), aIsDefault ? "true" : "false")); @@ -458,14 +458,14 @@ nsSynthVoiceRegistry::FindBestMatch(const nsAString& aUri, VoiceData* retval = mUriVoiceMap.GetWeak(aUri, &found); if (found) { - LOG(LogLevel::Debug, ("nsSynthVoiceRegistry::FindBestMatch - Matched URI")); + LOG(PR_LOG_DEBUG, ("nsSynthVoiceRegistry::FindBestMatch - Matched URI")); return retval; } // Try finding a match for given voice. if (!aLang.IsVoid() && !aLang.IsEmpty()) { if (FindVoiceByLang(aLang, &retval)) { - LOG(LogLevel::Debug, + LOG(PR_LOG_DEBUG, ("nsSynthVoiceRegistry::FindBestMatch - Matched language (%s ~= %s)", NS_ConvertUTF16toUTF8(aLang).get(), NS_ConvertUTF16toUTF8(retval->mLang).get())); @@ -484,7 +484,7 @@ nsSynthVoiceRegistry::FindBestMatch(const nsAString& aUri, NS_ENSURE_SUCCESS(rv, nullptr); if (FindVoiceByLang(uiLang, &retval)) { - LOG(LogLevel::Debug, + LOG(PR_LOG_DEBUG, ("nsSynthVoiceRegistry::FindBestMatch - Matched UI language (%s ~= %s)", NS_ConvertUTF16toUTF8(uiLang).get(), NS_ConvertUTF16toUTF8(retval->mLang).get())); @@ -494,7 +494,7 @@ nsSynthVoiceRegistry::FindBestMatch(const nsAString& aUri, // Try en-US, the language of locale "C" if (FindVoiceByLang(NS_LITERAL_STRING("en-US"), &retval)) { - LOG(LogLevel::Debug, + LOG(PR_LOG_DEBUG, ("nsSynthVoiceRegistry::FindBestMatch - Matched C locale language (en-US ~= %s)", NS_ConvertUTF16toUTF8(retval->mLang).get())); @@ -550,7 +550,7 @@ nsSynthVoiceRegistry::Speak(const nsAString& aText, const float& aPitch, nsSpeechTask* aTask) { - LOG(LogLevel::Debug, + LOG(PR_LOG_DEBUG, ("nsSynthVoiceRegistry::Speak text='%s' lang='%s' uri='%s' rate=%f pitch=%f", NS_ConvertUTF16toUTF8(aText).get(), NS_ConvertUTF16toUTF8(aLang).get(), NS_ConvertUTF16toUTF8(aUri).get(), aRate, aPitch)); @@ -565,7 +565,7 @@ nsSynthVoiceRegistry::Speak(const nsAString& aText, aTask->SetChosenVoiceURI(voice->mUri); - LOG(LogLevel::Debug, ("nsSynthVoiceRegistry::Speak - Using voice URI: %s", + LOG(PR_LOG_DEBUG, ("nsSynthVoiceRegistry::Speak - Using voice URI: %s", NS_ConvertUTF16toUTF8(voice->mUri).get())); SpeechServiceType serviceType; diff --git a/dom/media/wmf/WMFByteStream.cpp b/dom/media/wmf/WMFByteStream.cpp index 1fa3b311cba7..93e07c71be1b 100644 --- a/dom/media/wmf/WMFByteStream.cpp +++ b/dom/media/wmf/WMFByteStream.cpp @@ -26,7 +26,7 @@ namespace mozilla { PRLogModuleInfo* gWMFByteStreamLog = nullptr; -#define WMF_BS_LOG(...) MOZ_LOG(gWMFByteStreamLog, mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define WMF_BS_LOG(...) MOZ_LOG(gWMFByteStreamLog, PR_LOG_DEBUG, (__VA_ARGS__)) WMFByteStream::WMFByteStream(MediaResource* aResource, WMFSourceReaderCallback* aSourceReaderCallback) diff --git a/dom/media/wmf/WMFReader.cpp b/dom/media/wmf/WMFReader.cpp index 60efdafcb22c..aa3f2dd2e6e0 100644 --- a/dom/media/wmf/WMFReader.cpp +++ b/dom/media/wmf/WMFReader.cpp @@ -34,7 +34,7 @@ using mozilla::layers::LayersBackend; namespace mozilla { extern PRLogModuleInfo* gMediaDecoderLog; -#define DECODER_LOG(...) MOZ_LOG(gMediaDecoderLog, mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define DECODER_LOG(...) MOZ_LOG(gMediaDecoderLog, PR_LOG_DEBUG, (__VA_ARGS__)) // Uncomment to enable verbose per-sample logging. //#define LOG_SAMPLE_DECODE 1 diff --git a/dom/media/wmf/WMFSourceReaderCallback.cpp b/dom/media/wmf/WMFSourceReaderCallback.cpp index 29651df8b1ca..497d6050630b 100644 --- a/dom/media/wmf/WMFSourceReaderCallback.cpp +++ b/dom/media/wmf/WMFSourceReaderCallback.cpp @@ -10,7 +10,7 @@ namespace mozilla { static PRLogModuleInfo* gWMFSourceReaderCallbackLog = nullptr; -#define WMF_CB_LOG(...) MOZ_LOG(gWMFSourceReaderCallbackLog, mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define WMF_CB_LOG(...) MOZ_LOG(gWMFSourceReaderCallbackLog, PR_LOG_DEBUG, (__VA_ARGS__)) // IUnknown Methods STDMETHODIMP diff --git a/dom/network/UDPSocket.h b/dom/network/UDPSocket.h index 0342a5462950..d706dd4d34b0 100644 --- a/dom/network/UDPSocket.h +++ b/dom/network/UDPSocket.h @@ -18,12 +18,14 @@ struct JSContext; +#if defined(PR_LOGGING) // // set NSPR_LOG_MODULES=UDPSocket:5 // extern PRLogModuleInfo *gUDPSocketLog; -#define UDPSOCKET_LOG(args) MOZ_LOG(gUDPSocketLog, mozilla::LogLevel::Debug, args) -#define UDPSOCKET_LOG_ENABLED() MOZ_LOG_TEST(gUDPSocketLog, mozilla::LogLevel::Debug) +#endif +#define UDPSOCKET_LOG(args) PR_LOG(gUDPSocketLog, PR_LOG_DEBUG, args) +#define UDPSOCKET_LOG_ENABLED() PR_LOG_TEST(gUDPSocketLog, PR_LOG_DEBUG) namespace mozilla { namespace dom { diff --git a/dom/network/UDPSocketChild.cpp b/dom/network/UDPSocketChild.cpp index 5b73dbf2b0a4..a3fdc8f3218f 100644 --- a/dom/network/UDPSocketChild.cpp +++ b/dom/network/UDPSocketChild.cpp @@ -17,12 +17,14 @@ using mozilla::net::gNeckoChild; +#if defined(PR_LOGGING) // // set NSPR_LOG_MODULES=UDPSocket:5 // extern PRLogModuleInfo *gUDPSocketLog; -#define UDPSOCKET_LOG(args) MOZ_LOG(gUDPSocketLog, mozilla::LogLevel::Debug, args) -#define UDPSOCKET_LOG_ENABLED() MOZ_LOG_TEST(gUDPSocketLog, mozilla::LogLevel::Debug) +#endif +#define UDPSOCKET_LOG(args) PR_LOG(gUDPSocketLog, PR_LOG_DEBUG, args) +#define UDPSOCKET_LOG_ENABLED() PR_LOG_TEST(gUDPSocketLog, PR_LOG_DEBUG) namespace mozilla { namespace dom { diff --git a/dom/network/UDPSocketParent.cpp b/dom/network/UDPSocketParent.cpp index 51cb792dc09a..74f969409dc5 100644 --- a/dom/network/UDPSocketParent.cpp +++ b/dom/network/UDPSocketParent.cpp @@ -22,12 +22,14 @@ #include "nsIScriptSecurityManager.h" #include "mozilla/ipc/PBackgroundParent.h" +#if defined(PR_LOGGING) // // set NSPR_LOG_MODULES=UDPSocket:5 // extern PRLogModuleInfo *gUDPSocketLog; -#define UDPSOCKET_LOG(args) MOZ_LOG(gUDPSocketLog, mozilla::LogLevel::Debug, args) -#define UDPSOCKET_LOG_ENABLED() MOZ_LOG_TEST(gUDPSocketLog, mozilla::LogLevel::Debug) +#endif +#define UDPSOCKET_LOG(args) PR_LOG(gUDPSocketLog, PR_LOG_DEBUG, args) +#define UDPSOCKET_LOG_ENABLED() PR_LOG_TEST(gUDPSocketLog, PR_LOG_DEBUG) namespace mozilla { namespace dom { diff --git a/dom/plugins/base/nsPluginLogging.h b/dom/plugins/base/nsPluginLogging.h index 933a24290130..307291db7357 100644 --- a/dom/plugins/base/nsPluginLogging.h +++ b/dom/plugins/base/nsPluginLogging.h @@ -27,10 +27,11 @@ #define PLUGIN_LOG_NAME "Plugin" // Levels -#define PLUGIN_LOG_ALWAYS mozilla::LogLevel::Error -#define PLUGIN_LOG_BASIC mozilla::LogLevel::Info -#define PLUGIN_LOG_NORMAL mozilla::LogLevel::Debug -#define PLUGIN_LOG_NOISY mozilla::LogLevel::Verbose +#define PLUGIN_LOG_ALWAYS 1 +#define PLUGIN_LOG_BASIC 3 +#define PLUGIN_LOG_NORMAL 5 +#define PLUGIN_LOG_NOISY 7 +#define PLUGIN_LOG_MAX 9 // 2. You can combine logs and levels by separating them with a comma: // My favorite Win32 Example: SET NSPR_LOG_MODULES=Plugin:5,PluginNPP:5,PluginNPN:5 diff --git a/dom/plugins/ipc/PluginInstanceChild.cpp b/dom/plugins/ipc/PluginInstanceChild.cpp index 38cd1264e93b..fb8000cb6871 100644 --- a/dom/plugins/ipc/PluginInstanceChild.cpp +++ b/dom/plugins/ipc/PluginInstanceChild.cpp @@ -509,7 +509,7 @@ PluginInstanceChild::NPN_GetValue(NPNVariable aVar, #endif default: - MOZ_LOG(GetPluginLog(), LogLevel::Warning, + MOZ_LOG(GetPluginLog(), PR_LOG_WARNING, ("In PluginInstanceChild::NPN_GetValue: Unhandled NPNVariable %i (%s)", (int) aVar, NPNVariableToString(aVar))); return NPERR_GENERIC_ERROR; @@ -538,7 +538,7 @@ PluginInstanceChild::Invalidate() NPError PluginInstanceChild::NPN_SetValue(NPPVariable aVar, void* aValue) { - MOZ_LOG(GetPluginLog(), LogLevel::Debug, ("%s (aVar=%i, aValue=%p)", + MOZ_LOG(GetPluginLog(), PR_LOG_DEBUG, ("%s (aVar=%i, aValue=%p)", FULLFUNCTION, (int) aVar, aValue)); AssertPluginThread(); @@ -627,7 +627,7 @@ PluginInstanceChild::NPN_SetValue(NPPVariable aVar, void* aValue) #endif default: - MOZ_LOG(GetPluginLog(), LogLevel::Warning, + MOZ_LOG(GetPluginLog(), PR_LOG_WARNING, ("In PluginInstanceChild::NPN_SetValue: Unhandled NPPVariable %i (%s)", (int) aVar, NPPVariableToString(aVar))); return NPERR_GENERIC_ERROR; @@ -2349,7 +2349,7 @@ PluginInstanceChild::FlashThrottleMessage(HWND aWnd, bool PluginInstanceChild::AnswerSetPluginFocus() { - MOZ_LOG(GetPluginLog(), LogLevel::Debug, ("%s", FULLFUNCTION)); + MOZ_LOG(GetPluginLog(), PR_LOG_DEBUG, ("%s", FULLFUNCTION)); #if defined(OS_WIN) // Parent is letting us know the dom set focus to the plugin. Note, @@ -2372,7 +2372,7 @@ PluginInstanceChild::AnswerSetPluginFocus() bool PluginInstanceChild::AnswerUpdateWindow() { - MOZ_LOG(GetPluginLog(), LogLevel::Debug, ("%s", FULLFUNCTION)); + MOZ_LOG(GetPluginLog(), PR_LOG_DEBUG, ("%s", FULLFUNCTION)); #if defined(OS_WIN) if (mPluginWindowHWND) { diff --git a/dom/plugins/ipc/PluginInstanceParent.cpp b/dom/plugins/ipc/PluginInstanceParent.cpp index 8cc92e6233ea..2b235d28a76e 100644 --- a/dom/plugins/ipc/PluginInstanceParent.cpp +++ b/dom/plugins/ipc/PluginInstanceParent.cpp @@ -1119,7 +1119,7 @@ PluginInstanceParent::NPP_GetValue(NPPVariable aVariable, #endif default: - MOZ_LOG(GetPluginLog(), LogLevel::Warning, + MOZ_LOG(GetPluginLog(), PR_LOG_WARNING, ("In PluginInstanceParent::NPP_GetValue: Unhandled NPPVariable %i (%s)", (int) aVariable, NPPVariableToString(aVariable))); return NPERR_GENERIC_ERROR; @@ -1140,7 +1140,7 @@ PluginInstanceParent::NPP_SetValue(NPNVariable variable, void* value) default: NS_ERROR("Unhandled NPNVariable in NPP_SetValue"); - MOZ_LOG(GetPluginLog(), LogLevel::Warning, + MOZ_LOG(GetPluginLog(), PR_LOG_WARNING, ("In PluginInstanceParent::NPP_SetValue: Unhandled NPNVariable %i (%s)", (int) variable, NPNVariableToString(variable))); return NPERR_GENERIC_ERROR; diff --git a/dom/plugins/ipc/PluginMessageUtils.h b/dom/plugins/ipc/PluginMessageUtils.h index 2d5c23b9c4f0..e52f92b7bfa4 100644 --- a/dom/plugins/ipc/PluginMessageUtils.h +++ b/dom/plugins/ipc/PluginMessageUtils.h @@ -62,9 +62,9 @@ extern PRLogModuleInfo* GetPluginLog(); #define FULLFUNCTION __FUNCTION__ #endif -#define PLUGIN_LOG_DEBUG(args) MOZ_LOG(GetPluginLog(), mozilla::LogLevel::Debug, args) -#define PLUGIN_LOG_DEBUG_FUNCTION MOZ_LOG(GetPluginLog(), mozilla::LogLevel::Debug, ("%s", FULLFUNCTION)) -#define PLUGIN_LOG_DEBUG_METHOD MOZ_LOG(GetPluginLog(), mozilla::LogLevel::Debug, ("%s [%p]", FULLFUNCTION, (void*) this)) +#define PLUGIN_LOG_DEBUG(args) MOZ_LOG(GetPluginLog(), PR_LOG_DEBUG, args) +#define PLUGIN_LOG_DEBUG_FUNCTION MOZ_LOG(GetPluginLog(), PR_LOG_DEBUG, ("%s", FULLFUNCTION)) +#define PLUGIN_LOG_DEBUG_METHOD MOZ_LOG(GetPluginLog(), PR_LOG_DEBUG, ("%s [%p]", FULLFUNCTION, (void*) this)) /** * This is NPByteRange without the linked list. diff --git a/dom/plugins/ipc/PluginModuleParent.cpp b/dom/plugins/ipc/PluginModuleParent.cpp index d432781d7a2f..185195bb0333 100755 --- a/dom/plugins/ipc/PluginModuleParent.cpp +++ b/dom/plugins/ipc/PluginModuleParent.cpp @@ -2378,7 +2378,7 @@ nsresult PluginModuleParent::NP_GetValue(void *future, NPPVariable aVariable, void *aValue, NPError* error) { - MOZ_LOG(GetPluginLog(), LogLevel::Warning, ("%s Not implemented, requested variable %i", __FUNCTION__, + MOZ_LOG(GetPluginLog(), PR_LOG_WARNING, ("%s Not implemented, requested variable %i", __FUNCTION__, (int) aVariable)); //TODO: implement this correctly diff --git a/dom/security/nsCSPContext.cpp b/dom/security/nsCSPContext.cpp index 51fe1d5f0ff8..19a681ce0a18 100644 --- a/dom/security/nsCSPContext.cpp +++ b/dom/security/nsCSPContext.cpp @@ -52,8 +52,8 @@ GetCspContextLog() return gCspContextPRLog; } -#define CSPCONTEXTLOG(args) MOZ_LOG(GetCspContextLog(), mozilla::LogLevel::Debug, args) -#define CSPCONTEXTLOGENABLED() MOZ_LOG_TEST(GetCspContextLog(), mozilla::LogLevel::Debug) +#define CSPCONTEXTLOG(args) MOZ_LOG(GetCspContextLog(), PR_LOG_DEBUG, args) +#define CSPCONTEXTLOGENABLED() PR_LOG_TEST(GetCspContextLog(), PR_LOG_DEBUG) static const uint32_t CSP_CACHE_URI_CUTOFF_SIZE = 512; diff --git a/dom/security/nsCSPParser.cpp b/dom/security/nsCSPParser.cpp index 62b2c1bf772b..74958635cc07 100644 --- a/dom/security/nsCSPParser.cpp +++ b/dom/security/nsCSPParser.cpp @@ -28,8 +28,8 @@ GetCspParserLog() return gCspParserPRLog; } -#define CSPPARSERLOG(args) MOZ_LOG(GetCspParserLog(), mozilla::LogLevel::Debug, args) -#define CSPPARSERLOGENABLED() MOZ_LOG_TEST(GetCspParserLog(), mozilla::LogLevel::Debug) +#define CSPPARSERLOG(args) MOZ_LOG(GetCspParserLog(), PR_LOG_DEBUG, args) +#define CSPPARSERLOGENABLED() PR_LOG_TEST(GetCspParserLog(), PR_LOG_DEBUG) static const char16_t COLON = ':'; static const char16_t SEMICOLON = ';'; diff --git a/dom/security/nsCSPService.cpp b/dom/security/nsCSPService.cpp index e5768362f84d..6cc4fa7ec54a 100644 --- a/dom/security/nsCSPService.cpp +++ b/dom/security/nsCSPService.cpp @@ -109,10 +109,10 @@ CSPService::ShouldLoad(uint32_t aContentType, return NS_ERROR_FAILURE; } - if (MOZ_LOG_TEST(gCspPRLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gCspPRLog, PR_LOG_DEBUG)) { nsAutoCString location; aContentLocation->GetSpec(location); - MOZ_LOG(gCspPRLog, LogLevel::Debug, + MOZ_LOG(gCspPRLog, PR_LOG_DEBUG, ("CSPService::ShouldLoad called for %s", location.get())); } @@ -204,14 +204,14 @@ CSPService::ShouldLoad(uint32_t aContentType, principal->GetCsp(getter_AddRefs(csp)); if (csp) { - if (MOZ_LOG_TEST(gCspPRLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gCspPRLog, PR_LOG_DEBUG)) { uint32_t numPolicies = 0; nsresult rv = csp->GetPolicyCount(&numPolicies); if (NS_SUCCEEDED(rv)) { for (uint32_t i=0; iGetPolicy(i, policy); - MOZ_LOG(gCspPRLog, LogLevel::Debug, + MOZ_LOG(gCspPRLog, PR_LOG_DEBUG, ("Document has CSP[%d]: %s", i, NS_ConvertUTF16toUTF8(policy).get())); } @@ -228,10 +228,10 @@ CSPService::ShouldLoad(uint32_t aContentType, aDecision); } } - else if (MOZ_LOG_TEST(gCspPRLog, LogLevel::Debug)) { + else if (PR_LOG_TEST(gCspPRLog, PR_LOG_DEBUG)) { nsAutoCString uriSpec; aContentLocation->GetSpec(uriSpec); - MOZ_LOG(gCspPRLog, LogLevel::Debug, + MOZ_LOG(gCspPRLog, PR_LOG_DEBUG, ("COULD NOT get nsINode for location: %s", uriSpec.get())); } @@ -316,19 +316,19 @@ CSPService::AsyncOnChannelRedirect(nsIChannel *oldChannel, originalUri, // aMimeTypeGuess &aDecision); - if (newUri && MOZ_LOG_TEST(gCspPRLog, LogLevel::Debug)) { + if (newUri && PR_LOG_TEST(gCspPRLog, PR_LOG_DEBUG)) { nsAutoCString newUriSpec("None"); newUri->GetSpec(newUriSpec); - MOZ_LOG(gCspPRLog, LogLevel::Debug, + MOZ_LOG(gCspPRLog, PR_LOG_DEBUG, ("CSPService::AsyncOnChannelRedirect called for %s", newUriSpec.get())); } if (aDecision == 1) { - MOZ_LOG(gCspPRLog, LogLevel::Debug, + MOZ_LOG(gCspPRLog, PR_LOG_DEBUG, ("CSPService::AsyncOnChannelRedirect ALLOWING request.")); } else { - MOZ_LOG(gCspPRLog, LogLevel::Debug, + MOZ_LOG(gCspPRLog, PR_LOG_DEBUG, ("CSPService::AsyncOnChannelRedirect CANCELLING request.")); } diff --git a/dom/security/nsCSPUtils.cpp b/dom/security/nsCSPUtils.cpp index cac7cc342840..495f192f2458 100644 --- a/dom/security/nsCSPUtils.cpp +++ b/dom/security/nsCSPUtils.cpp @@ -23,8 +23,8 @@ GetCspUtilsLog() return gCspUtilsPRLog; } -#define CSPUTILSLOG(args) MOZ_LOG(GetCspUtilsLog(), mozilla::LogLevel::Debug, args) -#define CSPUTILSLOGENABLED() MOZ_LOG_TEST(GetCspUtilsLog(), mozilla::LogLevel::Debug) +#define CSPUTILSLOG(args) MOZ_LOG(GetCspUtilsLog(), PR_LOG_DEBUG, args) +#define CSPUTILSLOGENABLED() PR_LOG_TEST(GetCspUtilsLog(), PR_LOG_DEBUG) void CSP_GetLocalizedStr(const char16_t* aName, diff --git a/dom/xslt/xslt/txExecutionState.cpp b/dom/xslt/xslt/txExecutionState.cpp index 00c454c74218..24d2cd363066 100644 --- a/dom/xslt/xslt/txExecutionState.cpp +++ b/dom/xslt/xslt/txExecutionState.cpp @@ -384,7 +384,7 @@ txExecutionState::retrieveDocument(const nsAString& aUri) return nullptr; } - MOZ_LOG(txLog::xslt, LogLevel::Debug, + MOZ_LOG(txLog::xslt, PR_LOG_DEBUG, ("Retrieve Document %s", NS_LossyConvertUTF16toASCII(aUri).get())); // try to get already loaded document diff --git a/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp b/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp index eeefcff1808c..30005df6167c 100644 --- a/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp +++ b/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp @@ -519,7 +519,7 @@ TX_LoadSheet(nsIURI* aUri, txMozillaXSLTProcessor* aProcessor, nsAutoCString spec; aUri->GetSpec(spec); - MOZ_LOG(txLog::xslt, LogLevel::Info, ("TX_LoadSheet: %s\n", spec.get())); + MOZ_LOG(txLog::xslt, PR_LOG_ALWAYS, ("TX_LoadSheet: %s\n", spec.get())); // Content Policy int16_t shouldLoad = nsIContentPolicy::ACCEPT; diff --git a/dom/xslt/xslt/txMozillaXMLOutput.cpp b/dom/xslt/xslt/txMozillaXMLOutput.cpp index 7cf08a5116fd..21a0cbaa8897 100644 --- a/dom/xslt/xslt/txMozillaXMLOutput.cpp +++ b/dom/xslt/xslt/txMozillaXMLOutput.cpp @@ -264,7 +264,7 @@ txMozillaXMLOutput::endElement() if (mBadChildLevel) { --mBadChildLevel; - MOZ_LOG(txLog::xslt, LogLevel::Debug, + MOZ_LOG(txLog::xslt, PR_LOG_DEBUG, ("endElement, mBadChildLevel = %d\n", mBadChildLevel)); return NS_OK; } @@ -493,7 +493,7 @@ txMozillaXMLOutput::startElementInternal(nsIAtom* aPrefix, if (mBadChildLevel) { ++mBadChildLevel; - MOZ_LOG(txLog::xslt, LogLevel::Debug, + MOZ_LOG(txLog::xslt, PR_LOG_DEBUG, ("startElement, mBadChildLevel = %d\n", mBadChildLevel)); return NS_OK; } @@ -506,7 +506,7 @@ txMozillaXMLOutput::startElementInternal(nsIAtom* aPrefix, // eCloseElement couldn't add the parent so we fail as well or we've // reached the limit of the depth of the tree that we allow. ++mBadChildLevel; - MOZ_LOG(txLog::xslt, LogLevel::Debug, + MOZ_LOG(txLog::xslt, PR_LOG_DEBUG, ("startElement, mBadChildLevel = %d\n", mBadChildLevel)); return NS_OK; } diff --git a/dom/xslt/xslt/txStylesheet.cpp b/dom/xslt/xslt/txStylesheet.cpp index 1c29ecd15c07..b38d0ad1c05c 100644 --- a/dom/xslt/xslt/txStylesheet.cpp +++ b/dom/xslt/xslt/txStylesheet.cpp @@ -16,7 +16,6 @@ #include "txKey.h" #include "txXPathTreeWalker.h" -using mozilla::LogLevel; using mozilla::Move; txStylesheet::txStylesheet() @@ -158,7 +157,7 @@ txStylesheet::findTemplate(const txXPathNode& aNode, } } - if (MOZ_LOG_TEST(txLog::xslt, LogLevel::Debug)) { + if (PR_LOG_TEST(txLog::xslt, PR_LOG_DEBUG)) { nsAutoString mode, nodeName; if (aMode.mLocalName) { aMode.mLocalName->ToString(mode); @@ -169,14 +168,14 @@ txStylesheet::findTemplate(const txXPathNode& aNode, #ifdef TX_TO_STRING match->toString(matchAttr); #endif - MOZ_LOG(txLog::xslt, LogLevel::Debug, + MOZ_LOG(txLog::xslt, PR_LOG_DEBUG, ("MatchTemplate, Pattern %s, Mode %s, Node %s\n", NS_LossyConvertUTF16toASCII(matchAttr).get(), NS_LossyConvertUTF16toASCII(mode).get(), NS_LossyConvertUTF16toASCII(nodeName).get())); } else { - MOZ_LOG(txLog::xslt, LogLevel::Debug, + MOZ_LOG(txLog::xslt, PR_LOG_DEBUG, ("No match, Node %s, Mode %s\n", NS_LossyConvertUTF16toASCII(nodeName).get(), NS_LossyConvertUTF16toASCII(mode).get())); diff --git a/dom/xslt/xslt/txStylesheetCompiler.cpp b/dom/xslt/xslt/txStylesheetCompiler.cpp index 6195e952638a..0b9a083c15ea 100644 --- a/dom/xslt/xslt/txStylesheetCompiler.cpp +++ b/dom/xslt/xslt/txStylesheetCompiler.cpp @@ -377,7 +377,7 @@ txStylesheetCompiler::characters(const nsAString& aStr) nsresult txStylesheetCompiler::doneLoading() { - MOZ_LOG(txLog::xslt, LogLevel::Info, + MOZ_LOG(txLog::xslt, PR_LOG_ALWAYS, ("Compiler::doneLoading: %s\n", NS_LossyConvertUTF16toASCII(mStylesheetURI).get())); if (NS_FAILED(mStatus)) { @@ -393,7 +393,7 @@ void txStylesheetCompiler::cancel(nsresult aError, const char16_t *aErrorText, const char16_t *aParam) { - MOZ_LOG(txLog::xslt, LogLevel::Info, + MOZ_LOG(txLog::xslt, PR_LOG_ALWAYS, ("Compiler::cancel: %s, module: %d, code %d\n", NS_LossyConvertUTF16toASCII(mStylesheetURI).get(), NS_ERROR_GET_MODULE(aError), @@ -422,7 +422,7 @@ txStylesheetCompiler::loadURI(const nsAString& aUri, ReferrerPolicy aReferrerPolicy, txStylesheetCompiler* aCompiler) { - MOZ_LOG(txLog::xslt, LogLevel::Info, + MOZ_LOG(txLog::xslt, PR_LOG_ALWAYS, ("Compiler::loadURI forwards %s thru %s\n", NS_LossyConvertUTF16toASCII(aUri).get(), NS_LossyConvertUTF16toASCII(mStylesheetURI).get())); @@ -676,7 +676,7 @@ nsresult txStylesheetCompilerState::pushPtr(void* aPtr, enumStackType aType) { #ifdef TX_DEBUG_STACK - MOZ_LOG(txLog::xslt, LogLevel::Debug, ("pushPtr: 0x%x type %u\n", aPtr, aType)); + MOZ_LOG(txLog::xslt, PR_LOG_DEBUG, ("pushPtr: 0x%x type %u\n", aPtr, aType)); #endif mTypeStack.AppendElement(aType); return mOtherStack.push(aPtr); @@ -695,7 +695,7 @@ txStylesheetCompilerState::popPtr(enumStackType aType) void* value = mOtherStack.pop(); #ifdef TX_DEBUG_STACK - MOZ_LOG(txLog::xslt, LogLevel::Debug, ("popPtr: 0x%x type %u requested %u\n", value, type, aType)); + MOZ_LOG(txLog::xslt, PR_LOG_DEBUG, ("popPtr: 0x%x type %u requested %u\n", value, type, aType)); #endif if (type != aType) { @@ -750,7 +750,7 @@ txStylesheetCompilerState::addInstruction(nsAutoPtr&& aInstructio nsresult txStylesheetCompilerState::loadIncludedStylesheet(const nsAString& aURI) { - MOZ_LOG(txLog::xslt, LogLevel::Info, + MOZ_LOG(txLog::xslt, PR_LOG_ALWAYS, ("CompilerState::loadIncludedStylesheet: %s\n", NS_LossyConvertUTF16toASCII(aURI).get())); if (mStylesheetURI.Equals(aURI)) { @@ -795,7 +795,7 @@ nsresult txStylesheetCompilerState::loadImportedStylesheet(const nsAString& aURI, txStylesheet::ImportFrame* aFrame) { - MOZ_LOG(txLog::xslt, LogLevel::Info, + MOZ_LOG(txLog::xslt, PR_LOG_ALWAYS, ("CompilerState::loadImportedStylesheet: %s\n", NS_LossyConvertUTF16toASCII(aURI).get())); if (mStylesheetURI.Equals(aURI)) { diff --git a/dom/xul/XULDocument.cpp b/dom/xul/XULDocument.cpp index 588f57169fe8..a0cee35b6503 100644 --- a/dom/xul/XULDocument.cpp +++ b/dom/xul/XULDocument.cpp @@ -375,7 +375,7 @@ XULDocument::StartDocumentLoad(const char* aCommand, nsIChannel* aChannel, nsIStreamListener **aDocListener, bool aReset, nsIContentSink* aSink) { - if (MOZ_LOG_TEST(gXULLog, LogLevel::Warning)) { + if (PR_LOG_TEST(gXULLog, PR_LOG_WARNING)) { nsCOMPtr uri; nsresult rv = aChannel->GetOriginalURI(getter_AddRefs(uri)); @@ -383,7 +383,7 @@ XULDocument::StartDocumentLoad(const char* aCommand, nsIChannel* aChannel, nsAutoCString urlspec; rv = uri->GetSpec(urlspec); if (NS_SUCCEEDED(rv)) { - MOZ_LOG(gXULLog, LogLevel::Warning, + MOZ_LOG(gXULLog, PR_LOG_WARNING, ("xul: load document '%s'", urlspec.get())); } } @@ -559,11 +559,11 @@ XULDocument::EndLoad() } OnPrototypeLoadDone(true); - if (MOZ_LOG_TEST(gXULLog, LogLevel::Warning)) { + if (PR_LOG_TEST(gXULLog, PR_LOG_WARNING)) { nsAutoCString urlspec; rv = uri->GetSpec(urlspec); if (NS_SUCCEEDED(rv)) { - MOZ_LOG(gXULLog, LogLevel::Warning, + MOZ_LOG(gXULLog, PR_LOG_WARNING, ("xul: Finished loading document '%s'", urlspec.get())); } } @@ -2271,14 +2271,14 @@ XULDocument::PrepareToWalk() nsXULPrototypeElement* proto = mCurrentPrototype->GetRootElement(); if (! proto) { - if (MOZ_LOG_TEST(gXULLog, LogLevel::Error)) { + if (PR_LOG_TEST(gXULLog, PR_LOG_ERROR)) { nsCOMPtr url = mCurrentPrototype->GetURI(); nsAutoCString urlspec; rv = url->GetSpec(urlspec); if (NS_FAILED(rv)) return rv; - MOZ_LOG(gXULLog, LogLevel::Error, + MOZ_LOG(gXULLog, PR_LOG_ERROR, ("xul: error parsing '%s'", urlspec.get())); } @@ -2542,7 +2542,7 @@ XULDocument::LoadOverlayInternal(nsIURI* aURI, bool aIsDynamic, *aShouldReturn = false; *aFailureFromContent = false; - if (MOZ_LOG_TEST(gXULLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULLog, PR_LOG_DEBUG)) { nsAutoCString urlspec; aURI->GetSpec(urlspec); nsAutoCString parentDoc; @@ -2553,7 +2553,7 @@ XULDocument::LoadOverlayInternal(nsIURI* aURI, bool aIsDynamic, if (!(parentDoc.get())) parentDoc = ""; - MOZ_LOG(gXULLog, LogLevel::Debug, + MOZ_LOG(gXULLog, PR_LOG_DEBUG, ("xul: %s loading overlay %s", parentDoc.get(), urlspec.get())); } @@ -2613,7 +2613,7 @@ XULDocument::LoadOverlayInternal(nsIURI* aURI, bool aIsDynamic, return NS_OK; } - MOZ_LOG(gXULLog, LogLevel::Debug, ("xul: overlay was cached")); + MOZ_LOG(gXULLog, PR_LOG_DEBUG, ("xul: overlay was cached")); // Found the overlay's prototype in the cache, fully loaded. If // this is a dynamic overlay, this will call ResumeWalk. @@ -2622,10 +2622,10 @@ XULDocument::LoadOverlayInternal(nsIURI* aURI, bool aIsDynamic, } else { // Not there. Initiate a load. - MOZ_LOG(gXULLog, LogLevel::Debug, ("xul: overlay was not cached")); + MOZ_LOG(gXULLog, PR_LOG_DEBUG, ("xul: overlay was not cached")); if (mIsGoingAway) { - MOZ_LOG(gXULLog, LogLevel::Debug, ("xul: ...and document already destroyed")); + MOZ_LOG(gXULLog, PR_LOG_DEBUG, ("xul: ...and document already destroyed")); return NS_ERROR_NOT_AVAILABLE; } @@ -3578,8 +3578,8 @@ XULDocument::CreateElementFromPrototype(nsXULPrototypeElement* aPrototype, *aResult = nullptr; nsresult rv = NS_OK; - if (MOZ_LOG_TEST(gXULLog, LogLevel::Debug)) { - MOZ_LOG(gXULLog, LogLevel::Debug, + if (PR_LOG_TEST(gXULLog, PR_LOG_NOTICE)) { + MOZ_LOG(gXULLog, PR_LOG_NOTICE, ("xul: creating <%s> from prototype", NS_ConvertUTF16toUTF8(aPrototype->mNodeInfo->QualifiedName()).get())); } @@ -3848,10 +3848,10 @@ XULDocument::OverlayForwardReference::Resolve() if (NS_FAILED(rv)) return eResolve_Error; } - if (MOZ_LOG_TEST(gXULLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULLog, PR_LOG_NOTICE)) { nsAutoCString idC; idC.AssignWithConversion(id); - MOZ_LOG(gXULLog, LogLevel::Debug, + MOZ_LOG(gXULLog, PR_LOG_NOTICE, ("xul: overlay resolved '%s'", idC.get())); } @@ -4017,7 +4017,7 @@ XULDocument::OverlayForwardReference::Merge(nsIContent* aTargetNode, XULDocument::OverlayForwardReference::~OverlayForwardReference() { - if (MOZ_LOG_TEST(gXULLog, LogLevel::Warning) && !mResolved) { + if (PR_LOG_TEST(gXULLog, PR_LOG_WARNING) && !mResolved) { nsAutoString id; mOverlay->GetAttr(kNameSpaceID_None, nsGkAtoms::id, id); @@ -4033,7 +4033,7 @@ XULDocument::OverlayForwardReference::~OverlayForwardReference() nsresult rv = mDocument->mChannel->GetOriginalURI(getter_AddRefs(docURI)); if (NS_SUCCEEDED(rv)) docURI->GetSpec(parentDoc); - MOZ_LOG(gXULLog, LogLevel::Warning, + MOZ_LOG(gXULLog, PR_LOG_WARNING, ("xul: %s overlay failed to resolve '%s' in %s", urlspec.get(), idC.get(), parentDoc.get())); } @@ -4060,7 +4060,7 @@ XULDocument::BroadcasterHookup::Resolve() XULDocument::BroadcasterHookup::~BroadcasterHookup() { - if (MOZ_LOG_TEST(gXULLog, LogLevel::Warning) && !mResolved) { + if (PR_LOG_TEST(gXULLog, PR_LOG_WARNING) && !mResolved) { // Tell the world we failed nsAutoString broadcasterID; @@ -4078,7 +4078,7 @@ XULDocument::BroadcasterHookup::~BroadcasterHookup() nsAutoCString attributeC,broadcasteridC; attributeC.AssignWithConversion(attribute); broadcasteridC.AssignWithConversion(broadcasterID); - MOZ_LOG(gXULLog, LogLevel::Warning, + MOZ_LOG(gXULLog, PR_LOG_WARNING, ("xul: broadcaster hookup failed <%s attribute='%s'> to %s", nsAtomCString(mObservesElement->NodeInfo()->NameAtom()).get(), attributeC.get(), @@ -4279,7 +4279,7 @@ XULDocument::CheckBroadcasterHookup(Element* aElement, } // Tell the world we succeeded - if (MOZ_LOG_TEST(gXULLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULLog, PR_LOG_NOTICE)) { nsCOMPtr content = do_QueryInterface(listener); @@ -4290,7 +4290,7 @@ XULDocument::CheckBroadcasterHookup(Element* aElement, nsAutoCString attributeC,broadcasteridC; attributeC.AssignWithConversion(attribute); broadcasteridC.AssignWithConversion(broadcasterID); - MOZ_LOG(gXULLog, LogLevel::Debug, + MOZ_LOG(gXULLog, PR_LOG_NOTICE, ("xul: broadcaster hookup <%s attribute='%s'> to %s", nsAtomCString(content->NodeInfo()->NameAtom()).get(), attributeC.get(), diff --git a/dom/xul/nsXULCommandDispatcher.cpp b/dom/xul/nsXULCommandDispatcher.cpp index e91ab667669a..383d6626d35b 100644 --- a/dom/xul/nsXULCommandDispatcher.cpp +++ b/dom/xul/nsXULCommandDispatcher.cpp @@ -268,13 +268,13 @@ nsXULCommandDispatcher::AddCommandUpdater(nsIDOMElement* aElement, if (updater->mElement == aElement) { #ifdef DEBUG - if (MOZ_LOG_TEST(gCommandLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gCommandLog, PR_LOG_NOTICE)) { nsAutoCString eventsC, targetsC, aeventsC, atargetsC; eventsC.AssignWithConversion(updater->mEvents); targetsC.AssignWithConversion(updater->mTargets); CopyUTF16toUTF8(aEvents, aeventsC); CopyUTF16toUTF8(aTargets, atargetsC); - MOZ_LOG(gCommandLog, LogLevel::Debug, + MOZ_LOG(gCommandLog, PR_LOG_NOTICE, ("xulcmd[%p] replace %p(events=%s targets=%s) with (events=%s targets=%s)", this, aElement, eventsC.get(), @@ -296,12 +296,12 @@ nsXULCommandDispatcher::AddCommandUpdater(nsIDOMElement* aElement, updater = updater->mNext; } #ifdef DEBUG - if (MOZ_LOG_TEST(gCommandLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gCommandLog, PR_LOG_NOTICE)) { nsAutoCString aeventsC, atargetsC; CopyUTF16toUTF8(aEvents, aeventsC); CopyUTF16toUTF8(aTargets, atargetsC); - MOZ_LOG(gCommandLog, LogLevel::Debug, + MOZ_LOG(gCommandLog, PR_LOG_NOTICE, ("xulcmd[%p] add %p(events=%s targets=%s)", this, aElement, aeventsC.get(), @@ -331,11 +331,11 @@ nsXULCommandDispatcher::RemoveCommandUpdater(nsIDOMElement* aElement) while (updater) { if (updater->mElement == aElement) { #ifdef DEBUG - if (MOZ_LOG_TEST(gCommandLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gCommandLog, PR_LOG_NOTICE)) { nsAutoCString eventsC, targetsC; eventsC.AssignWithConversion(updater->mEvents); targetsC.AssignWithConversion(updater->mTargets); - MOZ_LOG(gCommandLog, LogLevel::Debug, + MOZ_LOG(gCommandLog, PR_LOG_NOTICE, ("xulcmd[%p] remove %p(events=%s targets=%s)", this, aElement, eventsC.get(), @@ -391,10 +391,10 @@ nsXULCommandDispatcher::UpdateCommands(const nsAString& aEventName) nsIContent* content = updaters[u]; #ifdef DEBUG - if (MOZ_LOG_TEST(gCommandLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gCommandLog, PR_LOG_NOTICE)) { nsAutoCString aeventnameC; CopyUTF16toUTF8(aEventName, aeventnameC); - MOZ_LOG(gCommandLog, LogLevel::Debug, + MOZ_LOG(gCommandLog, PR_LOG_NOTICE, ("xulcmd[%p] update %p event=%s", this, content, aeventnameC.get())); diff --git a/dom/xul/nsXULContentSink.cpp b/dom/xul/nsXULContentSink.cpp index 201b581050a4..62fa22f61733 100644 --- a/dom/xul/nsXULContentSink.cpp +++ b/dom/xul/nsXULContentSink.cpp @@ -477,7 +477,7 @@ XULContentSinkImpl::HandleStartElement(const char16_t *aName, case eInEpilog: case eInScript: - MOZ_LOG(gContentSinkLog, LogLevel::Warning, + MOZ_LOG(gContentSinkLog, PR_LOG_WARNING, ("xul: warning: unexpected tags in epilog at line %d", aLineNumber)); rv = NS_ERROR_UNEXPECTED; // XXX @@ -728,7 +728,7 @@ XULContentSinkImpl::OpenRoot(const char16_t** aAttributes, if (aNodeInfo->Equals(nsGkAtoms::script, kNameSpaceID_XHTML) || aNodeInfo->Equals(nsGkAtoms::script, kNameSpaceID_XUL)) { - MOZ_LOG(gContentSinkLog, LogLevel::Error, + MOZ_LOG(gContentSinkLog, PR_LOG_ERROR, ("xul: script tag not allowed as root content element")); return NS_ERROR_UNEXPECTED; @@ -739,10 +739,10 @@ XULContentSinkImpl::OpenRoot(const char16_t** aAttributes, rv = CreateElement(aNodeInfo, &element); if (NS_FAILED(rv)) { - if (MOZ_LOG_TEST(gContentSinkLog, LogLevel::Error)) { + if (PR_LOG_TEST(gContentSinkLog, PR_LOG_ERROR)) { nsAutoString anodeC; aNodeInfo->GetName(anodeC); - MOZ_LOG(gContentSinkLog, LogLevel::Error, + MOZ_LOG(gContentSinkLog, PR_LOG_ERROR, ("xul: unable to create element '%s' at line %d", NS_ConvertUTF16toUTF8(anodeC).get(), -1)); // XXX pass in line number @@ -780,10 +780,10 @@ XULContentSinkImpl::OpenTag(const char16_t** aAttributes, rv = CreateElement(aNodeInfo, &element); if (NS_FAILED(rv)) { - if (MOZ_LOG_TEST(gContentSinkLog, LogLevel::Error)) { + if (PR_LOG_TEST(gContentSinkLog, PR_LOG_ERROR)) { nsAutoString anodeC; aNodeInfo->GetName(anodeC); - MOZ_LOG(gContentSinkLog, LogLevel::Error, + MOZ_LOG(gContentSinkLog, PR_LOG_ERROR, ("xul: unable to create element '%s' at line %d", NS_ConvertUTF16toUTF8(anodeC).get(), aLineNumber)); @@ -977,7 +977,7 @@ XULContentSinkImpl::AddAttributes(const char16_t** aAttributes, mDocumentURL); NS_ENSURE_SUCCESS(rv, rv); - if (MOZ_LOG_TEST(gContentSinkLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gContentSinkLog, PR_LOG_DEBUG)) { nsAutoString extraWhiteSpace; int32_t cnt = mContextStack.Depth(); while (--cnt >= 0) @@ -985,7 +985,7 @@ XULContentSinkImpl::AddAttributes(const char16_t** aAttributes, nsAutoString qnameC,valueC; qnameC.Assign(aAttributes[0]); valueC.Assign(aAttributes[1]); - MOZ_LOG(gContentSinkLog, LogLevel::Debug, + MOZ_LOG(gContentSinkLog, PR_LOG_DEBUG, ("xul: %.5d. %s %s=%s", -1, // XXX pass in line number NS_ConvertUTF16toUTF8(extraWhiteSpace).get(), diff --git a/dom/xul/templates/nsContentTestNode.cpp b/dom/xul/templates/nsContentTestNode.cpp index 215fc5e41001..eda1b79f077f 100644 --- a/dom/xul/templates/nsContentTestNode.cpp +++ b/dom/xul/templates/nsContentTestNode.cpp @@ -13,9 +13,6 @@ #include "nsXULTemplateQueryProcessorRDF.h" #include "mozilla/Logging.h" - -using mozilla::LogLevel; - extern PRLogModuleInfo* gXULTemplateLog; nsContentTestNode::nsContentTestNode(nsXULTemplateQueryProcessorRDF* aProcessor, @@ -26,7 +23,7 @@ nsContentTestNode::nsContentTestNode(nsXULTemplateQueryProcessorRDF* aProcessor, mRefVariable(aRefVariable), mTag(nullptr) { - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { nsAutoString tag(NS_LITERAL_STRING("(none)")); if (mTag) mTag->ToString(tag); @@ -35,7 +32,7 @@ nsContentTestNode::nsContentTestNode(nsXULTemplateQueryProcessorRDF* aProcessor, if (aRefVariable) aRefVariable->ToString(refvar); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("nsContentTestNode[%p]: ref-var=%s tag=%s", this, NS_ConvertUTF16toUTF8(refvar).get(), NS_ConvertUTF16toUTF8(tag).get())); diff --git a/dom/xul/templates/nsInstantiationNode.cpp b/dom/xul/templates/nsInstantiationNode.cpp index ad6c62106602..6bd7a93a95e5 100644 --- a/dom/xul/templates/nsInstantiationNode.cpp +++ b/dom/xul/templates/nsInstantiationNode.cpp @@ -15,7 +15,7 @@ nsInstantiationNode::nsInstantiationNode(nsXULTemplateQueryProcessorRDF* aProces : mProcessor(aProcessor), mQuery(aQuery) { - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("nsInstantiationNode[%p] query=%p", this, aQuery)); MOZ_COUNT_CTOR(nsInstantiationNode); diff --git a/dom/xul/templates/nsRDFConInstanceTestNode.cpp b/dom/xul/templates/nsRDFConInstanceTestNode.cpp index 4e41d4048913..3753693ccfe1 100644 --- a/dom/xul/templates/nsRDFConInstanceTestNode.cpp +++ b/dom/xul/templates/nsRDFConInstanceTestNode.cpp @@ -13,9 +13,6 @@ #include "mozilla/Logging.h" #include "nsXULContentUtils.h" - -using mozilla::LogLevel; - extern PRLogModuleInfo* gXULTemplateLog; static const char* @@ -39,7 +36,7 @@ nsRDFConInstanceTestNode::nsRDFConInstanceTestNode(TestNode* aParent, mContainer(aContainer), mEmpty(aEmpty) { - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { nsAutoCString props; nsResourceSet& containmentProps = aProcessor->ContainmentProperties(); @@ -61,7 +58,7 @@ nsRDFConInstanceTestNode::nsRDFConInstanceTestNode(TestNode* aParent, if (mContainerVariable) mContainerVariable->ToString(cvar); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("nsRDFConInstanceTestNode[%p]: parent=%p member-props=(%s) container-var=%s container=%s empty=%s", this, aParent, @@ -103,11 +100,11 @@ nsRDFConInstanceTestNode::FilterInstantiations(InstantiationSet& aInstantiations continue; } - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { const char* container = "(unbound)"; valueres->GetValueConst(&container); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("nsRDFConInstanceTestNode[%p]::FilterInstantiations() container=[%s]", this, container)); } @@ -195,11 +192,11 @@ nsRDFConInstanceTestNode::FilterInstantiations(InstantiationSet& aInstantiations } } - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, (" empty => %s", (empty == mEmpty) ? "consistent" : "inconsistent")); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, (" container => %s", (container == mContainer) ? "consistent" : "inconsistent")); @@ -248,7 +245,7 @@ nsRDFConInstanceTestNode::CanPropagate(nsIRDFResource* aSource, canpropagate = mProcessor->ContainmentProperties().Contains(aProperty); } - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { const char* source; aSource->GetValueConst(&source); @@ -258,7 +255,7 @@ nsRDFConInstanceTestNode::CanPropagate(nsIRDFResource* aSource, nsAutoString target; nsXULContentUtils::GetTextForNode(aTarget, target); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("nsRDFConInstanceTestNode[%p]: CanPropagate([%s]==[%s]=>[%s]) => %s", this, source, property, NS_ConvertUTF16toUTF8(target).get(), canpropagate ? "true" : "false")); diff --git a/dom/xul/templates/nsRDFConMemberTestNode.cpp b/dom/xul/templates/nsRDFConMemberTestNode.cpp index d6389b0e178c..074ccf522706 100644 --- a/dom/xul/templates/nsRDFConMemberTestNode.cpp +++ b/dom/xul/templates/nsRDFConMemberTestNode.cpp @@ -13,9 +13,6 @@ #include "nsXULContentUtils.h" #include "mozilla/Logging.h" - -using mozilla::LogLevel; - extern PRLogModuleInfo* gXULTemplateLog; nsRDFConMemberTestNode::nsRDFConMemberTestNode(TestNode* aParent, @@ -27,7 +24,7 @@ nsRDFConMemberTestNode::nsRDFConMemberTestNode(TestNode* aParent, mContainerVariable(aContainerVariable), mMemberVariable(aMemberVariable) { - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { nsAutoCString props; nsResourceSet& containmentProps = aProcessor->ContainmentProperties(); @@ -53,7 +50,7 @@ nsRDFConMemberTestNode::nsRDFConMemberTestNode(TestNode* aParent, if (mMemberVariable) mMemberVariable->ToString(mvar); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("nsRDFConMemberTestNode[%p]: parent=%p member-props=(%s) container-var=%s member-var=%s", this, aParent, @@ -114,7 +111,7 @@ nsRDFConMemberTestNode::FilterInstantiations(InstantiationSet& aInstantiations, hasMemberBinding = inst->mAssignments.GetAssignmentFor(mMemberVariable, getter_AddRefs(memberValue)); - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { const char* container = "(unbound)"; if (hasContainerBinding) containerRes->GetValueConst(&container); @@ -123,7 +120,7 @@ nsRDFConMemberTestNode::FilterInstantiations(InstantiationSet& aInstantiations, if (hasMemberBinding) nsXULContentUtils::GetTextForNode(memberValue, member); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("nsRDFConMemberTestNode[%p]: FilterInstantiations() container=[%s] member=[%s]", this, container, NS_ConvertUTF16toUTF8(member).get())); } @@ -171,7 +168,7 @@ nsRDFConMemberTestNode::FilterInstantiations(InstantiationSet& aInstantiations, } } - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, (" consistency check => %s", isconsistent ? "passed" : "failed")); if (isconsistent) { @@ -218,11 +215,11 @@ nsRDFConMemberTestNode::FilterInstantiations(InstantiationSet& aInstantiations, if (! node) return NS_ERROR_UNEXPECTED; - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { nsAutoString member; nsXULContentUtils::GetTextForNode(node, member); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, (" member => %s", NS_ConvertUTF16toUTF8(member).get())); } @@ -305,11 +302,11 @@ nsRDFConMemberTestNode::FilterInstantiations(InstantiationSet& aInstantiations, if (! source) return NS_ERROR_UNEXPECTED; - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { const char* container; source->GetValueConst(&container); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, (" container => %s", container)); } @@ -375,11 +372,11 @@ nsRDFConMemberTestNode::FilterInstantiations(InstantiationSet& aInstantiations, NS_ASSERTION(value != nullptr, "member is not an nsIRDFNode"); if (! value) continue; - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { nsAutoString s; nsXULContentUtils::GetTextForNode(value, s); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, (" member => %s", NS_ConvertUTF16toUTF8(s).get())); } } @@ -392,11 +389,11 @@ nsRDFConMemberTestNode::FilterInstantiations(InstantiationSet& aInstantiations, value = valueRes; - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { const char* s; valueRes->GetValueConst(&s); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, (" container => %s", s)); } } @@ -469,7 +466,7 @@ nsRDFConMemberTestNode::CanPropagate(nsIRDFResource* aSource, canpropagate = mProcessor->ContainmentProperties().Contains(aProperty); } - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { const char* source; aSource->GetValueConst(&source); @@ -479,7 +476,7 @@ nsRDFConMemberTestNode::CanPropagate(nsIRDFResource* aSource, nsAutoString target; nsXULContentUtils::GetTextForNode(aTarget, target); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("nsRDFConMemberTestNode[%p]: CanPropagate([%s]==[%s]=>[%s]) => %s", this, source, property, NS_ConvertUTF16toUTF8(target).get(), canpropagate ? "true" : "false")); diff --git a/dom/xul/templates/nsRDFPropertyTestNode.cpp b/dom/xul/templates/nsRDFPropertyTestNode.cpp index 7f8e3891af5b..4184cf7fa137 100644 --- a/dom/xul/templates/nsRDFPropertyTestNode.cpp +++ b/dom/xul/templates/nsRDFPropertyTestNode.cpp @@ -8,9 +8,6 @@ #include "nsXULContentUtils.h" #include "mozilla/Logging.h" - -using mozilla::LogLevel; - extern PRLogModuleInfo* gXULTemplateLog; #include "nsIRDFLiteral.h" @@ -27,7 +24,7 @@ nsRDFPropertyTestNode::nsRDFPropertyTestNode(TestNode* aParent, mTargetVariable(aTargetVariable), mTarget(nullptr) { - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { const char* prop = "(null)"; if (aProperty) aProperty->GetValueConst(&prop); @@ -40,7 +37,7 @@ nsRDFPropertyTestNode::nsRDFPropertyTestNode(TestNode* aParent, if (mTargetVariable) mTargetVariable->ToString(tvar); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("nsRDFPropertyTestNode[%p]: parent=%p source=%s property=%s target=%s", this, aParent, NS_ConvertUTF16toUTF8(svar).get(), prop, NS_ConvertUTF16toUTF8(tvar).get())); } @@ -60,7 +57,7 @@ nsRDFPropertyTestNode::nsRDFPropertyTestNode(TestNode* aParent, mTargetVariable(aTargetVariable), mTarget(nullptr) { - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { const char* source = "(null)"; if (aSource) aSource->GetValueConst(&source); @@ -73,7 +70,7 @@ nsRDFPropertyTestNode::nsRDFPropertyTestNode(TestNode* aParent, if (mTargetVariable) mTargetVariable->ToString(tvar); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("nsRDFPropertyTestNode[%p]: parent=%p source=%s property=%s target=%s", this, aParent, source, prop, NS_ConvertUTF16toUTF8(tvar).get())); } @@ -93,7 +90,7 @@ nsRDFPropertyTestNode::nsRDFPropertyTestNode(TestNode* aParent, mTargetVariable(0), mTarget(aTarget) { - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { nsAutoString svar(NS_LITERAL_STRING("(none)")); if (mSourceVariable) mSourceVariable->ToString(svar); @@ -105,7 +102,7 @@ nsRDFPropertyTestNode::nsRDFPropertyTestNode(TestNode* aParent, nsAutoString target; nsXULContentUtils::GetTextForNode(aTarget, target); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("nsRDFPropertyTestNode[%p]: parent=%p source=%s property=%s target=%s", this, aParent, NS_ConvertUTF16toUTF8(svar).get(), prop, NS_ConvertUTF16toUTF8(target).get())); } @@ -151,7 +148,7 @@ nsRDFPropertyTestNode::FilterInstantiations(InstantiationSet& aInstantiations, getter_AddRefs(targetValue)); } - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { const char* source = "(unbound)"; if (hasSourceBinding) sourceRes->GetValueConst(&source); @@ -160,7 +157,7 @@ nsRDFPropertyTestNode::FilterInstantiations(InstantiationSet& aInstantiations, if (hasTargetBinding) nsXULContentUtils::GetTextForNode(targetValue, target); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("nsRDFPropertyTestNode[%p]: FilterInstantiations() source=[%s] target=[%s]", this, source, NS_ConvertUTF16toUTF8(target).get())); } @@ -172,7 +169,7 @@ nsRDFPropertyTestNode::FilterInstantiations(InstantiationSet& aInstantiations, true, &hasAssertion); if (NS_FAILED(rv)) return rv; - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, (" consistency check => %s", hasAssertion ? "passed" : "failed")); if (hasAssertion) { @@ -232,12 +229,12 @@ nsRDFPropertyTestNode::FilterInstantiations(InstantiationSet& aInstantiations, value = do_QueryInterface(isupports); NS_ASSERTION(value != nullptr, "target is not an nsIRDFNode"); - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { nsAutoString s(NS_LITERAL_STRING("(none found)")); if (value) nsXULContentUtils::GetTextForNode(value, s); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, (" target => %s", NS_ConvertUTF16toUTF8(s).get())); } @@ -251,12 +248,12 @@ nsRDFPropertyTestNode::FilterInstantiations(InstantiationSet& aInstantiations, nsCOMPtr source = do_QueryInterface(isupports); NS_ASSERTION(source != nullptr, "source is not an nsIRDFResource"); - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { const char* s = "(none found)"; if (source) source->GetValueConst(&s); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, (" source => %s", s)); } @@ -324,7 +321,7 @@ nsRDFPropertyTestNode::CanPropagate(nsIRDFResource* aSource, result = true; } - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { const char* source; aSource->GetValueConst(&source); @@ -334,7 +331,7 @@ nsRDFPropertyTestNode::CanPropagate(nsIRDFResource* aSource, nsAutoString target; nsXULContentUtils::GetTextForNode(aTarget, target); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("nsRDFPropertyTestNode[%p]: CanPropagate([%s]==[%s]=>[%s]) => %s", this, source, property, NS_ConvertUTF16toUTF8(target).get(), result ? "true" : "false")); @@ -349,7 +346,7 @@ nsRDFPropertyTestNode::Retract(nsIRDFResource* aSource, nsIRDFNode* aTarget) const { if (aProperty == mProperty.get()) { - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { const char* source; aSource->GetValueConst(&source); @@ -359,7 +356,7 @@ nsRDFPropertyTestNode::Retract(nsIRDFResource* aSource, nsAutoString target; nsXULContentUtils::GetTextForNode(aTarget, target); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("nsRDFPropertyTestNode[%p]: Retract([%s]==[%s]=>[%s])", this, source, property, NS_ConvertUTF16toUTF8(target).get())); } diff --git a/dom/xul/templates/nsRuleNetwork.cpp b/dom/xul/templates/nsRuleNetwork.cpp index 4354768d9e22..1ee72388e478 100644 --- a/dom/xul/templates/nsRuleNetwork.cpp +++ b/dom/xul/templates/nsRuleNetwork.cpp @@ -294,7 +294,7 @@ nsresult TestNode::Propagate(InstantiationSet& aInstantiations, bool aIsUpdate, bool& aTakenInstantiations) { - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("TestNode[%p]: Propagate() begin", this)); aTakenInstantiations = false; @@ -313,7 +313,7 @@ TestNode::Propagate(InstantiationSet& aInstantiations, if (! aInstantiations.Empty()) { ReteNodeSet::Iterator last = mKids.Last(); for (ReteNodeSet::Iterator kid = mKids.First(); kid != last; ++kid) { - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("TestNode[%p]: Propagate() passing to child %p", this, kid.operator->())); // create a copy of the instantiations @@ -337,7 +337,7 @@ TestNode::Propagate(InstantiationSet& aInstantiations, } } - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("TestNode[%p]: Propagate() end", this)); return NS_OK; @@ -349,7 +349,7 @@ TestNode::Constrain(InstantiationSet& aInstantiations) { nsresult rv; - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("TestNode[%p]: Constrain() begin", this)); // if the cantHandleYet flag is set by FilterInstantiations, @@ -366,7 +366,7 @@ TestNode::Constrain(InstantiationSet& aInstantiations) // could not be filled in yet, then ride 'em on up to the // parent to narrow them. - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("TestNode[%p]: Constrain() passing to parent %p", this, mParent)); rv = mParent->Constrain(aInstantiations); @@ -375,13 +375,13 @@ TestNode::Constrain(InstantiationSet& aInstantiations) rv = FilterInstantiations(aInstantiations, nullptr); } else { - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("TestNode[%p]: Constrain() failed", this)); rv = NS_OK; } - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("TestNode[%p]: Constrain() end", this)); return rv; diff --git a/dom/xul/templates/nsXULContentBuilder.cpp b/dom/xul/templates/nsXULContentBuilder.cpp index e6e3e050f10b..6b302b04b4fd 100644 --- a/dom/xul/templates/nsXULContentBuilder.cpp +++ b/dom/xul/templates/nsXULContentBuilder.cpp @@ -446,15 +446,15 @@ nsXULContentBuilder::BuildContentFromTemplate(nsIContent *aTemplateNode, nsresult rv; - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { + MOZ_LOG(gXULTemplateLog, PR_LOG_ALWAYS, ("nsXULContentBuilder::BuildContentFromTemplate (is unique: %d)", aIsUnique)); nsAutoString id; aChild->GetId(id); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_ALWAYS, ("Tags: [Template: %s Resource: %s Real: %s] for id %s", nsAtomCString(aTemplateNode->NodeInfo()->NameAtom()).get(), nsAtomCString(aResourceNode->NodeInfo()->NameAtom()).get(), @@ -523,8 +523,8 @@ nsXULContentBuilder::BuildContentFromTemplate(nsIContent *aTemplateNode, nsIAtom *tag = tmplKid->NodeInfo()->NameAtom(); - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("xultemplate[%p] building %s %s %s", this, nsAtomCString(tag).get(), (isGenerationElement ? "[resource]" : ""), @@ -939,7 +939,7 @@ nsXULContentBuilder::CreateTemplateAndContainerContents(nsIContent* aElement, // and 2) recursive subcontent (if the current element refers to a // container result). - MOZ_LOG(gXULTemplateLog, LogLevel::Info, + MOZ_LOG(gXULTemplateLog, PR_LOG_ALWAYS, ("nsXULContentBuilder::CreateTemplateAndContainerContents start - flags: %d", mFlags)); @@ -975,7 +975,7 @@ nsXULContentBuilder::CreateTemplateAndContainerContents(nsIContent* aElement, false, true); } - MOZ_LOG(gXULTemplateLog, LogLevel::Info, + MOZ_LOG(gXULTemplateLog, PR_LOG_ALWAYS, ("nsXULContentBuilder::CreateTemplateAndContainerContents end")); return NS_OK; @@ -1073,10 +1073,10 @@ nsXULContentBuilder::CreateContainerContentsForQuerySet(nsIContent* aElement, nsIContent** aContainer, int32_t* aNewIndexInContainer) { - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { nsAutoString id; aResult->GetId(id); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_ALWAYS, ("nsXULContentBuilder::CreateContainerContentsForQuerySet start for ref %s\n", NS_ConvertUTF16toUTF8(id).get())); } diff --git a/dom/xul/templates/nsXULContentUtils.cpp b/dom/xul/templates/nsXULContentUtils.cpp index b563f6d68440..f8789b6855e0 100644 --- a/dom/xul/templates/nsXULContentUtils.cpp +++ b/dom/xul/templates/nsXULContentUtils.cpp @@ -363,6 +363,6 @@ nsXULContentUtils::LogTemplateError(const char* aStr) nsCOMPtr cs = do_GetService(NS_CONSOLESERVICE_CONTRACTID); if (cs) { cs->LogStringMessage(message.get()); - MOZ_LOG(gXULTemplateLog, LogLevel::Info, ("Error parsing template: %s", aStr)); + MOZ_LOG(gXULTemplateLog, PR_LOG_ALWAYS, ("Error parsing template: %s", aStr)); } } diff --git a/dom/xul/templates/nsXULTemplateBuilder.cpp b/dom/xul/templates/nsXULTemplateBuilder.cpp index 82e7fcfe7e3f..1e29137acf0a 100644 --- a/dom/xul/templates/nsXULTemplateBuilder.cpp +++ b/dom/xul/templates/nsXULTemplateBuilder.cpp @@ -502,7 +502,7 @@ nsXULTemplateBuilder::UpdateResult(nsIXULTemplateResult* aOldResult, nsIXULTemplateResult* aNewResult, nsIDOMNode* aQueryNode) { - MOZ_LOG(gXULTemplateLog, LogLevel::Info, + MOZ_LOG(gXULTemplateLog, PR_LOG_ALWAYS, ("nsXULTemplateBuilder::UpdateResult %p %p %p", aOldResult, aNewResult, aQueryNode)); @@ -1711,7 +1711,7 @@ nsXULTemplateBuilder::CompileQueries() } // always enable logging if the debug setting is used - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) mFlags |= eLoggingEnabled; nsCOMPtr rootnode = do_QueryInterface(mRoot); diff --git a/dom/xul/templates/nsXULTemplateQueryProcessorRDF.cpp b/dom/xul/templates/nsXULTemplateQueryProcessorRDF.cpp index dddaef2826e8..b1864891cb9c 100644 --- a/dom/xul/templates/nsXULTemplateQueryProcessorRDF.cpp +++ b/dom/xul/templates/nsXULTemplateQueryProcessorRDF.cpp @@ -483,7 +483,7 @@ nsXULTemplateQueryProcessorRDF::GenerateResults(nsISupports* aDatasource, mLastRef = aRef; } - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { nsAutoString id; aRef->GetId(id); @@ -492,7 +492,7 @@ nsXULTemplateQueryProcessorRDF::GenerateResults(nsISupports* aDatasource, nsAutoString mvar; query->mMemberVariable->ToString(mvar); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_ALWAYS, ("QueryProcessor::GenerateResults using ref %s and vars [ ref: %s member: %s]", NS_ConvertUTF16toUTF8(id).get(), NS_ConvertUTF16toUTF8(rvar).get(), @@ -863,7 +863,7 @@ nsXULTemplateQueryProcessorRDF::Propagate(nsIRDFResource* aSource, ReteNodeSet livenodes; - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { const char* sourceStr; aSource->GetValueConst(&sourceStr); const char* propertyStr; @@ -871,7 +871,7 @@ nsXULTemplateQueryProcessorRDF::Propagate(nsIRDFResource* aSource, nsAutoString targetStr; nsXULContentUtils::GetTextForNode(aTarget, targetStr); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_ALWAYS, ("nsXULTemplateQueryProcessorRDF::Propagate: [%s] -> [%s] -> [%s]\n", sourceStr, propertyStr, NS_ConvertUTF16toUTF8(targetStr).get())); } @@ -950,7 +950,7 @@ nsXULTemplateQueryProcessorRDF::Retract(nsIRDFResource* aSource, nsIRDFNode* aTarget) { - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { const char* sourceStr; aSource->GetValueConst(&sourceStr); const char* propertyStr; @@ -958,7 +958,7 @@ nsXULTemplateQueryProcessorRDF::Retract(nsIRDFResource* aSource, nsAutoString targetStr; nsXULContentUtils::GetTextForNode(aTarget, targetStr); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_ALWAYS, ("nsXULTemplateQueryProcessorRDF::Retract: [%s] -> [%s] -> [%s]\n", sourceStr, propertyStr, NS_ConvertUTF16toUTF8(targetStr).get())); } @@ -1023,7 +1023,7 @@ nsXULTemplateQueryProcessorRDF::Log(const char* aOperation, nsIRDFResource* aProperty, nsIRDFNode* aTarget) { - if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) { nsresult rv; const char* sourceStr; @@ -1031,7 +1031,7 @@ nsXULTemplateQueryProcessorRDF::Log(const char* aOperation, if (NS_FAILED(rv)) return rv; - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("xultemplate[%p] %8s [%s]--", this, aOperation, sourceStr)); const char* propertyStr; @@ -1046,7 +1046,7 @@ nsXULTemplateQueryProcessorRDF::Log(const char* aOperation, nsAutoCString targetstrC; targetstrC.AssignWithConversion(targetStr); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, (" --[%s]-->[%s]", propertyStr, targetstrC.get())); @@ -1269,13 +1269,13 @@ nsXULTemplateQueryProcessorRDF::CompileQueryChild(nsIAtom* aTag, else if (aTag == nsGkAtoms::member) { rv = CompileMemberCondition(aQuery, aCondition, aParentNode, aResult); } - else if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Info)) { + else if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_ALWAYS)) { nsAutoString tagstr; aTag->ToString(tagstr); nsAutoCString tagstrC; tagstrC.AssignWithConversion(tagstr); - MOZ_LOG(gXULTemplateLog, LogLevel::Info, + MOZ_LOG(gXULTemplateLog, PR_LOG_ALWAYS, ("xultemplate[%p] unrecognized condition test <%s>", this, tagstrC.get())); } diff --git a/dom/xul/templates/nsXULTreeBuilder.cpp b/dom/xul/templates/nsXULTreeBuilder.cpp index f94fbd9d1c5c..d2a8d1c276a5 100644 --- a/dom/xul/templates/nsXULTreeBuilder.cpp +++ b/dom/xul/templates/nsXULTreeBuilder.cpp @@ -1230,7 +1230,7 @@ nsXULTreeBuilder::SynchronizeResult(nsIXULTemplateResult* aResult) if (row >= 0) mBoxObject->InvalidateRow(row); - MOZ_LOG(gXULTemplateLog, LogLevel::Debug, + MOZ_LOG(gXULTemplateLog, PR_LOG_DEBUG, ("xultemplate[%p] => row %d", this, row)); } diff --git a/extensions/auth/nsAuth.h b/extensions/auth/nsAuth.h index 6abee650e2b9..1a092dcb1381 100644 --- a/extensions/auth/nsAuth.h +++ b/extensions/auth/nsAuth.h @@ -22,6 +22,6 @@ enum pType { // extern PRLogModuleInfo* gNegotiateLog; -#define LOG(args) MOZ_LOG(gNegotiateLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gNegotiateLog, PR_LOG_DEBUG, args) #endif /* !defined( nsAuth_h__ ) */ diff --git a/extensions/auth/nsAuthGSSAPI.cpp b/extensions/auth/nsAuthGSSAPI.cpp index a07c8abfa26a..52d9bb0c82ab 100644 --- a/extensions/auth/nsAuthGSSAPI.cpp +++ b/extensions/auth/nsAuthGSSAPI.cpp @@ -232,7 +232,7 @@ gssInit() void LogGssError(OM_uint32 maj_stat, OM_uint32 min_stat, const char *prefix) { - if (!MOZ_LOG_TEST(gNegotiateLog, LogLevel::Debug)) { + if (!PR_LOG_TEST(gNegotiateLog, PR_LOG_DEBUG)) { return; } diff --git a/extensions/gio/nsGIOProtocolHandler.cpp b/extensions/gio/nsGIOProtocolHandler.cpp index 8172090f356e..5a4b4e877af9 100644 --- a/extensions/gio/nsGIOProtocolHandler.cpp +++ b/extensions/gio/nsGIOProtocolHandler.cpp @@ -29,7 +29,7 @@ // NSPR_LOG_MODULES=gio:5 static PRLogModuleInfo *sGIOLog; -#define LOG(args) MOZ_LOG(sGIOLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(sGIOLog, PR_LOG_DEBUG, args) //----------------------------------------------------------------------------- diff --git a/extensions/pref/autoconfig/src/nsAutoConfig.cpp b/extensions/pref/autoconfig/src/nsAutoConfig.cpp index f89097791063..f1e5e096f35d 100644 --- a/extensions/pref/autoconfig/src/nsAutoConfig.cpp +++ b/extensions/pref/autoconfig/src/nsAutoConfig.cpp @@ -22,8 +22,6 @@ #include "mozilla/Logging.h" -using mozilla::LogLevel; - PRLogModuleInfo *MCD; extern nsresult EvaluateAdminConfigScript(const char *js_buffer, size_t length, @@ -124,7 +122,7 @@ nsAutoConfig::OnStopRequest(nsIRequest *request, nsISupports *context, // If the request is failed, go read the failover.jsc file if (NS_FAILED(aStatus)) { - MOZ_LOG(MCD, LogLevel::Debug, ("mcd request failed with status %x\n", aStatus)); + MOZ_LOG(MCD, PR_LOG_DEBUG, ("mcd request failed with status %x\n", aStatus)); return readOfflineFile(); } @@ -135,7 +133,7 @@ nsAutoConfig::OnStopRequest(nsIRequest *request, nsISupports *context, pHTTPCon->GetResponseStatus(&httpStatus); if (httpStatus != 200) { - MOZ_LOG(MCD, LogLevel::Debug, ("mcd http request failed with status %x\n", httpStatus)); + MOZ_LOG(MCD, PR_LOG_DEBUG, ("mcd http request failed with status %x\n", httpStatus)); return readOfflineFile(); } } @@ -200,7 +198,7 @@ nsresult nsAutoConfig::downloadAutoConfig() static bool firstTime = true; if (mConfigURL.IsEmpty()) { - MOZ_LOG(MCD, LogLevel::Debug, ("global config url is empty - did you set autoadmin.global_config_url?\n")); + MOZ_LOG(MCD, PR_LOG_DEBUG, ("global config url is empty - did you set autoadmin.global_config_url?\n")); NS_WARNING("AutoConfig called without global_config_url"); return NS_OK; } @@ -274,11 +272,11 @@ nsresult nsAutoConfig::downloadAutoConfig() rv = NS_NewURI(getter_AddRefs(url), mConfigURL.get(), nullptr, nullptr); if (NS_FAILED(rv)) { - MOZ_LOG(MCD, LogLevel::Debug, ("failed to create URL - is autoadmin.global_config_url valid? - %s\n", mConfigURL.get())); + MOZ_LOG(MCD, PR_LOG_DEBUG, ("failed to create URL - is autoadmin.global_config_url valid? - %s\n", mConfigURL.get())); return rv; } - MOZ_LOG(MCD, LogLevel::Debug, ("running MCD url %s\n", mConfigURL.get())); + MOZ_LOG(MCD, PR_LOG_DEBUG, ("running MCD url %s\n", mConfigURL.get())); // open a channel for the url rv = NS_NewChannel(getter_AddRefs(channel), url, diff --git a/extensions/pref/autoconfig/src/nsReadConfig.cpp b/extensions/pref/autoconfig/src/nsReadConfig.cpp index df66b85a76d4..5802793d91eb 100644 --- a/extensions/pref/autoconfig/src/nsReadConfig.cpp +++ b/extensions/pref/autoconfig/src/nsReadConfig.cpp @@ -140,7 +140,7 @@ nsresult nsReadConfig::readConfigFile() getter_Copies(lockFileName)); - MOZ_LOG(MCD, LogLevel::Debug, ("general.config.filename = %s\n", lockFileName.get())); + MOZ_LOG(MCD, PR_LOG_DEBUG, ("general.config.filename = %s\n", lockFileName.get())); if (NS_FAILED(rv)) return rv; @@ -174,11 +174,11 @@ nsresult nsReadConfig::readConfigFile() int32_t obscureValue = 0; (void) defaultPrefBranch->GetIntPref("general.config.obscure_value", &obscureValue); - MOZ_LOG(MCD, LogLevel::Debug, ("evaluating .cfg file %s with obscureValue %d\n", lockFileName.get(), obscureValue)); + MOZ_LOG(MCD, PR_LOG_DEBUG, ("evaluating .cfg file %s with obscureValue %d\n", lockFileName.get(), obscureValue)); rv = openAndEvaluateJSFile(lockFileName.get(), obscureValue, true, true); if (NS_FAILED(rv)) { - MOZ_LOG(MCD, LogLevel::Debug, ("error evaluating .cfg file %s %x\n", lockFileName.get(), rv)); + MOZ_LOG(MCD, PR_LOG_DEBUG, ("error evaluating .cfg file %s %x\n", lockFileName.get(), rv)); return rv; } diff --git a/gfx/2d/Logging.h b/gfx/2d/Logging.h index 6a2ef12c8a72..f6d6155a6490 100644 --- a/gfx/2d/Logging.h +++ b/gfx/2d/Logging.h @@ -42,20 +42,20 @@ const int LOG_DEFAULT = LOG_EVERYTHING; const int LOG_DEFAULT = LOG_CRITICAL; #endif -inline mozilla::LogLevel PRLogLevelForLevel(int aLevel) { +inline PRLogModuleLevel PRLogLevelForLevel(int aLevel) { switch (aLevel) { case LOG_CRITICAL: - return LogLevel::Error; + return PR_LOG_ERROR; case LOG_WARNING: - return LogLevel::Warning; + return PR_LOG_WARNING; case LOG_DEBUG: - return LogLevel::Debug; + return PR_LOG_DEBUG; case LOG_DEBUG_PRLOG: - return LogLevel::Debug; + return PR_LOG_DEBUG; case LOG_EVERYTHING: - return LogLevel::Error; + return PR_LOG_ALWAYS; } - return LogLevel::Debug; + return PR_LOG_DEBUG; } class PreferenceAccess @@ -133,7 +133,7 @@ struct BasicLogger #if defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_ANDROID) return true; #else - if (MOZ_LOG_TEST(GetGFX2DLog(), PRLogLevelForLevel(aLevel))) { + if (PR_LOG_TEST(GetGFX2DLog(), PRLogLevelForLevel(aLevel))) { return true; } else if ((PreferenceAccess::sGfxLogLevel >= LOG_DEBUG_PRLOG) || (aLevel < LOG_DEBUG)) { @@ -160,7 +160,7 @@ struct BasicLogger #if defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_ANDROID) printf_stderr("%s%s", aString.c_str(), aNoNewline ? "" : "\n"); #else - if (MOZ_LOG_TEST(GetGFX2DLog(), PRLogLevelForLevel(aLevel))) { + if (PR_LOG_TEST(GetGFX2DLog(), PRLogLevelForLevel(aLevel))) { PR_LogPrint("%s%s", aString.c_str(), aNoNewline ? "" : "\n"); } else if ((PreferenceAccess::sGfxLogLevel >= LOG_DEBUG_PRLOG) || (aLevel < LOG_DEBUG)) { diff --git a/gfx/layers/Layers.cpp b/gfx/layers/Layers.cpp index 47af9590c06e..a65864055907 100644 --- a/gfx/layers/Layers.cpp +++ b/gfx/layers/Layers.cpp @@ -2070,7 +2070,7 @@ LayerManager::IsLogEnabled() { MOZ_ASSERT(!!sLog, "layer manager must be created before logging is allowed"); - return MOZ_LOG_TEST(sLog, LogLevel::Debug); + return PR_LOG_TEST(sLog, PR_LOG_DEBUG); } void diff --git a/gfx/layers/LayersTypes.h b/gfx/layers/LayersTypes.h index f889123001c4..b3c2d66a96fd 100644 --- a/gfx/layers/LayersTypes.h +++ b/gfx/layers/LayersTypes.h @@ -21,9 +21,9 @@ # define MOZ_LAYERS_HAVE_LOG #endif #define MOZ_LAYERS_LOG(_args) \ - MOZ_LOG(LayerManager::GetLog(), LogLevel::Debug, _args) + MOZ_LOG(LayerManager::GetLog(), PR_LOG_DEBUG, _args) #define MOZ_LAYERS_LOG_IF_SHADOWABLE(layer, _args) \ - do { if (layer->AsShadowableLayer()) { MOZ_LOG(LayerManager::GetLog(), LogLevel::Debug, _args); } } while (0) + do { if (layer->AsShadowableLayer()) { MOZ_LOG(LayerManager::GetLog(), PR_LOG_DEBUG, _args); } } while (0) #define INVALID_OVERLAY -1 diff --git a/gfx/thebes/gfxDWriteFontList.cpp b/gfx/thebes/gfxDWriteFontList.cpp index 17bd3af2f10f..ad31bf40cb27 100644 --- a/gfx/thebes/gfxDWriteFontList.cpp +++ b/gfx/thebes/gfxDWriteFontList.cpp @@ -28,20 +28,20 @@ using namespace mozilla; #define LOG_FONTLIST(args) MOZ_LOG(gfxPlatform::GetLog(eGfxLog_fontlist), \ - LogLevel::Debug, args) -#define LOG_FONTLIST_ENABLED() MOZ_LOG_TEST( \ + PR_LOG_DEBUG, args) +#define LOG_FONTLIST_ENABLED() PR_LOG_TEST( \ gfxPlatform::GetLog(eGfxLog_fontlist), \ - LogLevel::Debug) + PR_LOG_DEBUG) #define LOG_FONTINIT(args) MOZ_LOG(gfxPlatform::GetLog(eGfxLog_fontinit), \ - LogLevel::Debug, args) -#define LOG_FONTINIT_ENABLED() MOZ_LOG_TEST( \ + PR_LOG_DEBUG, args) +#define LOG_FONTINIT_ENABLED() PR_LOG_TEST( \ gfxPlatform::GetLog(eGfxLog_fontinit), \ - LogLevel::Debug) + PR_LOG_DEBUG) -#define LOG_CMAPDATA_ENABLED() MOZ_LOG_TEST( \ +#define LOG_CMAPDATA_ENABLED() PR_LOG_TEST( \ gfxPlatform::GetLog(eGfxLog_cmapdata), \ - LogLevel::Debug) + PR_LOG_DEBUG) static __inline void BuildKeyNameFromFontName(nsAString &aName) diff --git a/gfx/thebes/gfxFT2FontList.cpp b/gfx/thebes/gfxFT2FontList.cpp index adc76de1acc5..7ca5a5e7cff5 100644 --- a/gfx/thebes/gfxFT2FontList.cpp +++ b/gfx/thebes/gfxFT2FontList.cpp @@ -60,8 +60,8 @@ GetFontInfoLog() } #undef LOG -#define LOG(args) MOZ_LOG(GetFontInfoLog(), mozilla::LogLevel::Debug, args) -#define LOG_ENABLED() MOZ_LOG_TEST(GetFontInfoLog(), mozilla::LogLevel::Debug) +#define LOG(args) MOZ_LOG(GetFontInfoLog(), PR_LOG_DEBUG, args) +#define LOG_ENABLED() PR_LOG_TEST(GetFontInfoLog(), PR_LOG_DEBUG) static cairo_user_data_key_t sFTUserFontDataKey; diff --git a/gfx/thebes/gfxFcPlatformFontList.cpp b/gfx/thebes/gfxFcPlatformFontList.cpp index 003dce59d968..3b8c43198f37 100644 --- a/gfx/thebes/gfxFcPlatformFontList.cpp +++ b/gfx/thebes/gfxFcPlatformFontList.cpp @@ -37,13 +37,13 @@ using namespace mozilla::unicode; #define PRINTING_FC_PROPERTY "gfx.printing" #define LOG_FONTLIST(args) MOZ_LOG(gfxPlatform::GetLog(eGfxLog_fontlist), \ - LogLevel::Debug, args) -#define LOG_FONTLIST_ENABLED() MOZ_LOG_TEST( \ + PR_LOG_DEBUG, args) +#define LOG_FONTLIST_ENABLED() PR_LOG_TEST( \ gfxPlatform::GetLog(eGfxLog_fontlist), \ - LogLevel::Debug) -#define LOG_CMAPDATA_ENABLED() MOZ_LOG_TEST( \ + PR_LOG_DEBUG) +#define LOG_CMAPDATA_ENABLED() PR_LOG_TEST( \ gfxPlatform::GetLog(eGfxLog_cmapdata), \ - LogLevel::Debug) + PR_LOG_DEBUG) static const FcChar8* ToFcChar8Ptr(const char* aStr) diff --git a/gfx/thebes/gfxFont.cpp b/gfx/thebes/gfxFont.cpp index 8f2353e4c278..d714266ea9ec 100644 --- a/gfx/thebes/gfxFont.cpp +++ b/gfx/thebes/gfxFont.cpp @@ -73,10 +73,10 @@ uint32_t gGlyphExtentsSetupFallBackToTight = 0; #endif #define LOG_FONTINIT(args) MOZ_LOG(gfxPlatform::GetLog(eGfxLog_fontinit), \ - LogLevel::Debug, args) -#define LOG_FONTINIT_ENABLED() MOZ_LOG_TEST( \ + PR_LOG_DEBUG, args) +#define LOG_FONTINIT_ENABLED() PR_LOG_TEST( \ gfxPlatform::GetLog(eGfxLog_fontinit), \ - LogLevel::Debug) + PR_LOG_DEBUG) /* diff --git a/gfx/thebes/gfxFontEntry.cpp b/gfx/thebes/gfxFontEntry.cpp index 0d1139c12183..0d20957c1896 100644 --- a/gfx/thebes/gfxFontEntry.cpp +++ b/gfx/thebes/gfxFontEntry.cpp @@ -1480,10 +1480,10 @@ gfxFontFamily::FindFontForChar(GlobalFontMatch *aMatchData) PRLogModuleInfo *log = gfxPlatform::GetLog(eGfxLog_textrun); - if (MOZ_UNLIKELY(MOZ_LOG_TEST(log, LogLevel::Debug))) { + if (MOZ_UNLIKELY(PR_LOG_TEST(log, PR_LOG_DEBUG))) { uint32_t unicodeRange = FindCharUnicodeRange(aMatchData->mCh); uint32_t script = GetScriptCode(aMatchData->mCh); - MOZ_LOG(log, LogLevel::Debug,\ + MOZ_LOG(log, PR_LOG_DEBUG,\ ("(textrun-systemfallback-fonts) char: u+%6.6x " "unicode-range: %d script: %d match: [%s]\n", aMatchData->mCh, diff --git a/gfx/thebes/gfxFontUtils.cpp b/gfx/thebes/gfxFontUtils.cpp index f6d7af2a3b0e..144e82214cd8 100644 --- a/gfx/thebes/gfxFontUtils.cpp +++ b/gfx/thebes/gfxFontUtils.cpp @@ -27,7 +27,7 @@ #include "mozilla/Logging.h" #define LOG(log, args) MOZ_LOG(gfxPlatform::GetLog(log), \ - LogLevel::Debug, args) + PR_LOG_DEBUG, args) #define UNICODE_BMP_LIMIT 0x10000 diff --git a/gfx/thebes/gfxGDIFontList.cpp b/gfx/thebes/gfxGDIFontList.cpp index 7a20e2b0eab1..ee40d55dfbf2 100644 --- a/gfx/thebes/gfxGDIFontList.cpp +++ b/gfx/thebes/gfxGDIFontList.cpp @@ -41,14 +41,14 @@ using namespace mozilla; #endif #define LOG_FONTLIST(args) MOZ_LOG(gfxPlatform::GetLog(eGfxLog_fontlist), \ - LogLevel::Debug, args) -#define LOG_FONTLIST_ENABLED() MOZ_LOG_TEST( \ + PR_LOG_DEBUG, args) +#define LOG_FONTLIST_ENABLED() PR_LOG_TEST( \ gfxPlatform::GetLog(eGfxLog_fontlist), \ - LogLevel::Debug) + PR_LOG_DEBUG) -#define LOG_CMAPDATA_ENABLED() MOZ_LOG_TEST( \ +#define LOG_CMAPDATA_ENABLED() PR_LOG_TEST( \ gfxPlatform::GetLog(eGfxLog_cmapdata), \ - LogLevel::Debug) + PR_LOG_DEBUG) static __inline void BuildKeyNameFromFontName(nsAString &aName) diff --git a/gfx/thebes/gfxMacPlatformFontList.mm b/gfx/thebes/gfxMacPlatformFontList.mm index 91f1c721bac8..55a1f190f698 100644 --- a/gfx/thebes/gfxMacPlatformFontList.mm +++ b/gfx/thebes/gfxMacPlatformFontList.mm @@ -130,13 +130,13 @@ static NSString* GetNSStringForString(const nsAString& aSrc) } #define LOG_FONTLIST(args) MOZ_LOG(gfxPlatform::GetLog(eGfxLog_fontlist), \ - mozilla::LogLevel::Debug, args) -#define LOG_FONTLIST_ENABLED() MOZ_LOG_TEST( \ + PR_LOG_DEBUG, args) +#define LOG_FONTLIST_ENABLED() PR_LOG_TEST( \ gfxPlatform::GetLog(eGfxLog_fontlist), \ - mozilla::LogLevel::Debug) -#define LOG_CMAPDATA_ENABLED() MOZ_LOG_TEST( \ + PR_LOG_DEBUG) +#define LOG_CMAPDATA_ENABLED() PR_LOG_TEST( \ gfxPlatform::GetLog(eGfxLog_cmapdata), \ - mozilla::LogLevel::Debug) + PR_LOG_DEBUG) #pragma mark- diff --git a/gfx/thebes/gfxPlatformFontList.cpp b/gfx/thebes/gfxPlatformFontList.cpp index 4c0ed0f15b93..186b6041f4c2 100644 --- a/gfx/thebes/gfxPlatformFontList.cpp +++ b/gfx/thebes/gfxPlatformFontList.cpp @@ -24,15 +24,15 @@ using namespace mozilla; #define LOG_FONTLIST(args) MOZ_LOG(gfxPlatform::GetLog(eGfxLog_fontlist), \ - LogLevel::Debug, args) -#define LOG_FONTLIST_ENABLED() MOZ_LOG_TEST( \ + PR_LOG_DEBUG, args) +#define LOG_FONTLIST_ENABLED() PR_LOG_TEST( \ gfxPlatform::GetLog(eGfxLog_fontlist), \ - LogLevel::Debug) + PR_LOG_DEBUG) #define LOG_FONTINIT(args) MOZ_LOG(gfxPlatform::GetLog(eGfxLog_fontinit), \ - LogLevel::Debug, args) -#define LOG_FONTINIT_ENABLED() MOZ_LOG_TEST( \ + PR_LOG_DEBUG, args) +#define LOG_FONTINIT_ENABLED() PR_LOG_TEST( \ gfxPlatform::GetLog(eGfxLog_fontinit), \ - LogLevel::Debug) + PR_LOG_DEBUG) gfxPlatformFontList *gfxPlatformFontList::sPlatformFontList = nullptr; @@ -580,10 +580,10 @@ gfxPlatformFontList::SystemFindFontForChar(uint32_t aCh, uint32_t aNextCh, PRLogModuleInfo *log = gfxPlatform::GetLog(eGfxLog_textrun); - if (MOZ_UNLIKELY(MOZ_LOG_TEST(log, LogLevel::Warning))) { + if (MOZ_UNLIKELY(PR_LOG_TEST(log, PR_LOG_WARNING))) { uint32_t unicodeRange = FindCharUnicodeRange(aCh); int32_t script = mozilla::unicode::GetScriptCode(aCh); - MOZ_LOG(log, LogLevel::Warning,\ + MOZ_LOG(log, PR_LOG_WARNING,\ ("(textrun-systemfallback-%s) char: u+%6.6x " "unicode-range: %d script: %d match: [%s]" " time: %dus cmaps: %d\n", diff --git a/gfx/thebes/gfxTextRun.cpp b/gfx/thebes/gfxTextRun.cpp index e00defe16ada..7515de1bf460 100644 --- a/gfx/thebes/gfxTextRun.cpp +++ b/gfx/thebes/gfxTextRun.cpp @@ -2223,13 +2223,13 @@ gfxFontGroup::InitTextRun(gfxContext *aContext, if (sizeof(T) == sizeof(uint8_t) && !transformedString) { - if (MOZ_UNLIKELY(MOZ_LOG_TEST(log, LogLevel::Warning))) { + if (MOZ_UNLIKELY(PR_LOG_TEST(log, PR_LOG_WARNING))) { nsAutoCString lang; mStyle.language->ToUTF8String(lang); nsAutoString families; mFamilyList.ToString(families); nsAutoCString str((const char*)aString, aLength); - MOZ_LOG(log, LogLevel::Warning,\ + MOZ_LOG(log, PR_LOG_WARNING,\ ("(%s) fontgroup: [%s] default: %s lang: %s script: %d " "len %d weight: %d width: %d style: %s size: %6.2f %d-byte " "TEXTRUN [%s] ENDTEXTRUN\n", @@ -2271,13 +2271,13 @@ gfxFontGroup::InitTextRun(gfxContext *aContext, int32_t runScript = MOZ_SCRIPT_LATIN; while (scriptRuns.Next(runStart, runLimit, runScript)) { - if (MOZ_UNLIKELY(MOZ_LOG_TEST(log, LogLevel::Warning))) { + if (MOZ_UNLIKELY(PR_LOG_TEST(log, PR_LOG_WARNING))) { nsAutoCString lang; mStyle.language->ToUTF8String(lang); nsAutoString families; mFamilyList.ToString(families); uint32_t runLen = runLimit - runStart; - MOZ_LOG(log, LogLevel::Warning,\ + MOZ_LOG(log, PR_LOG_WARNING,\ ("(%s) fontgroup: [%s] default: %s lang: %s script: %d " "len %d weight: %d width: %d style: %s size: %6.2f " "%d-byte TEXTRUN [%s] ENDTEXTRUN\n", diff --git a/gfx/thebes/gfxUserFontSet.cpp b/gfx/thebes/gfxUserFontSet.cpp index 1cbb472c97f0..dc97eb690e74 100644 --- a/gfx/thebes/gfxUserFontSet.cpp +++ b/gfx/thebes/gfxUserFontSet.cpp @@ -33,8 +33,8 @@ gfxUserFontSet::GetUserFontsLog() return sLog; } -#define LOG(args) MOZ_LOG(gfxUserFontSet::GetUserFontsLog(), mozilla::LogLevel::Debug, args) -#define LOG_ENABLED() MOZ_LOG_TEST(gfxUserFontSet::GetUserFontsLog(), mozilla::LogLevel::Debug) +#define LOG(args) MOZ_LOG(gfxUserFontSet::GetUserFontsLog(), PR_LOG_DEBUG, args) +#define LOG_ENABLED() PR_LOG_TEST(gfxUserFontSet::GetUserFontsLog(), PR_LOG_DEBUG) static uint64_t sFontSetGeneration = 0; diff --git a/hal/HalLog.h b/hal/HalLog.h index 7cdc9d88794b..5bab8d03537f 100644 --- a/hal/HalLog.h +++ b/hal/HalLog.h @@ -22,9 +22,9 @@ namespace hal { extern PRLogModuleInfo *GetHalLog(); #define HAL_LOG(...) \ - MOZ_LOG(mozilla::hal::GetHalLog(), LogLevel::Debug, (__VA_ARGS__)) + MOZ_LOG(mozilla::hal::GetHalLog(), PR_LOG_DEBUG, (__VA_ARGS__)) #define HAL_ERR(...) \ - MOZ_LOG(mozilla::hal::GetHalLog(), LogLevel::Error, (__VA_ARGS__)) + MOZ_LOG(mozilla::hal::GetHalLog(), PR_LOG_ERROR, (__VA_ARGS__)) } // namespace hal diff --git a/image/ImageLogging.h b/image/ImageLogging.h index 2c3b68d2ba70..f3bf8f78579f 100644 --- a/image/ImageLogging.h +++ b/image/ImageLogging.h @@ -16,8 +16,6 @@ extern PRLogModuleInfo* GetImgLog(); #define GIVE_ME_MS_NOW() PR_IntervalToMilliseconds(PR_IntervalNow()) -using mozilla::LogLevel; - class LogScope { public: @@ -26,7 +24,7 @@ public: , mFrom(aFrom) , mFunc(aFunc) { - MOZ_LOG(mLog, LogLevel::Debug, ("%d [this=%p] %s {ENTER}\n", + MOZ_LOG(mLog, PR_LOG_DEBUG, ("%d [this=%p] %s {ENTER}\n", GIVE_ME_MS_NOW(), mFrom, mFunc)); } @@ -37,7 +35,7 @@ public: , mFrom(from) , mFunc(fn) { - MOZ_LOG(mLog, LogLevel::Debug, ("%d [this=%p] %s (%s=\"%s\") {ENTER}\n", + MOZ_LOG(mLog, PR_LOG_DEBUG, ("%d [this=%p] %s (%s=\"%s\") {ENTER}\n", GIVE_ME_MS_NOW(), mFrom, mFunc, paramName, paramValue)); } @@ -49,7 +47,7 @@ public: , mFrom(from) , mFunc(fn) { - MOZ_LOG(mLog, LogLevel::Debug, ("%d [this=%p] %s (%s=%p) {ENTER}\n", + MOZ_LOG(mLog, PR_LOG_DEBUG, ("%d [this=%p] %s (%s=%p) {ENTER}\n", GIVE_ME_MS_NOW(), mFrom, mFunc, paramName, paramValue)); } @@ -61,7 +59,7 @@ public: , mFrom(from) , mFunc(fn) { - MOZ_LOG(mLog, LogLevel::Debug, ("%d [this=%p] %s (%s=\"%d\") {ENTER}\n", + MOZ_LOG(mLog, PR_LOG_DEBUG, ("%d [this=%p] %s (%s=\"%d\") {ENTER}\n", GIVE_ME_MS_NOW(), mFrom, mFunc, paramName, paramValue)); } @@ -73,14 +71,14 @@ public: , mFrom(from) , mFunc(fn) { - MOZ_LOG(mLog, LogLevel::Debug, ("%d [this=%p] %s (%s=\"%d\") {ENTER}\n", + MOZ_LOG(mLog, PR_LOG_DEBUG, ("%d [this=%p] %s (%s=\"%d\") {ENTER}\n", GIVE_ME_MS_NOW(), mFrom, mFunc, paramName, paramValue)); } ~LogScope() { - MOZ_LOG(mLog, LogLevel::Debug, ("%d [this=%p] %s {EXIT}\n", + MOZ_LOG(mLog, PR_LOG_DEBUG, ("%d [this=%p] %s {EXIT}\n", GIVE_ME_MS_NOW(), mFrom, mFunc)); } @@ -94,14 +92,14 @@ class LogFunc { public: LogFunc(PRLogModuleInfo* aLog, void* from, const char* fn) { - MOZ_LOG(aLog, LogLevel::Debug, ("%d [this=%p] %s\n", + MOZ_LOG(aLog, PR_LOG_DEBUG, ("%d [this=%p] %s\n", GIVE_ME_MS_NOW(), from, fn)); } LogFunc(PRLogModuleInfo* aLog, void* from, const char* fn, const char* paramName, const char* paramValue) { - MOZ_LOG(aLog, LogLevel::Debug, ("%d [this=%p] %s (%s=\"%s\")\n", + MOZ_LOG(aLog, PR_LOG_DEBUG, ("%d [this=%p] %s (%s=\"%s\")\n", GIVE_ME_MS_NOW(), from, fn, paramName, paramValue)); } @@ -109,7 +107,7 @@ public: LogFunc(PRLogModuleInfo* aLog, void* from, const char* fn, const char* paramName, const void* paramValue) { - MOZ_LOG(aLog, LogLevel::Debug, ("%d [this=%p] %s (%s=\"%p\")\n", + MOZ_LOG(aLog, PR_LOG_DEBUG, ("%d [this=%p] %s (%s=\"%p\")\n", GIVE_ME_MS_NOW(), from, fn, paramName, paramValue)); } @@ -118,7 +116,7 @@ public: LogFunc(PRLogModuleInfo* aLog, void* from, const char* fn, const char* paramName, uint32_t paramValue) { - MOZ_LOG(aLog, LogLevel::Debug, ("%d [this=%p] %s (%s=\"%d\")\n", + MOZ_LOG(aLog, PR_LOG_DEBUG, ("%d [this=%p] %s (%s=\"%d\")\n", GIVE_ME_MS_NOW(), from, fn, paramName, paramValue)); } @@ -131,7 +129,7 @@ public: LogMessage(PRLogModuleInfo* aLog, void* from, const char* fn, const char* msg) { - MOZ_LOG(aLog, LogLevel::Debug, ("%d [this=%p] %s -- %s\n", + MOZ_LOG(aLog, PR_LOG_DEBUG, ("%d [this=%p] %s -- %s\n", GIVE_ME_MS_NOW(), from, fn, msg)); } }; diff --git a/image/ProgressTracker.cpp b/image/ProgressTracker.cpp index 0c17f1e4cab9..9848d9971da6 100644 --- a/image/ProgressTracker.cpp +++ b/image/ProgressTracker.cpp @@ -164,7 +164,7 @@ ProgressTracker::Notify(IProgressObserver* aObserver) { MOZ_ASSERT(NS_IsMainThread()); - if (MOZ_LOG_TEST(GetImgLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) { nsRefPtr image = GetImage(); if (image && image->GetURI()) { nsRefPtr uri(image->GetURI()); @@ -233,7 +233,7 @@ ProgressTracker::NotifyCurrentState(IProgressObserver* aObserver) { MOZ_ASSERT(NS_IsMainThread()); - if (MOZ_LOG_TEST(GetImgLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) { nsRefPtr image = GetImage(); nsAutoCString spec; if (image && image->GetURI()) { diff --git a/image/RasterImage.cpp b/image/RasterImage.cpp index 939d9c84ef3c..b4526de6fb29 100644 --- a/image/RasterImage.cpp +++ b/image/RasterImage.cpp @@ -83,7 +83,7 @@ static int32_t sMaxDecodeCount = 0; */ #define LOG_CONTAINER_ERROR \ PR_BEGIN_MACRO \ - MOZ_LOG (GetImgLog(), LogLevel::Error, \ + PR_LOG (GetImgLog(), PR_LOG_ERROR, \ ("RasterImage: [this=%p] Error " \ "detected at line %u for image of " \ "type %s\n", this, __LINE__, \ diff --git a/image/decoders/nsBMPDecoder.cpp b/image/decoders/nsBMPDecoder.cpp index 03437f9dddc3..f51c8119469f 100644 --- a/image/decoders/nsBMPDecoder.cpp +++ b/image/decoders/nsBMPDecoder.cpp @@ -336,7 +336,7 @@ nsBMPDecoder::WriteInternal(const char* aBuffer, uint32_t aCount) mProcessedHeader = true; ProcessInfoHeader(); - MOZ_LOG(GetBMPLog(), LogLevel::Debug, + MOZ_LOG(GetBMPLog(), PR_LOG_DEBUG, ("BMP is %lix%lix%lu. compression=%lu\n", mBIH.width, mBIH.height, mBIH.bpp, mBIH.compression)); // Verify we support this bit depth @@ -405,20 +405,20 @@ nsBMPDecoder::WriteInternal(const char* aBuffer, uint32_t aCount) // If we have RLE4 or RLE8 or BI_ALPHABITFIELDS, then ensure we // have valid BPP values before adding the frame if (mBIH.compression == BI_RLE8 && mBIH.bpp != 8) { - MOZ_LOG(GetBMPLog(), LogLevel::Debug, + MOZ_LOG(GetBMPLog(), PR_LOG_DEBUG, ("BMP RLE8 compression only supports 8 bits per pixel\n")); PostDataError(); return; } if (mBIH.compression == BI_RLE4 && mBIH.bpp != 4 && mBIH.bpp != 1) { - MOZ_LOG(GetBMPLog(), LogLevel::Debug, + MOZ_LOG(GetBMPLog(), PR_LOG_DEBUG, ("BMP RLE4 compression only supports 4 bits per pixel\n")); PostDataError(); return; } if (mBIH.compression == BI_ALPHABITFIELDS && mBIH.bpp != 16 && mBIH.bpp != 32) { - MOZ_LOG(GetBMPLog(), LogLevel::Debug, + MOZ_LOG(GetBMPLog(), PR_LOG_DEBUG, ("BMP ALPHABITFIELDS only supports 16 or 32 bits per pixel\n" )); PostDataError(); @@ -690,7 +690,7 @@ nsBMPDecoder::WriteInternal(const char* aBuffer, uint32_t aCount) if (((mBIH.compression == BI_RLE8) && (mBIH.bpp != 8)) || ((mBIH.compression == BI_RLE4) && (mBIH.bpp != 4) && (mBIH.bpp != 1))) { - MOZ_LOG(GetBMPLog(), LogLevel::Debug, + MOZ_LOG(GetBMPLog(), PR_LOG_DEBUG, ("BMP RLE8/RLE4 compression only supports 8/4 bits per" " pixel\n")); PostDataError(); diff --git a/image/decoders/nsJPEGDecoder.cpp b/image/decoders/nsJPEGDecoder.cpp index 63e95a95b834..b3e448e2cef9 100644 --- a/image/decoders/nsJPEGDecoder.cpp +++ b/image/decoders/nsJPEGDecoder.cpp @@ -105,7 +105,7 @@ nsJPEGDecoder::nsJPEGDecoder(RasterImage* aImage, mCMSMode = 0; - MOZ_LOG(GetJPEGDecoderAccountingLog(), LogLevel::Debug, + MOZ_LOG(GetJPEGDecoderAccountingLog(), PR_LOG_DEBUG, ("nsJPEGDecoder::nsJPEGDecoder: Creating JPEG decoder %p", this)); } @@ -124,7 +124,7 @@ nsJPEGDecoder::~nsJPEGDecoder() qcms_profile_release(mInProfile); } - MOZ_LOG(GetJPEGDecoderAccountingLog(), LogLevel::Debug, + MOZ_LOG(GetJPEGDecoderAccountingLog(), PR_LOG_DEBUG, ("nsJPEGDecoder::~nsJPEGDecoder: Destroying JPEG decoder %p", this)); } @@ -218,7 +218,7 @@ nsJPEGDecoder::WriteInternal(const char* aBuffer, uint32_t aCount) // Error due to corrupt stream - return NS_OK and consume silently // so that ImageLib doesn't throw away a partial image load mState = JPEG_SINK_NON_JPEG_TRAILER; - MOZ_LOG(GetJPEGDecoderAccountingLog(), LogLevel::Debug, + MOZ_LOG(GetJPEGDecoderAccountingLog(), PR_LOG_DEBUG, ("} (setjmp returned NS_ERROR_FAILURE)")); return; } else { @@ -227,13 +227,13 @@ nsJPEGDecoder::WriteInternal(const char* aBuffer, uint32_t aCount) // mozilla is seconds away from falling flat on its face. PostDecoderError(error_code); mState = JPEG_ERROR; - MOZ_LOG(GetJPEGDecoderAccountingLog(), LogLevel::Debug, + MOZ_LOG(GetJPEGDecoderAccountingLog(), PR_LOG_DEBUG, ("} (setjmp returned an error)")); return; } } - MOZ_LOG(GetJPEGLog(), LogLevel::Debug, + MOZ_LOG(GetJPEGLog(), PR_LOG_DEBUG, ("[this=%p] nsJPEGDecoder::Write -- processing JPEG data\n", this)); switch (mState) { @@ -243,7 +243,7 @@ nsJPEGDecoder::WriteInternal(const char* aBuffer, uint32_t aCount) // Step 3: read file parameters with jpeg_read_header() if (jpeg_read_header(&mInfo, TRUE) == JPEG_SUSPENDED) { - MOZ_LOG(GetJPEGDecoderAccountingLog(), LogLevel::Debug, + MOZ_LOG(GetJPEGDecoderAccountingLog(), PR_LOG_DEBUG, ("} (JPEG_SUSPENDED)")); return; // I/O suspension } @@ -309,7 +309,7 @@ nsJPEGDecoder::WriteInternal(const char* aBuffer, uint32_t aCount) default: mState = JPEG_ERROR; PostDataError(); - MOZ_LOG(GetJPEGDecoderAccountingLog(), LogLevel::Debug, + MOZ_LOG(GetJPEGDecoderAccountingLog(), PR_LOG_DEBUG, ("} (unknown colorpsace (1))")); return; } @@ -326,7 +326,7 @@ nsJPEGDecoder::WriteInternal(const char* aBuffer, uint32_t aCount) default: mState = JPEG_ERROR; PostDataError(); - MOZ_LOG(GetJPEGDecoderAccountingLog(), LogLevel::Debug, + MOZ_LOG(GetJPEGDecoderAccountingLog(), PR_LOG_DEBUG, ("} (unknown colorpsace (2))")); return; } @@ -385,7 +385,7 @@ nsJPEGDecoder::WriteInternal(const char* aBuffer, uint32_t aCount) default: mState = JPEG_ERROR; PostDataError(); - MOZ_LOG(GetJPEGDecoderAccountingLog(), LogLevel::Debug, + MOZ_LOG(GetJPEGDecoderAccountingLog(), PR_LOG_DEBUG, ("} (unknown colorpsace (3))")); return; } @@ -399,7 +399,7 @@ nsJPEGDecoder::WriteInternal(const char* aBuffer, uint32_t aCount) if (!mImageData) { mState = JPEG_ERROR; PostDecoderError(NS_ERROR_OUT_OF_MEMORY); - MOZ_LOG(GetJPEGDecoderAccountingLog(), LogLevel::Debug, + MOZ_LOG(GetJPEGDecoderAccountingLog(), PR_LOG_DEBUG, ("} (could not initialize image frame)")); return; } @@ -414,7 +414,7 @@ nsJPEGDecoder::WriteInternal(const char* aBuffer, uint32_t aCount) } } - MOZ_LOG(GetJPEGDecoderAccountingLog(), LogLevel::Debug, + MOZ_LOG(GetJPEGDecoderAccountingLog(), PR_LOG_DEBUG, (" JPEGDecoderAccounting: nsJPEGDecoder::" "Write -- created image frame with %ux%u pixels", mInfo.output_width, mInfo.output_height)); @@ -438,7 +438,7 @@ nsJPEGDecoder::WriteInternal(const char* aBuffer, uint32_t aCount) // Step 5: Start decompressor if (jpeg_start_decompress(&mInfo) == FALSE) { - MOZ_LOG(GetJPEGDecoderAccountingLog(), LogLevel::Debug, + MOZ_LOG(GetJPEGDecoderAccountingLog(), PR_LOG_DEBUG, ("} (I/O suspension after jpeg_start_decompress())")); return; // I/O suspension } @@ -457,7 +457,7 @@ nsJPEGDecoder::WriteInternal(const char* aBuffer, uint32_t aCount) OutputScanlines(&suspend); if (suspend) { - MOZ_LOG(GetJPEGDecoderAccountingLog(), LogLevel::Debug, + MOZ_LOG(GetJPEGDecoderAccountingLog(), PR_LOG_DEBUG, ("} (I/O suspension after OutputScanlines() - SEQUENTIAL)")); return; // I/O suspension } @@ -493,7 +493,7 @@ nsJPEGDecoder::WriteInternal(const char* aBuffer, uint32_t aCount) scan--; if (!jpeg_start_output(&mInfo, scan)) { - MOZ_LOG(GetJPEGDecoderAccountingLog(), LogLevel::Debug, + MOZ_LOG(GetJPEGDecoderAccountingLog(), PR_LOG_DEBUG, ("} (I/O suspension after jpeg_start_output() -" " PROGRESSIVE)")); return; // I/O suspension @@ -513,14 +513,14 @@ nsJPEGDecoder::WriteInternal(const char* aBuffer, uint32_t aCount) // jpeg_start_output() multiple times for the same scan mInfo.output_scanline = 0xffffff; } - MOZ_LOG(GetJPEGDecoderAccountingLog(), LogLevel::Debug, + MOZ_LOG(GetJPEGDecoderAccountingLog(), PR_LOG_DEBUG, ("} (I/O suspension after OutputScanlines() - PROGRESSIVE)")); return; // I/O suspension } if (mInfo.output_scanline == mInfo.output_height) { if (!jpeg_finish_output(&mInfo)) { - MOZ_LOG(GetJPEGDecoderAccountingLog(), LogLevel::Debug, + MOZ_LOG(GetJPEGDecoderAccountingLog(), PR_LOG_DEBUG, ("} (I/O suspension after jpeg_finish_output() -" " PROGRESSIVE)")); return; // I/O suspension @@ -548,7 +548,7 @@ nsJPEGDecoder::WriteInternal(const char* aBuffer, uint32_t aCount) // Step 7: Finish decompression if (jpeg_finish_decompress(&mInfo) == FALSE) { - MOZ_LOG(GetJPEGDecoderAccountingLog(), LogLevel::Debug, + MOZ_LOG(GetJPEGDecoderAccountingLog(), PR_LOG_DEBUG, ("} (I/O suspension after jpeg_finish_decompress() - DONE)")); return; // I/O suspension } @@ -559,7 +559,7 @@ nsJPEGDecoder::WriteInternal(const char* aBuffer, uint32_t aCount) break; } case JPEG_SINK_NON_JPEG_TRAILER: - MOZ_LOG(GetJPEGLog(), LogLevel::Debug, + MOZ_LOG(GetJPEGLog(), PR_LOG_DEBUG, ("[this=%p] nsJPEGDecoder::ProcessData -- entering" " JPEG_SINK_NON_JPEG_TRAILER case\n", this)); @@ -571,7 +571,7 @@ nsJPEGDecoder::WriteInternal(const char* aBuffer, uint32_t aCount) "decoder"); } - MOZ_LOG(GetJPEGDecoderAccountingLog(), LogLevel::Debug, + MOZ_LOG(GetJPEGDecoderAccountingLog(), PR_LOG_DEBUG, ("} (end of function)")); return; } diff --git a/image/decoders/nsPNGDecoder.cpp b/image/decoders/nsPNGDecoder.cpp index bc5286a11330..3b79a2b0d80a 100644 --- a/image/decoders/nsPNGDecoder.cpp +++ b/image/decoders/nsPNGDecoder.cpp @@ -169,7 +169,7 @@ void nsPNGDecoder::CreateFrame(png_uint_32 x_offset, png_uint_32 y_offset, mFrameRect = neededRect; - MOZ_LOG(GetPNGDecoderAccountingLog(), LogLevel::Debug, + MOZ_LOG(GetPNGDecoderAccountingLog(), PR_LOG_DEBUG, ("PNGDecoderAccounting: nsPNGDecoder::CreateFrame -- created " "image frame with %dx%d pixels in container %p", width, height, @@ -879,7 +879,7 @@ nsPNGDecoder::end_callback(png_structp png_ptr, png_infop info_ptr) void nsPNGDecoder::error_callback(png_structp png_ptr, png_const_charp error_msg) { - MOZ_LOG(GetPNGLog(), LogLevel::Error, ("libpng error: %s\n", error_msg)); + MOZ_LOG(GetPNGLog(), PR_LOG_ERROR, ("libpng error: %s\n", error_msg)); png_longjmp(png_ptr, 1); } @@ -887,7 +887,7 @@ nsPNGDecoder::error_callback(png_structp png_ptr, png_const_charp error_msg) void nsPNGDecoder::warning_callback(png_structp png_ptr, png_const_charp warning_msg) { - MOZ_LOG(GetPNGLog(), LogLevel::Warning, ("libpng warning: %s\n", warning_msg)); + MOZ_LOG(GetPNGLog(), PR_LOG_WARNING, ("libpng warning: %s\n", warning_msg)); } Telemetry::ID diff --git a/image/encoders/png/nsPNGEncoder.cpp b/image/encoders/png/nsPNGEncoder.cpp index 0e755d96dd4a..e4d57a1263b2 100644 --- a/image/encoders/png/nsPNGEncoder.cpp +++ b/image/encoders/png/nsPNGEncoder.cpp @@ -697,7 +697,7 @@ void nsPNGEncoder::WarningCallback(png_structp png_ptr, png_const_charp warning_msg) { - MOZ_LOG(GetPNGEncoderLog(), LogLevel::Warning, + MOZ_LOG(GetPNGEncoderLog(), PR_LOG_WARNING, ("libpng warning: %s\n", warning_msg)); } @@ -708,7 +708,7 @@ void nsPNGEncoder::ErrorCallback(png_structp png_ptr, png_const_charp error_msg) { - MOZ_LOG(GetPNGEncoderLog(), LogLevel::Error, ("libpng error: %s\n", error_msg)); + MOZ_LOG(GetPNGEncoderLog(), PR_LOG_ERROR, ("libpng error: %s\n", error_msg)); png_longjmp(png_ptr, 1); } diff --git a/image/imgLoader.cpp b/image/imgLoader.cpp index b4b444dc82ed..39d16fd050b6 100644 --- a/image/imgLoader.cpp +++ b/image/imgLoader.cpp @@ -894,7 +894,7 @@ imgCacheEntry::UpdateCache(int32_t diff /* = 0 */) void imgCacheEntry::SetHasNoProxies(bool hasNoProxies) { - if (MOZ_LOG_TEST(GetImgLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) { if (hasNoProxies) { LOG_FUNC_WITH_PARAM(GetImgLog(), "imgCacheEntry::SetHasNoProxies true", "uri", mRequest->CacheKey().Spec()); @@ -1072,7 +1072,7 @@ imgCacheExpirationTracker::NotifyExpired(imgCacheEntry* entry) // mechanism doesn't. nsRefPtr kungFuDeathGrip(entry); - if (MOZ_LOG_TEST(GetImgLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) { nsRefPtr req = entry->GetRequest(); if (req) { LOG_FUNC_WITH_PARAM(GetImgLog(), @@ -1400,20 +1400,20 @@ imgLoader::PutIntoCache(const ImageCacheKey& aKey, imgCacheEntry* entry) // replace the old version. nsRefPtr tmpCacheEntry; if (cache.Get(aKey, getter_AddRefs(tmpCacheEntry)) && tmpCacheEntry) { - MOZ_LOG(GetImgLog(), LogLevel::Debug, + MOZ_LOG(GetImgLog(), PR_LOG_DEBUG, ("[this=%p] imgLoader::PutIntoCache -- Element already in the cache", nullptr)); nsRefPtr tmpRequest = tmpCacheEntry->GetRequest(); // If it already exists, and we're putting the same key into the cache, we // should remove the old version. - MOZ_LOG(GetImgLog(), LogLevel::Debug, + MOZ_LOG(GetImgLog(), PR_LOG_DEBUG, ("[this=%p] imgLoader::PutIntoCache -- Replacing cached element", nullptr)); RemoveFromCache(aKey); } else { - MOZ_LOG(GetImgLog(), LogLevel::Debug, + MOZ_LOG(GetImgLog(), PR_LOG_DEBUG, ("[this=%p] imgLoader::PutIntoCache --" " Element NOT already in the cache", nullptr)); } @@ -1533,7 +1533,7 @@ imgLoader::CheckCacheLimits(imgCacheTable& cache, imgCacheQueue& queue) NS_ASSERTION(entry, "imgLoader::CheckCacheLimits -- NULL entry pointer"); - if (MOZ_LOG_TEST(GetImgLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) { nsRefPtr req = entry->GetRequest(); if (req) { LOG_STATIC_FUNC_WITH_PARAM(GetImgLog(), @@ -1766,14 +1766,14 @@ imgLoader::ValidateEntry(imgCacheEntry* aEntry, // Determine whether the cache aEntry must be revalidated... validateRequest = ShouldRevalidateEntry(aEntry, aLoadFlags, hasExpired); - MOZ_LOG(GetImgLog(), LogLevel::Debug, + MOZ_LOG(GetImgLog(), PR_LOG_DEBUG, ("imgLoader::ValidateEntry validating cache entry. " "validateRequest = %d", validateRequest)); - } else if (!key && MOZ_LOG_TEST(GetImgLog(), LogLevel::Debug)) { + } else if (!key && PR_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) { nsAutoCString spec; aURI->GetSpec(spec); - MOZ_LOG(GetImgLog(), LogLevel::Debug, + MOZ_LOG(GetImgLog(), PR_LOG_DEBUG, ("imgLoader::ValidateEntry BYPASSING cache validation for %s " "because of NULL LoadID", spec.get())); } @@ -1791,7 +1791,7 @@ imgLoader::ValidateEntry(imgCacheEntry* aEntry, } if (requestAppCache != groupAppCache) { - MOZ_LOG(GetImgLog(), LogLevel::Debug, + MOZ_LOG(GetImgLog(), PR_LOG_DEBUG, ("imgLoader::ValidateEntry - Unable to use cached imgRequest " "[request=%p] because of mismatched application caches\n", address_of(request))); @@ -2165,7 +2165,7 @@ imgLoader::LoadImage(nsIURI* aURI, getter_AddRefs(request), getter_AddRefs(entry)); - MOZ_LOG(GetImgLog(), LogLevel::Debug, + MOZ_LOG(GetImgLog(), PR_LOG_DEBUG, ("[this=%p] imgLoader::LoadImage -- Created new imgRequest" " [request=%p]\n", this, request.get())); @@ -2188,7 +2188,7 @@ imgLoader::LoadImage(nsIURI* aURI, // request. nsCOMPtr listener = pl; if (corsmode != imgIRequest::CORS_NONE) { - MOZ_LOG(GetImgLog(), LogLevel::Debug, + MOZ_LOG(GetImgLog(), PR_LOG_DEBUG, ("[this=%p] imgLoader::LoadImage -- Setting up a CORS load", this)); bool withCredentials = corsmode == imgIRequest::CORS_USE_CREDENTIALS; @@ -2197,7 +2197,7 @@ imgLoader::LoadImage(nsIURI* aURI, new nsCORSListenerProxy(pl, aLoadingPrincipal, withCredentials); rv = corsproxy->Init(newChannel, DataURIHandling::Allow); if (NS_FAILED(rv)) { - MOZ_LOG(GetImgLog(), LogLevel::Debug, + MOZ_LOG(GetImgLog(), PR_LOG_DEBUG, ("[this=%p] imgLoader::LoadImage -- nsCORSListenerProxy " "creation failed: 0x%x\n", this, rv)); request->CancelAndAbort(rv); @@ -2207,7 +2207,7 @@ imgLoader::LoadImage(nsIURI* aURI, listener = corsproxy; } - MOZ_LOG(GetImgLog(), LogLevel::Debug, + MOZ_LOG(GetImgLog(), PR_LOG_DEBUG, ("[this=%p] imgLoader::LoadImage -- Calling channel->AsyncOpen()\n", this)); @@ -2217,7 +2217,7 @@ imgLoader::LoadImage(nsIURI* aURI, nsresult openRes = newChannel->AsyncOpen(listener, nullptr); if (NS_FAILED(openRes)) { - MOZ_LOG(GetImgLog(), LogLevel::Debug, + MOZ_LOG(GetImgLog(), PR_LOG_DEBUG, ("[this=%p] imgLoader::LoadImage -- AsyncOpen() failed: 0x%x\n", this, openRes)); request->CancelAndAbort(openRes); @@ -2673,7 +2673,7 @@ ProxyListener::CheckListenerChain() if (retargetableListener) { rv = retargetableListener->CheckListenerChain(); } - MOZ_LOG(GetImgLog(), LogLevel::Debug, + MOZ_LOG(GetImgLog(), PR_LOG_DEBUG, ("ProxyListener::CheckListenerChain %s [this=%p listener=%p rv=%x]", (NS_SUCCEEDED(rv) ? "success" : "failure"), this, (nsIStreamListener*)mDestListener, rv)); @@ -2800,7 +2800,7 @@ imgCacheValidator::OnStartRequest(nsIRequest* aRequest, nsISupports* ctxt) uri = imageURL->ToIURI(); } - if (MOZ_LOG_TEST(GetImgLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) { nsAutoCString spec; uri->GetSpec(spec); LOG_MSG_WITH_PARAM(GetImgLog(), @@ -2900,7 +2900,7 @@ imgCacheValidator::CheckListenerChain() if (retargetableListener) { rv = retargetableListener->CheckListenerChain(); } - MOZ_LOG(GetImgLog(), LogLevel::Debug, + MOZ_LOG(GetImgLog(), PR_LOG_DEBUG, ("[this=%p] imgCacheValidator::CheckListenerChain -- rv %d=%s", this, NS_SUCCEEDED(rv) ? "succeeded" : "failed", rv)); return rv; diff --git a/image/imgRequest.cpp b/image/imgRequest.cpp index 6b8813032269..8a8179fe6ae2 100644 --- a/image/imgRequest.cpp +++ b/image/imgRequest.cpp @@ -51,7 +51,7 @@ GetImgLog() } return sImgLog; } -#define LOG_TEST(level) (GetImgLog() && MOZ_LOG_TEST(GetImgLog(), (level))) +#define LOG_TEST(level) (GetImgLog() && PR_LOG_TEST(GetImgLog(), (level))) NS_IMPL_ISUPPORTS(imgRequest, nsIStreamListener, nsIRequestObserver, @@ -260,7 +260,7 @@ imgRequest::RemoveProxy(imgRequestProxy* proxy, nsresult aStatus) if (mLoader) { mLoader->SetHasNoProxies(this, mCacheEntry); } - } else if (MOZ_LOG_TEST(GetImgLog(), LogLevel::Debug)) { + } else if (PR_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) { nsAutoCString spec; mURI->GetSpec(spec); LOG_MSG_WITH_PARAM(GetImgLog(), @@ -789,7 +789,7 @@ imgRequest::OnStartRequest(nsIRequest* aRequest, nsISupports* ctxt) DecodePool::Singleton()->GetIOEventTarget(); rv = retargetable->RetargetDeliveryTo(target); } - MOZ_LOG(GetImgLog(), LogLevel::Warning, + MOZ_LOG(GetImgLog(), PR_LOG_WARNING, ("[this=%p] imgRequest::OnStartRequest -- " "RetargetDeliveryTo rv %d=%s\n", this, rv, NS_SUCCEEDED(rv) ? "succeeded" : "failed")); @@ -946,13 +946,13 @@ PrepareForNewPart(nsIRequest* aRequest, nsIInputStream* aInStr, uint32_t aCount, if (NS_FAILED(rv)) { MOZ_LOG(GetImgLog(), - LogLevel::Error, ("imgRequest::PrepareForNewPart " + PR_LOG_ERROR, ("imgRequest::PrepareForNewPart " "-- Content type unavailable from the channel\n")); return result; } } - MOZ_LOG(GetImgLog(), LogLevel::Debug, + MOZ_LOG(GetImgLog(), PR_LOG_DEBUG, ("imgRequest::PrepareForNewPart -- Got content type %s\n", result.mContentType.get())); @@ -1111,7 +1111,7 @@ imgRequest::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext, image->OnImageDataAvailable(aRequest, aContext, aInStr, aOffset, aCount); if (NS_FAILED(rv)) { - MOZ_LOG(GetImgLog(), LogLevel::Warning, + MOZ_LOG(GetImgLog(), PR_LOG_WARNING, ("[this=%p] imgRequest::OnDataAvailable -- " "copy to RasterImage failed\n", this)); Cancel(NS_IMAGELIB_ERROR_FAILURE); @@ -1229,7 +1229,7 @@ imgRequest::OnRedirectVerifyCallback(nsresult result) mTimedChannel = do_QueryInterface(mChannel); mNewRedirectChannel = nullptr; - if (LOG_TEST(LogLevel::Debug)) { + if (LOG_TEST(PR_LOG_DEBUG)) { nsAutoCString spec; if (mCurrentURI) { mCurrentURI->GetSpec(spec); @@ -1257,7 +1257,7 @@ imgRequest::OnRedirectVerifyCallback(nsresult result) // Update the current URI. mChannel->GetURI(getter_AddRefs(mCurrentURI)); - if (LOG_TEST(LogLevel::Debug)) { + if (LOG_TEST(PR_LOG_DEBUG)) { nsAutoCString spec; if (mCurrentURI) { mCurrentURI->GetSpec(spec); diff --git a/image/imgRequestProxy.cpp b/image/imgRequestProxy.cpp index 79f30cc6233c..80b47f375280 100644 --- a/image/imgRequestProxy.cpp +++ b/image/imgRequestProxy.cpp @@ -861,7 +861,7 @@ imgRequestProxy::Notify(int32_t aType, const mozilla::gfx::IntRect* aRect) void imgRequestProxy::OnLoadComplete(bool aLastPart) { - if (MOZ_LOG_TEST(GetImgLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) { nsAutoCString name; GetName(name); LOG_FUNC_WITH_PARAM(GetImgLog(), "imgRequestProxy::OnLoadComplete", @@ -907,7 +907,7 @@ imgRequestProxy::OnLoadComplete(bool aLastPart) void imgRequestProxy::BlockOnload() { - if (MOZ_LOG_TEST(GetImgLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) { nsAutoCString name; GetName(name); LOG_FUNC_WITH_PARAM(GetImgLog(), "imgRequestProxy::BlockOnload", @@ -923,7 +923,7 @@ imgRequestProxy::BlockOnload() void imgRequestProxy::UnblockOnload() { - if (MOZ_LOG_TEST(GetImgLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetImgLog(), PR_LOG_DEBUG)) { nsAutoCString name; GetName(name); LOG_FUNC_WITH_PARAM(GetImgLog(), "imgRequestProxy::UnblockOnload", diff --git a/ipc/chromium/src/base/logging.cc b/ipc/chromium/src/base/logging.cc index 8b0f9d843c3f..2b8d180bddf2 100644 --- a/ipc/chromium/src/base/logging.cc +++ b/ipc/chromium/src/base/logging.cc @@ -12,37 +12,37 @@ namespace mozilla { Logger::~Logger() { - LogLevel prlevel = LogLevel::Debug; + PRLogModuleLevel prlevel = PR_LOG_DEBUG; int xpcomlevel = -1; switch (mSeverity) { case LOG_INFO: - prlevel = LogLevel::Debug; + prlevel = PR_LOG_DEBUG; xpcomlevel = -1; break; case LOG_WARNING: - prlevel = LogLevel::Warning; + prlevel = PR_LOG_WARNING; xpcomlevel = NS_DEBUG_WARNING; break; case LOG_ERROR: - prlevel = LogLevel::Error; + prlevel = PR_LOG_ERROR; xpcomlevel = NS_DEBUG_WARNING; break; case LOG_ERROR_REPORT: - prlevel = LogLevel::Error; + prlevel = PR_LOG_ERROR; xpcomlevel = NS_DEBUG_ASSERTION; break; case LOG_FATAL: - prlevel = LogLevel::Error; + prlevel = PR_LOG_ERROR; xpcomlevel = NS_DEBUG_ABORT; break; } - MOZ_LOG(GetLog(), prlevel, ("%s:%i: %s", mFile, mLine, mMsg ? mMsg : "")); + PR_LOG(GetLog(), prlevel, ("%s:%i: %s", mFile, mLine, mMsg ? mMsg : "")); if (xpcomlevel != -1) NS_DebugBreak(xpcomlevel, mMsg, NULL, mFile, mLine); diff --git a/js/xpconnect/loader/mozJSComponentLoader.cpp b/js/xpconnect/loader/mozJSComponentLoader.cpp index 0eeb3341d2c6..0a8c64761d24 100644 --- a/js/xpconnect/loader/mozJSComponentLoader.cpp +++ b/js/xpconnect/loader/mozJSComponentLoader.cpp @@ -72,7 +72,7 @@ static const char kJSCachePrefix[] = "jsloader"; // NSPR_LOG_MODULES=JSComponentLoader:5 static PRLogModuleInfo* gJSCLLog; -#define LOG(args) MOZ_LOG(gJSCLLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gJSCLLog, PR_LOG_DEBUG, args) // Components.utils.import error messages #define ERROR_SCOPE_OBJ "%s - Second argument must be an object." diff --git a/js/xpconnect/src/XPCLog.cpp b/js/xpconnect/src/XPCLog.cpp index 5624587c7885..afbfe4c218d1 100644 --- a/js/xpconnect/src/XPCLog.cpp +++ b/js/xpconnect/src/XPCLog.cpp @@ -31,7 +31,7 @@ static bool Init() { g_LogMod = PR_NewLogModule("xpclog"); g_Spaces = new char[SPACE_COUNT+1]; - if (!g_LogMod || !g_Spaces || !MOZ_LOG_TEST(g_LogMod,LogLevel::Error)) { + if (!g_LogMod || !g_Spaces || !PR_LOG_TEST(g_LogMod,1)) { g_InitState = 1; XPC_Log_Finish(); return false; @@ -71,7 +71,7 @@ XPC_Log_print(const char* fmt, ...) bool XPC_Log_Check(int i) { - return CAN_RUN && MOZ_LOG_TEST(g_LogMod,LogLevel::Error); + return CAN_RUN && PR_LOG_TEST(g_LogMod,1); } void diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp index cc3a6016b282..144fb13c360c 100644 --- a/js/xpconnect/src/nsXPConnect.cpp +++ b/js/xpconnect/src/nsXPConnect.cpp @@ -246,7 +246,7 @@ xpc::ErrorReport::LogToConsole() gJSDiagnostics = PR_NewLogModule("JSDiagnostics"); if (gJSDiagnostics) { MOZ_LOG(gJSDiagnostics, - JSREPORT_IS_WARNING(mFlags) ? LogLevel::Warning : LogLevel::Error, + JSREPORT_IS_WARNING(mFlags) ? PR_LOG_WARNING : PR_LOG_ERROR, ("file %s, line %u\n%s", NS_LossyConvertUTF16toASCII(mFileName).get(), mLineNumber, NS_LossyConvertUTF16toASCII(mErrorMsg).get())); } diff --git a/layout/base/AccessibleCaretLogger.h b/layout/base/AccessibleCaretLogger.h index 08ac661c5367..cbcdbfe7c198 100644 --- a/layout/base/AccessibleCaretLogger.h +++ b/layout/base/AccessibleCaretLogger.h @@ -14,12 +14,12 @@ namespace mozilla { PRLogModuleInfo* GetAccessibleCaretLog(); #ifndef AC_LOG_BASE -#define AC_LOG_BASE(...) MOZ_LOG(GetAccessibleCaretLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)); +#define AC_LOG_BASE(...) MOZ_LOG(GetAccessibleCaretLog(), PR_LOG_DEBUG, (__VA_ARGS__)); #endif #ifndef AC_LOGV_BASE #define AC_LOGV_BASE(...) \ - MOZ_LOG(GetAccessibleCaretLog(), LogLevel::Verbose, (__VA_ARGS__)); + MOZ_LOG(GetAccessibleCaretLog(), PR_LOG_DEBUG + 1, (__VA_ARGS__)); #endif } // namespace mozilla diff --git a/layout/base/SelectionCarets.cpp b/layout/base/SelectionCarets.cpp index b099f1431bae..83e14ee53f23 100644 --- a/layout/base/SelectionCarets.cpp +++ b/layout/base/SelectionCarets.cpp @@ -45,12 +45,12 @@ static const char* kSelectionCaretsLogModuleName = "SelectionCarets"; // To enable all the SELECTIONCARETS_LOG print statements, set the environment // variable NSPR_LOG_MODULES=SelectionCarets:5 #define SELECTIONCARETS_LOG(message, ...) \ - MOZ_LOG(gSelectionCaretsLog, LogLevel::Debug, \ + MOZ_LOG(gSelectionCaretsLog, PR_LOG_DEBUG, \ ("SelectionCarets (%p): %s:%d : " message "\n", this, __FUNCTION__, \ __LINE__, ##__VA_ARGS__)); #define SELECTIONCARETS_LOG_STATIC(message, ...) \ - MOZ_LOG(gSelectionCaretsLog, LogLevel::Debug, \ + MOZ_LOG(gSelectionCaretsLog, PR_LOG_DEBUG, \ ("SelectionCarets: %s:%d : " message "\n", __FUNCTION__, __LINE__, \ ##__VA_ARGS__)); diff --git a/layout/base/TouchCaret.cpp b/layout/base/TouchCaret.cpp index 83a517edad37..e624967fcb03 100644 --- a/layout/base/TouchCaret.cpp +++ b/layout/base/TouchCaret.cpp @@ -42,12 +42,12 @@ static const char* kTouchCaretLogModuleName = "TouchCaret"; // To enable all the TOUCHCARET_LOG print statements, set the environment // variable NSPR_LOG_MODULES=TouchCaret:5 #define TOUCHCARET_LOG(message, ...) \ - MOZ_LOG(gTouchCaretLog, LogLevel::Debug, \ + MOZ_LOG(gTouchCaretLog, PR_LOG_DEBUG, \ ("TouchCaret (%p): %s:%d : " message "\n", this, __FUNCTION__, \ __LINE__, ##__VA_ARGS__)); #define TOUCHCARET_LOG_STATIC(message, ...) \ - MOZ_LOG(gTouchCaretLog, LogLevel::Debug, \ + MOZ_LOG(gTouchCaretLog, PR_LOG_DEBUG, \ ("TouchCaret: %s:%d : " message "\n", __FUNCTION__, __LINE__, \ ##__VA_ARGS__)); diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index 052607ced81f..2cd6046897a7 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -142,7 +142,7 @@ GetPrintingLog() sLog = PR_NewLogModule("printing"); return sLog; } -#define PR_PL(_p1) MOZ_LOG(GetPrintingLog(), mozilla::LogLevel::Debug, _p1); +#define PR_PL(_p1) MOZ_LOG(GetPrintingLog(), PR_LOG_DEBUG, _p1); #endif // NS_PRINTING #define PRT_YESNO(_p) ((_p)?"YES":"NO") diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp index ca100444300d..f0a02c14cb3a 100644 --- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -253,7 +253,7 @@ nsPresContext::nsPresContext(nsIDocument* aDocument, nsPresContextType aType) // if text perf logging enabled, init stats struct PRLogModuleInfo *log = gfxPlatform::GetLog(eGfxLog_textperf); - if (MOZ_LOG_TEST(log, LogLevel::Warning)) { + if (log && log->level >= PR_LOG_WARNING) { mTextPerf = new gfxTextPerfMetrics(); } diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index b465ecefb7d3..fd7de8f05e07 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -1000,12 +1000,12 @@ LogTextPerfStats(gfxTextPerfMetrics* aTextPerf, PRLogModuleInfo* tpLog = gfxPlatform::GetLog(eGfxLog_textperf); // ignore XUL contexts unless at debug level - mozilla::LogLevel logLevel = LogLevel::Warning; + PRLogModuleLevel logLevel = PR_LOG_WARNING; if (aCounts.numContentTextRuns == 0) { - logLevel = LogLevel::Debug; + logLevel = PR_LOG_DEBUG; } - if (!MOZ_LOG_TEST(tpLog, logLevel)) { + if (!PR_LOG_TEST(tpLog, logLevel)) { return; } @@ -2709,7 +2709,7 @@ PresShell::BeginLoad(nsIDocument *aDocument) tp = mPresContext->GetTextPerfMetrics(); } - bool shouldLog = gLog && MOZ_LOG_TEST(gLog, LogLevel::Debug); + bool shouldLog = gLog && PR_LOG_TEST(gLog, PR_LOG_DEBUG); if (shouldLog || tp) { mLoadBegin = TimeStamp::Now(); } @@ -2720,7 +2720,7 @@ PresShell::BeginLoad(nsIDocument *aDocument) if (uri) { uri->GetSpec(spec); } - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_DEBUG, ("(presshell) %p load begin [%s]\n", this, spec.get())); } @@ -2745,7 +2745,7 @@ PresShell::LoadComplete() } // log load - bool shouldLog = gLog && MOZ_LOG_TEST(gLog, LogLevel::Debug); + bool shouldLog = gLog && PR_LOG_TEST(gLog, PR_LOG_DEBUG); if (shouldLog || tp) { TimeDuration loadTime = TimeStamp::Now() - mLoadBegin; nsIURI* uri = mDocument->GetDocumentURI(); @@ -2754,7 +2754,7 @@ PresShell::LoadComplete() uri->GetSpec(spec); } if (shouldLog) { - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_DEBUG, ("(presshell) %p load done time-ms: %9.2f [%s]\n", this, loadTime.ToMilliseconds(), spec.get())); } diff --git a/layout/base/nsRefreshDriver.cpp b/layout/base/nsRefreshDriver.cpp index 0aeec9d57769..5380c238fd56 100644 --- a/layout/base/nsRefreshDriver.cpp +++ b/layout/base/nsRefreshDriver.cpp @@ -74,7 +74,7 @@ using namespace mozilla::ipc; using namespace mozilla::layout; static PRLogModuleInfo *gLog = nullptr; -#define LOG(...) MOZ_LOG(gLog, mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define LOG(...) MOZ_LOG(gLog, PR_LOG_NOTICE, (__VA_ARGS__)) #define DEFAULT_FRAME_RATE 60 #define DEFAULT_THROTTLED_FRAME_RATE 1 diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp index 85babe53cdc4..29417a23deee 100644 --- a/layout/generic/nsFlexContainerFrame.cpp +++ b/layout/generic/nsFlexContainerFrame.cpp @@ -2132,7 +2132,7 @@ FlexLine::FreezeOrRestoreEachFlexibleSize(const nscoord aTotalViolation, void FlexLine::ResolveFlexibleLengths(nscoord aFlexContainerMainSize) { - MOZ_LOG(GetFlexContainerLog(), LogLevel::Debug, ("ResolveFlexibleLengths\n")); + MOZ_LOG(GetFlexContainerLog(), PR_LOG_DEBUG, ("ResolveFlexibleLengths\n")); // Determine whether we're going to be growing or shrinking items. const bool isUsingFlexGrow = @@ -2180,7 +2180,7 @@ FlexLine::ResolveFlexibleLengths(nscoord aFlexContainerMainSize) availableFreeSpace -= item->GetMainSize(); } - MOZ_LOG(GetFlexContainerLog(), LogLevel::Debug, + MOZ_LOG(GetFlexContainerLog(), PR_LOG_DEBUG, (" available free space = %d\n", availableFreeSpace)); @@ -2292,7 +2292,7 @@ FlexLine::ResolveFlexibleLengths(nscoord aFlexContainerMainSize) } } - MOZ_LOG(GetFlexContainerLog(), LogLevel::Debug, + MOZ_LOG(GetFlexContainerLog(), PR_LOG_DEBUG, (" Distributing available space:")); // Since this loop only operates on unfrozen flex items, we can break as // soon as we have seen all of them. @@ -2340,7 +2340,7 @@ FlexLine::ResolveFlexibleLengths(nscoord aFlexContainerMainSize) availableFreeSpace -= sizeDelta; item->SetMainSize(item->GetMainSize() + sizeDelta); - MOZ_LOG(GetFlexContainerLog(), LogLevel::Debug, + MOZ_LOG(GetFlexContainerLog(), PR_LOG_DEBUG, (" child %p receives %d, for a total of %d\n", item, sizeDelta, item->GetMainSize())); } @@ -2350,7 +2350,7 @@ FlexLine::ResolveFlexibleLengths(nscoord aFlexContainerMainSize) // Fix min/max violations: nscoord totalViolation = 0; // keeps track of adjustments for min/max - MOZ_LOG(GetFlexContainerLog(), LogLevel::Debug, + MOZ_LOG(GetFlexContainerLog(), PR_LOG_DEBUG, (" Checking for violations:")); // Since this loop only operates on unfrozen flex items, we can break as @@ -2379,7 +2379,7 @@ FlexLine::ResolveFlexibleLengths(nscoord aFlexContainerMainSize) FreezeOrRestoreEachFlexibleSize(totalViolation, iterationCounter + 1 == mNumItems); - MOZ_LOG(GetFlexContainerLog(), LogLevel::Debug, + MOZ_LOG(GetFlexContainerLog(), PR_LOG_DEBUG, (" Total violation: %d\n", totalViolation)); if (mNumFrozenItems == mNumItems) { @@ -3528,7 +3528,7 @@ nsFlexContainerFrame::Reflow(nsPresContext* aPresContext, MarkInReflow(); DO_GLOBAL_REFLOW_COUNT("nsFlexContainerFrame"); DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus); - MOZ_LOG(GetFlexContainerLog(), LogLevel::Debug, + MOZ_LOG(GetFlexContainerLog(), PR_LOG_DEBUG, ("Reflow() for nsFlexContainerFrame %p\n", this)); if (IsFrameTreeTooDeep(aReflowState, aDesiredSize, aStatus)) { diff --git a/layout/generic/nsPageFrame.cpp b/layout/generic/nsPageFrame.cpp index 9c16c55461f1..18b389dc0ab5 100644 --- a/layout/generic/nsPageFrame.cpp +++ b/layout/generic/nsPageFrame.cpp @@ -23,7 +23,7 @@ #include "mozilla/Logging.h" extern PRLogModuleInfo *GetLayoutPrintingLog(); -#define PR_PL(_p1) MOZ_LOG(GetLayoutPrintingLog(), mozilla::LogLevel::Debug, _p1) +#define PR_PL(_p1) MOZ_LOG(GetLayoutPrintingLog(), PR_LOG_DEBUG, _p1) using namespace mozilla; using namespace mozilla::gfx; diff --git a/layout/generic/nsPluginFrame.cpp b/layout/generic/nsPluginFrame.cpp index 3a3c81b96172..d42efc327dd1 100644 --- a/layout/generic/nsPluginFrame.cpp +++ b/layout/generic/nsPluginFrame.cpp @@ -158,13 +158,13 @@ nsPluginFrame::nsPluginFrame(nsStyleContext* aContext) , mInstanceOwner(nullptr) , mReflowCallbackPosted(false) { - MOZ_LOG(GetObjectFrameLog(), LogLevel::Debug, + MOZ_LOG(GetObjectFrameLog(), PR_LOG_DEBUG, ("Created new nsPluginFrame %p\n", this)); } nsPluginFrame::~nsPluginFrame() { - MOZ_LOG(GetObjectFrameLog(), LogLevel::Debug, + MOZ_LOG(GetObjectFrameLog(), PR_LOG_DEBUG, ("nsPluginFrame %p deleted\n", this)); } @@ -194,7 +194,7 @@ nsPluginFrame::Init(nsIContent* aContent, nsContainerFrame* aParent, nsIFrame* aPrevInFlow) { - MOZ_LOG(GetObjectFrameLog(), LogLevel::Debug, + MOZ_LOG(GetObjectFrameLog(), PR_LOG_DEBUG, ("Initializing nsPluginFrame %p for content %p\n", this, aContent)); nsPluginFrameSuper::Init(aContent, aParent, aPrevInFlow); diff --git a/layout/generic/nsSimplePageSequenceFrame.cpp b/layout/generic/nsSimplePageSequenceFrame.cpp index 768f5ed13ede..c5ff4f72a0b4 100644 --- a/layout/generic/nsSimplePageSequenceFrame.cpp +++ b/layout/generic/nsSimplePageSequenceFrame.cpp @@ -50,7 +50,7 @@ GetLayoutPrintingLog() sLog = PR_NewLogModule("printing-layout"); return sLog; } -#define PR_PL(_p1) MOZ_LOG(GetLayoutPrintingLog(), mozilla::LogLevel::Debug, _p1) +#define PR_PL(_p1) MOZ_LOG(GetLayoutPrintingLog(), PR_LOG_DEBUG, _p1) nsSimplePageSequenceFrame* NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) diff --git a/layout/printing/nsPrintData.cpp b/layout/printing/nsPrintData.cpp index b7586bfc53ac..a4206d460dc1 100644 --- a/layout/printing/nsPrintData.cpp +++ b/layout/printing/nsPrintData.cpp @@ -25,7 +25,7 @@ GetPrintingLog() sLog = PR_NewLogModule("printing"); return sLog; } -#define PR_PL(_p1) MOZ_LOG(GetPrintingLog(), mozilla::LogLevel::Debug, _p1); +#define PR_PL(_p1) MOZ_LOG(GetPrintingLog(), PR_LOG_DEBUG, _p1); //--------------------------------------------------- //-- nsPrintData Class Impl diff --git a/layout/printing/nsPrintEngine.cpp b/layout/printing/nsPrintEngine.cpp index 0aba474089c4..dec876d0808c 100644 --- a/layout/printing/nsPrintEngine.cpp +++ b/layout/printing/nsPrintEngine.cpp @@ -146,7 +146,7 @@ GetPrintingLog() sLog = PR_NewLogModule("printing"); return sLog; } -#define PR_PL(_p1) MOZ_LOG(GetPrintingLog(), mozilla::LogLevel::Debug, _p1); +#define PR_PL(_p1) MOZ_LOG(GetPrintingLog(), PR_LOG_DEBUG, _p1); #endif #ifdef EXTENDED_DEBUG_PRINTING @@ -1707,7 +1707,7 @@ nsPrintEngine::SetupToPrintContent() NS_ENSURE_SUCCESS(rv, rv); } - if (MOZ_LOG_TEST(GetPrintingLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetPrintingLog(), PR_LOG_DEBUG)) { float calcRatio = 0.0f; if (mPrt->mPrintDocList.Length() > 1 && mPrt->mPrintObject->mFrameType == eFrameSet) { nsPrintObject* smallestPO = FindSmallestSTF(); diff --git a/layout/style/FontFaceSet.cpp b/layout/style/FontFaceSet.cpp index 8b953cd4b828..1a603999e526 100644 --- a/layout/style/FontFaceSet.cpp +++ b/layout/style/FontFaceSet.cpp @@ -37,9 +37,9 @@ using namespace mozilla; using namespace mozilla::dom; -#define LOG(args) MOZ_LOG(gfxUserFontSet::GetUserFontsLog(), mozilla::LogLevel::Debug, args) -#define LOG_ENABLED() MOZ_LOG_TEST(gfxUserFontSet::GetUserFontsLog(), \ - LogLevel::Debug) +#define LOG(args) MOZ_LOG(gfxUserFontSet::GetUserFontsLog(), PR_LOG_DEBUG, args) +#define LOG_ENABLED() PR_LOG_TEST(gfxUserFontSet::GetUserFontsLog(), \ + PR_LOG_DEBUG) #define FONT_LOADING_API_ENABLED_PREF "layout.css.font-loading-api.enabled" diff --git a/layout/style/Loader.cpp b/layout/style/Loader.cpp index 81c95ecdf543..c453800aa517 100644 --- a/layout/style/Loader.cpp +++ b/layout/style/Loader.cpp @@ -264,14 +264,16 @@ GetLoaderLog() return sLog; } -#define LOG_ERROR(args) MOZ_LOG(GetLoaderLog(), mozilla::LogLevel::Error, args) -#define LOG_WARN(args) MOZ_LOG(GetLoaderLog(), mozilla::LogLevel::Warning, args) -#define LOG_DEBUG(args) MOZ_LOG(GetLoaderLog(), mozilla::LogLevel::Debug, args) +#define LOG_FORCE(args) MOZ_LOG(GetLoaderLog(), PR_LOG_ALWAYS, args) +#define LOG_ERROR(args) MOZ_LOG(GetLoaderLog(), PR_LOG_ERROR, args) +#define LOG_WARN(args) MOZ_LOG(GetLoaderLog(), PR_LOG_WARNING, args) +#define LOG_DEBUG(args) MOZ_LOG(GetLoaderLog(), PR_LOG_DEBUG, args) #define LOG(args) LOG_DEBUG(args) -#define LOG_ERROR_ENABLED() MOZ_LOG_TEST(GetLoaderLog(), mozilla::LogLevel::Error) -#define LOG_WARN_ENABLED() MOZ_LOG_TEST(GetLoaderLog(), mozilla::LogLevel::Warning) -#define LOG_DEBUG_ENABLED() MOZ_LOG_TEST(GetLoaderLog(), mozilla::LogLevel::Debug) +#define LOG_FORCE_ENABLED() PR_LOG_TEST(GetLoaderLog(), PR_LOG_ALWAYS) +#define LOG_ERROR_ENABLED() PR_LOG_TEST(GetLoaderLog(), PR_LOG_ERROR) +#define LOG_WARN_ENABLED() PR_LOG_TEST(GetLoaderLog(), PR_LOG_WARNING) +#define LOG_DEBUG_ENABLED() PR_LOG_TEST(GetLoaderLog(), PR_LOG_DEBUG) #define LOG_ENABLED() LOG_DEBUG_ENABLED() #define LOG_URI(format, uri) \ diff --git a/layout/style/nsFontFaceLoader.cpp b/layout/style/nsFontFaceLoader.cpp index c08517cbae21..bb1fb0f9648d 100644 --- a/layout/style/nsFontFaceLoader.cpp +++ b/layout/style/nsFontFaceLoader.cpp @@ -25,9 +25,9 @@ using namespace mozilla; -#define LOG(args) MOZ_LOG(gfxUserFontSet::GetUserFontsLog(), mozilla::LogLevel::Debug, args) -#define LOG_ENABLED() MOZ_LOG_TEST(gfxUserFontSet::GetUserFontsLog(), \ - LogLevel::Debug) +#define LOG(args) MOZ_LOG(gfxUserFontSet::GetUserFontsLog(), PR_LOG_DEBUG, args) +#define LOG_ENABLED() PR_LOG_TEST(gfxUserFontSet::GetUserFontsLog(), \ + PR_LOG_DEBUG) nsFontFaceLoader::nsFontFaceLoader(gfxUserFontEntry* aUserFontEntry, nsIURI* aFontURI, diff --git a/media/libstagefright/binding/MoofParser.cpp b/media/libstagefright/binding/MoofParser.cpp index 860e7aba7315..888a6710a09c 100644 --- a/media/libstagefright/binding/MoofParser.cpp +++ b/media/libstagefright/binding/MoofParser.cpp @@ -19,7 +19,7 @@ extern PRLogModuleInfo* GetDemuxerLog(); #define STRINGIFY(x) #x #define TOSTRING(x) STRINGIFY(x) -#define LOG(name, arg, ...) MOZ_LOG(GetDemuxerLog(), mozilla::LogLevel::Debug, (TOSTRING(name) "(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) +#define LOG(name, arg, ...) MOZ_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (TOSTRING(name) "(%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) #else #define LOG(...) #endif diff --git a/media/mtransport/logging.h b/media/mtransport/logging.h index 1a2b71cf9004..88aef1ea922d 100644 --- a/media/mtransport/logging.h +++ b/media/mtransport/logging.h @@ -12,11 +12,12 @@ #include #include "mozilla/Logging.h" -#define ML_ERROR mozilla::LogLevel::Error -#define ML_WARNING mozilla::LogLevel::Warning -#define ML_NOTICE mozilla::LogLevel::Info -#define ML_INFO mozilla::LogLevel::Debug -#define ML_DEBUG mozilla::LogLevel::Verbose +#define ML_EMERG 1 +#define ML_ERROR 2 +#define ML_WARNING 3 +#define ML_NOTICE 4 +#define ML_INFO 5 +#define ML_DEBUG 6 #define MOZ_MTLOG_MODULE(n) \ static PRLogModuleInfo* getLogModule() { \ @@ -28,7 +29,7 @@ #define MOZ_MTLOG(level, b) \ do { \ - if (MOZ_LOG_TEST(getLogModule(), level)) { \ + if (PR_LOG_TEST(getLogModule(), level)) { \ std::stringstream str; \ str << b; \ MOZ_LOG(getLogModule(), level, ("%s", str.str().c_str())); \ diff --git a/media/mtransport/nricectx.cpp b/media/mtransport/nricectx.cpp index 7edbc0ef948b..13d2a0f68313 100644 --- a/media/mtransport/nricectx.cpp +++ b/media/mtransport/nricectx.cpp @@ -459,13 +459,13 @@ RefPtr NrIceCtx::Create(const std::string& name, #ifdef USE_INTERFACE_PRIORITIZER nr_interface_prioritizer *prioritizer = CreateInterfacePrioritizer(); if (!prioritizer) { - MOZ_MTLOG(LogLevel::Error, "Couldn't create interface prioritizer."); + MOZ_MTLOG(PR_LOG_ERROR, "Couldn't create interface prioritizer."); return nullptr; } r = nr_ice_ctx_set_interface_prioritizer(ctx->ctx_, prioritizer); if (r) { - MOZ_MTLOG(LogLevel::Error, "Couldn't set interface prioritizer."); + MOZ_MTLOG(PR_LOG_ERROR, "Couldn't set interface prioritizer."); return nullptr; } #endif // USE_INTERFACE_PRIORITIZER @@ -655,7 +655,7 @@ nsresult NrIceCtx::SetProxyServer(const NrIceProxyServer& proxy_server) { } if ((r = nr_socket_wrapper_factory_proxy_tunnel_create(config, &wrapper))) { - MOZ_MTLOG(LogLevel::Error, "Couldn't create proxy tunnel wrapper."); + MOZ_MTLOG(PR_LOG_ERROR, "Couldn't create proxy tunnel wrapper."); ABORT(r); } diff --git a/media/mtransport/nrinterfaceprioritizer.cpp b/media/mtransport/nrinterfaceprioritizer.cpp index 96fc0395e175..33d17017f383 100644 --- a/media/mtransport/nrinterfaceprioritizer.cpp +++ b/media/mtransport/nrinterfaceprioritizer.cpp @@ -24,7 +24,7 @@ public: char buf[MAXIFNAME + 41]; int r = nr_transport_addr_fmt_ifname_addr_string(&local_addr.addr, buf, sizeof(buf)); if (r) { - MOZ_MTLOG(ML_ERROR, "Error formatting interface address string."); + MOZ_MTLOG(PR_LOG_ERROR, "Error formatting interface address string."); return false; } key_ = buf; diff --git a/media/webrtc/signaling/src/common/browser_logging/CSFLog.cpp b/media/webrtc/signaling/src/common/browser_logging/CSFLog.cpp index 4ecf9512d10c..b574752268c0 100644 --- a/media/webrtc/signaling/src/common/browser_logging/CSFLog.cpp +++ b/media/webrtc/signaling/src/common/browser_logging/CSFLog.cpp @@ -14,8 +14,6 @@ #include "prthread.h" #include "nsThreadUtils.h" -#include "mozilla/Logging.h" - static PRLogModuleInfo *gLogModuleInfo = nullptr; PRLogModuleInfo *GetSignalingLogInfo() @@ -44,12 +42,12 @@ void CSFLogV(CSFLogLevel priority, const char* sourceFile, int sourceLine, const vprintf(format, args); #else - mozilla::LogLevel level = static_cast(priority); + PRLogModuleLevel level = static_cast(priority); GetSignalingLogInfo(); // Skip doing any of this work if we're not logging the indicated level... - if (!MOZ_LOG_TEST(gLogModuleInfo,level)) { + if (!PR_LOG_TEST(gLogModuleInfo,level)) { return; } diff --git a/media/webrtc/signaling/src/common/browser_logging/CSFLog.h b/media/webrtc/signaling/src/common/browser_logging/CSFLog.h index a20157992903..ba7e8366892c 100644 --- a/media/webrtc/signaling/src/common/browser_logging/CSFLog.h +++ b/media/webrtc/signaling/src/common/browser_logging/CSFLog.h @@ -6,27 +6,30 @@ #define CSFLOG_H #include - -struct PRLogModuleInfo; +#include "mozilla/Logging.h" typedef enum{ - CSF_LOG_ERROR = 1, + CSF_LOG_CRITICAL =1, + CSF_LOG_ERROR, CSF_LOG_WARNING, + CSF_LOG_NOTICE, CSF_LOG_INFO, CSF_LOG_DEBUG, - CSF_LOG_VERBOSE, + CSF_LOG_OBNOXIOUS } CSFLogLevel; #define CSFLogError(tag , format, ...) CSFLog( CSF_LOG_ERROR, __FILE__ , __LINE__ , tag , format , ## __VA_ARGS__ ) #define CSFLogErrorV(tag , format, va_list_arg) CSFLogV(CSF_LOG_ERROR, __FILE__ , __LINE__ , tag , format , va_list_arg ) #define CSFLogWarn(tag , format, ...) CSFLog( CSF_LOG_WARNING, __FILE__ , __LINE__ , tag , format , ## __VA_ARGS__ ) #define CSFLogWarnV(tag , format, va_list_arg) CSFLogV(CSF_LOG_WARNING, __FILE__ , __LINE__ , tag , format , va_list_arg ) +#define CSFLogNotice(tag , format, ...) CSFLog( CSF_LOG_NOTICE, __FILE__ , __LINE__ , tag , format , ## __VA_ARGS__ ) +#define CSFLogNoticeV(tag , format, va_list_arg) CSFLogV(CSF_LOG_NOTICE, __FILE__ , __LINE__ , tag , format , va_list_arg ) #define CSFLogInfo(tag , format, ...) CSFLog( CSF_LOG_INFO, __FILE__ , __LINE__ , tag , format , ## __VA_ARGS__ ) #define CSFLogInfoV(tag , format, va_list_arg) CSFLogV(CSF_LOG_INFO, __FILE__ , __LINE__ , tag , format , va_list_arg ) #define CSFLogDebug(tag , format, ...) CSFLog(CSF_LOG_DEBUG, __FILE__ , __LINE__ , tag , format , ## __VA_ARGS__ ) #define CSFLogDebugV(tag , format, va_list_arg) CSFLogV(CSF_LOG_DEBUG, __FILE__ , __LINE__ , tag , format , va_list_arg ) -#define CSFLogVerbose(tag , format, ...) CSFLog(CSF_LOG_VERBOSE, __FILE__ , __LINE__ , tag , format , ## __VA_ARGS__ ) -#define CSFLogVerboseV(tag , format, va_list_arg) CSFLogV(CSF_LOG_VERBOSE, __FILE__ , __LINE__ , tag , format , va_list_arg ) +#define CSFLogObnoxious(tag , format, ...) CSFLog(CSF_LOG_OBNOXIOUS, __FILE__ , __LINE__ , tag , format , ## __VA_ARGS__ ) +#define CSFLogObnoxiousV(tag , format, va_list_arg) CSFLogV(CSF_LOG_OBNOXIOUS, __FILE__ , __LINE__ , tag , format , va_list_arg ) #ifdef __cplusplus extern "C" @@ -40,8 +43,8 @@ void CSFLog( CSFLogLevel priority, const char* sourceFile, int sourceLine, const void CSFLogV( CSFLogLevel priority, const char* sourceFile, int sourceLine, const char* tag , const char* format, va_list args); -struct PRLogModuleInfo *GetSignalingLogInfo(); -struct PRLogModuleInfo *GetWebRTCLogInfo(); +PRLogModuleInfo *GetSignalingLogInfo(); +PRLogModuleInfo *GetWebRTCLogInfo(); #ifdef __cplusplus } diff --git a/media/webrtc/signaling/src/common/browser_logging/WebRtcLog.cpp b/media/webrtc/signaling/src/common/browser_logging/WebRtcLog.cpp index c1baeddbed38..d3b7d9d1518e 100644 --- a/media/webrtc/signaling/src/common/browser_logging/WebRtcLog.cpp +++ b/media/webrtc/signaling/src/common/browser_logging/WebRtcLog.cpp @@ -19,8 +19,6 @@ #include "nsStringAPI.h" #endif -using mozilla::LogLevel; - static int gWebRtcTraceLoggingOn = 0; #ifndef ANDROID @@ -51,7 +49,7 @@ public: void Print(webrtc::TraceLevel level, const char* message, int length) { PRLogModuleInfo *log = GetWebRtcTraceLog(); - MOZ_LOG(log, LogLevel::Debug, ("%s", message)); + MOZ_LOG(log, PR_LOG_DEBUG, ("%s", message)); } }; diff --git a/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp b/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp index ca86a85dee86..8c839c8c0edc 100755 --- a/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp +++ b/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp @@ -555,7 +555,7 @@ WebrtcAudioConduit::SendAudioFrame(const int16_t audio_data[], } #if !defined(MOZILLA_EXTERNAL_LINKAGE) - if (MOZ_LOG_TEST(GetLatencyLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) { struct Processing insert = { TimeStamp::Now(), 0 }; mProcessing.AppendElement(insert); } @@ -667,7 +667,7 @@ WebrtcAudioConduit::GetAudioFrame(int16_t speechData[], } #if !defined(MOZILLA_EXTERNAL_LINKAGE) - if (MOZ_LOG_TEST(GetLatencyLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) { if (mProcessing.Length() > 0) { unsigned int now; mPtrVoEVideoSync->GetPlayoutTimestamp(mChannel, now); @@ -704,7 +704,7 @@ WebrtcAudioConduit::ReceivedRTPPacket(const void *data, int len) if(mEngineReceiving) { #if !defined(MOZILLA_EXTERNAL_LINKAGE) - if (MOZ_LOG_TEST(GetLatencyLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) { // timestamp is at 32 bits in ([1]) struct Processing insert = { TimeStamp::Now(), ntohl(static_cast(data)[1]) }; @@ -842,7 +842,7 @@ int WebrtcAudioConduit::SendPacket(int channel, const void* data, int len) CSFLogDebug(logTag, "%s : channel %d", __FUNCTION__, channel); #if !defined(MOZILLA_EXTERNAL_LINKAGE) - if (MOZ_LOG_TEST(GetLatencyLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetLatencyLog(), PR_LOG_DEBUG)) { if (mProcessing.Length() > 0) { TimeStamp started = mProcessing[0].mTimeStamp; mProcessing.RemoveElementAt(0); diff --git a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp index bbbd93c2de69..bcf15a6b884f 100644 --- a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp +++ b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp @@ -44,7 +44,7 @@ GetGMPLog() return sLog; } #endif -#define LOGD(msg) MOZ_LOG(GetGMPLog(), mozilla::LogLevel::Debug, msg) +#define LOGD(msg) MOZ_LOG(GetGMPLog(), PR_LOG_DEBUG, msg) #define LOG(level, msg) MOZ_LOG(GetGMPLog(), (level), msg) // Encoder. @@ -485,7 +485,7 @@ WebrtcGmpVideoEncoder::Encoded(GMPVideoEncodedFrame* aEncodedFrame, break; default: // Really that it's not in the enum - LOG(LogLevel::Error, + LOG(PR_LOG_ERROR, ("GMP plugin returned incorrect type (%d)", aEncodedFrame->BufferType())); // XXX Bug 1041232 - need a better API for interfacing to the // plugin so we can kill it here @@ -530,7 +530,7 @@ WebrtcGmpVideoEncoder::Encoded(GMPVideoEncodedFrame* aEncodedFrame, } if (buffer+size > end) { // XXX see above - should we kill the plugin for returning extra bytes? Probably - LOG(LogLevel::Error, + LOG(PR_LOG_ERROR, ("GMP plugin returned badly formatted encoded data: end is %td bytes past buffer end", buffer+size - end)); return; diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp index afc0aaa7545f..c1a5f4ae37f9 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp @@ -365,7 +365,7 @@ bool PCUuidGenerator::Generate(std::string* idp) { PeerConnectionImpl::PeerConnectionImpl(const GlobalObject* aGlobal) -: mTimeCard(MOZ_LOG_TEST(signalingLogInfo(),LogLevel::Error) ? +: mTimeCard(PR_LOG_TEST(signalingLogInfo(),PR_LOG_ERROR) ? create_timecard() : nullptr) , mSignalingState(PCImplSignalingState::SignalingStable) , mIceConnectionState(PCImplIceConnectionState::New) diff --git a/modules/libjar/nsJARChannel.cpp b/modules/libjar/nsJARChannel.cpp index 9c23e9426e17..4160ea7182c7 100644 --- a/modules/libjar/nsJARChannel.cpp +++ b/modules/libjar/nsJARChannel.cpp @@ -51,8 +51,8 @@ static NS_DEFINE_CID(kZipReaderCID, NS_ZIPREADER_CID); // static PRLogModuleInfo *gJarProtocolLog = nullptr; -#define LOG(args) MOZ_LOG(gJarProtocolLog, mozilla::LogLevel::Debug, args) -#define LOG_ENABLED() MOZ_LOG_TEST(gJarProtocolLog, mozilla::LogLevel::Debug) +#define LOG(args) MOZ_LOG(gJarProtocolLog, PR_LOG_DEBUG, args) +#define LOG_ENABLED() PR_LOG_TEST(gJarProtocolLog, 4) //----------------------------------------------------------------------------- // nsJARInputThunk diff --git a/netwerk/base/BackgroundFileSaver.cpp b/netwerk/base/BackgroundFileSaver.cpp index 057486b7b487..2340acef32c4 100644 --- a/netwerk/base/BackgroundFileSaver.cpp +++ b/netwerk/base/BackgroundFileSaver.cpp @@ -34,8 +34,8 @@ namespace net { // NSPR_LOG_MODULES=BackgroundFileSaver:5 PRLogModuleInfo *BackgroundFileSaver::prlog = nullptr; -#define LOG(args) MOZ_LOG(BackgroundFileSaver::prlog, mozilla::LogLevel::Debug, args) -#define LOG_ENABLED() MOZ_LOG_TEST(BackgroundFileSaver::prlog, mozilla::LogLevel::Debug) +#define LOG(args) MOZ_LOG(BackgroundFileSaver::prlog, PR_LOG_DEBUG, args) +#define LOG_ENABLED() PR_LOG_TEST(BackgroundFileSaver::prlog, 4) //////////////////////////////////////////////////////////////////////////////// //// Globals diff --git a/netwerk/base/Predictor.cpp b/netwerk/base/Predictor.cpp index b0bbbf235214..5522f6170d92 100644 --- a/netwerk/base/Predictor.cpp +++ b/netwerk/base/Predictor.cpp @@ -54,7 +54,7 @@ namespace net { Predictor *Predictor::sSelf = nullptr; static PRLogModuleInfo *gPredictorLog = nullptr; -#define PREDICTOR_LOG(args) MOZ_LOG(gPredictorLog, mozilla::LogLevel::Debug, args) +#define PREDICTOR_LOG(args) MOZ_LOG(gPredictorLog, 4, args) #define RETURN_IF_FAILED(_rv) \ do { \ diff --git a/netwerk/base/nsAsyncRedirectVerifyHelper.cpp b/netwerk/base/nsAsyncRedirectVerifyHelper.cpp index 0f432ce2e97d..9035df864c3c 100644 --- a/netwerk/base/nsAsyncRedirectVerifyHelper.cpp +++ b/netwerk/base/nsAsyncRedirectVerifyHelper.cpp @@ -22,7 +22,7 @@ GetRedirectLog() sLog = PR_NewLogModule("nsRedirect"); return sLog; } -#define LOG(args) MOZ_LOG(GetRedirectLog(), mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(GetRedirectLog(), PR_LOG_DEBUG, args) NS_IMPL_ISUPPORTS(nsAsyncRedirectVerifyHelper, nsIAsyncVerifyRedirectCallback, diff --git a/netwerk/base/nsAsyncStreamCopier.cpp b/netwerk/base/nsAsyncStreamCopier.cpp index 260843626a0c..3fb45f2c928c 100644 --- a/netwerk/base/nsAsyncStreamCopier.cpp +++ b/netwerk/base/nsAsyncStreamCopier.cpp @@ -17,7 +17,7 @@ using namespace mozilla; // NSPR_LOG_MODULES=nsStreamCopier:5 // static PRLogModuleInfo *gStreamCopierLog = nullptr; -#define LOG(args) MOZ_LOG(gStreamCopierLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gStreamCopierLog, PR_LOG_DEBUG, args) /** * An event used to perform initialization off the main thread. diff --git a/netwerk/base/nsAutodialWin.cpp b/netwerk/base/nsAutodialWin.cpp index 7987335536a2..e27d9c3b77dc 100644 --- a/netwerk/base/nsAutodialWin.cpp +++ b/netwerk/base/nsAutodialWin.cpp @@ -25,7 +25,7 @@ // set NSPR_LOG_MODULES=Autodial:5 // set NSPR_LOG_FILE=nspr.log // -// this enables LogLevel::Debug level information and places all output in +// this enables PR_LOG_DEBUG level information and places all output in // the file nspr.log // @@ -33,8 +33,8 @@ static PRLogModuleInfo* gLog = nullptr; #undef LOGD #undef LOGE -#define LOGD(args) MOZ_LOG(gLog, mozilla::LogLevel::Debug, args) -#define LOGE(args) MOZ_LOG(gLog, mozilla::LogLevel::Error, args) +#define LOGD(args) MOZ_LOG(gLog, PR_LOG_DEBUG, args) +#define LOGE(args) MOZ_LOG(gLog, PR_LOG_ERROR, args) // Don't try to dial again within a few seconds of when user pressed cancel. #define NO_RETRY_PERIOD_SEC 5 diff --git a/netwerk/base/nsChannelClassifier.cpp b/netwerk/base/nsChannelClassifier.cpp index 8830accd000d..ddbde07fe958 100644 --- a/netwerk/base/nsChannelClassifier.cpp +++ b/netwerk/base/nsChannelClassifier.cpp @@ -41,7 +41,7 @@ using mozilla::Preferences; // static PRLogModuleInfo *gChannelClassifierLog; #undef LOG -#define LOG(args) MOZ_LOG(gChannelClassifierLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gChannelClassifierLog, PR_LOG_DEBUG, args) NS_IMPL_ISUPPORTS(nsChannelClassifier, nsIURIClassifierCallback) diff --git a/netwerk/base/nsDirectoryIndexStream.cpp b/netwerk/base/nsDirectoryIndexStream.cpp index 37d4e4b69c60..0ea4f820974a 100644 --- a/netwerk/base/nsDirectoryIndexStream.cpp +++ b/netwerk/base/nsDirectoryIndexStream.cpp @@ -47,7 +47,7 @@ nsDirectoryIndexStream::nsDirectoryIndexStream() if (! gLog) gLog = PR_NewLogModule("nsDirectoryIndexStream"); - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_DEBUG, ("nsDirectoryIndexStream[%p]: created", this)); } @@ -92,10 +92,10 @@ nsDirectoryIndexStream::Init(nsIFile* aDir) if (!isDir) return NS_ERROR_ILLEGAL_VALUE; - if (MOZ_LOG_TEST(gLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gLog, PR_LOG_DEBUG)) { nsAutoCString path; aDir->GetNativePath(path); - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_DEBUG, ("nsDirectoryIndexStream[%p]: initialized on %s", this, path.get())); } @@ -157,7 +157,7 @@ nsDirectoryIndexStream::Init(nsIFile* aDir) nsDirectoryIndexStream::~nsDirectoryIndexStream() { - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_DEBUG, ("nsDirectoryIndexStream[%p]: destroyed", this)); } @@ -239,10 +239,10 @@ nsDirectoryIndexStream::Read(char* aBuf, uint32_t aCount, uint32_t* aReadCount) nsIFile* current = mArray.ObjectAt(mPos); ++mPos; - if (MOZ_LOG_TEST(gLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gLog, PR_LOG_DEBUG)) { nsAutoCString path; current->GetNativePath(path); - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_DEBUG, ("nsDirectoryIndexStream[%p]: iterated %s", this, path.get())); } @@ -254,7 +254,7 @@ nsDirectoryIndexStream::Read(char* aBuf, uint32_t aCount, uint32_t* aReadCount) bool hidden = false; current->IsHidden(&hidden); if (hidden) { - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_DEBUG, ("nsDirectoryIndexStream[%p]: skipping hidden file/directory", this)); continue; diff --git a/netwerk/base/nsInputStreamPump.cpp b/netwerk/base/nsInputStreamPump.cpp index ab12742fa501..9d74a743c42e 100644 --- a/netwerk/base/nsInputStreamPump.cpp +++ b/netwerk/base/nsInputStreamPump.cpp @@ -26,7 +26,7 @@ static NS_DEFINE_CID(kStreamTransportServiceCID, NS_STREAMTRANSPORTSERVICE_CID); // static PRLogModuleInfo *gStreamPumpLog = nullptr; #undef LOG -#define LOG(args) MOZ_LOG(gStreamPumpLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gStreamPumpLog, PR_LOG_DEBUG, args) //----------------------------------------------------------------------------- // nsInputStreamPump methods diff --git a/netwerk/base/nsLoadGroup.cpp b/netwerk/base/nsLoadGroup.cpp index 78da469169f1..cf9e4aa07d88 100644 --- a/netwerk/base/nsLoadGroup.cpp +++ b/netwerk/base/nsLoadGroup.cpp @@ -35,13 +35,13 @@ using namespace mozilla::net; // set NSPR_LOG_MODULES=LoadGroup:5 // set NSPR_LOG_FILE=nspr.log // -// this enables LogLevel::Debug level information and places all output in +// this enables PR_LOG_DEBUG level information and places all output in // the file nspr.log // static PRLogModuleInfo* gLoadGroupLog = nullptr; #undef LOG -#define LOG(args) MOZ_LOG(gLoadGroupLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gLoadGroupLog, PR_LOG_DEBUG, args) //////////////////////////////////////////////////////////////////////////////// // nsLoadGroupConnectionInfo @@ -325,7 +325,7 @@ nsLoadGroup::Cancel(nsresult status) continue; } - if (MOZ_LOG_TEST(gLoadGroupLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gLoadGroupLog, PR_LOG_DEBUG)) { nsAutoCString nameStr; request->GetName(nameStr); LOG(("LOADGROUP [%x]: Canceling request %x %s.\n", @@ -393,7 +393,7 @@ nsLoadGroup::Suspend() if (!request) continue; - if (MOZ_LOG_TEST(gLoadGroupLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gLoadGroupLog, PR_LOG_DEBUG)) { nsAutoCString nameStr; request->GetName(nameStr); LOG(("LOADGROUP [%x]: Suspending request %x %s.\n", @@ -445,7 +445,7 @@ nsLoadGroup::Resume() if (!request) continue; - if (MOZ_LOG_TEST(gLoadGroupLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gLoadGroupLog, PR_LOG_DEBUG)) { nsAutoCString nameStr; request->GetName(nameStr); LOG(("LOADGROUP [%x]: Resuming request %x %s.\n", @@ -534,7 +534,7 @@ nsLoadGroup::AddRequest(nsIRequest *request, nsISupports* ctxt) { nsresult rv; - if (MOZ_LOG_TEST(gLoadGroupLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gLoadGroupLog, PR_LOG_DEBUG)) { nsAutoCString nameStr; request->GetName(nameStr); LOG(("LOADGROUP [%x]: Adding request %x %s (count=%d).\n", @@ -631,7 +631,7 @@ nsLoadGroup::RemoveRequest(nsIRequest *request, nsISupports* ctxt, NS_ENSURE_ARG_POINTER(request); nsresult rv; - if (MOZ_LOG_TEST(gLoadGroupLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gLoadGroupLog, PR_LOG_DEBUG)) { nsAutoCString nameStr; request->GetName(nameStr); LOG(("LOADGROUP [%x]: Removing request %x %s status %x (count=%d).\n", diff --git a/netwerk/base/nsPACMan.cpp b/netwerk/base/nsPACMan.cpp index 6f34350e8853..a0a2ec0ed713 100644 --- a/netwerk/base/nsPACMan.cpp +++ b/netwerk/base/nsPACMan.cpp @@ -26,7 +26,7 @@ using namespace mozilla; using namespace mozilla::net; #undef LOG -#define LOG(args) MOZ_LOG(GetProxyLog(), mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(GetProxyLog(), PR_LOG_DEBUG, args) // The PAC thread does evaluations of both PAC files and // nsISystemProxySettings because they can both block the calling thread and we diff --git a/netwerk/base/nsProtocolProxyService.cpp b/netwerk/base/nsProtocolProxyService.cpp index abe6f2c389d0..97ad0cf01996 100644 --- a/netwerk/base/nsProtocolProxyService.cpp +++ b/netwerk/base/nsProtocolProxyService.cpp @@ -49,7 +49,7 @@ using namespace mozilla; #include "mozilla/Logging.h" #undef LOG -#define LOG(args) MOZ_LOG(net::GetProxyLog(), mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(net::GetProxyLog(), PR_LOG_DEBUG, args) //---------------------------------------------------------------------------- diff --git a/netwerk/base/nsRequestObserverProxy.cpp b/netwerk/base/nsRequestObserverProxy.cpp index 195d24db1e04..7f953bcee9aa 100644 --- a/netwerk/base/nsRequestObserverProxy.cpp +++ b/netwerk/base/nsRequestObserverProxy.cpp @@ -16,7 +16,7 @@ using namespace mozilla; static PRLogModuleInfo *gRequestObserverProxyLog; #undef LOG -#define LOG(args) MOZ_LOG(gRequestObserverProxyLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gRequestObserverProxyLog, PR_LOG_DEBUG, args) //----------------------------------------------------------------------------- // nsARequestObserverEvent internal class... diff --git a/netwerk/base/nsSecCheckWrapChannel.cpp b/netwerk/base/nsSecCheckWrapChannel.cpp index 18e282eecf53..09a7f6fce750 100644 --- a/netwerk/base/nsSecCheckWrapChannel.cpp +++ b/netwerk/base/nsSecCheckWrapChannel.cpp @@ -7,6 +7,7 @@ #include "nsHttpChannel.h" #include "nsCOMPtr.h" +#ifdef PR_LOGGING static PRLogModuleInfo* GetChannelWrapperLog() { @@ -16,8 +17,9 @@ GetChannelWrapperLog() } return gChannelWrapperPRLog; } +#endif -#define CHANNELWRAPPERLOG(args) MOZ_LOG(GetChannelWrapperLog(), mozilla::LogLevel::Debug, args) +#define CHANNELWRAPPERLOG(args) PR_LOG(GetChannelWrapperLog(), 4, args) NS_IMPL_ADDREF(nsSecCheckWrapChannelBase) NS_IMPL_RELEASE(nsSecCheckWrapChannelBase) @@ -68,6 +70,7 @@ nsSecCheckWrapChannel::nsSecCheckWrapChannel(nsIChannel* aChannel, : nsSecCheckWrapChannelBase(aChannel) , mLoadInfo(aLoadInfo) { +#ifdef PR_LOGGING { nsCOMPtr uri; mChannel->GetURI(getter_AddRefs(uri)); @@ -77,6 +80,7 @@ nsSecCheckWrapChannel::nsSecCheckWrapChannel(nsIChannel* aChannel, } CHANNELWRAPPERLOG(("nsSecCheckWrapChannel::nsSecCheckWrapChannel [%p] (%s)",this, spec.get())); } +#endif } nsSecCheckWrapChannel::~nsSecCheckWrapChannel() diff --git a/netwerk/base/nsSocketTransportService2.h b/netwerk/base/nsSocketTransportService2.h index 4f3b6a90e7d7..e65a2c099a49 100644 --- a/netwerk/base/nsSocketTransportService2.h +++ b/netwerk/base/nsSocketTransportService2.h @@ -29,15 +29,15 @@ struct PRPollDesc; // set NSPR_LOG_MODULES=nsSocketTransport:5 // extern PRLogModuleInfo *gSocketTransportLog; -#define SOCKET_LOG(args) MOZ_LOG(gSocketTransportLog, mozilla::LogLevel::Debug, args) -#define SOCKET_LOG_ENABLED() MOZ_LOG_TEST(gSocketTransportLog, mozilla::LogLevel::Debug) +#define SOCKET_LOG(args) MOZ_LOG(gSocketTransportLog, PR_LOG_DEBUG, args) +#define SOCKET_LOG_ENABLED() PR_LOG_TEST(gSocketTransportLog, PR_LOG_DEBUG) // // set NSPR_LOG_MODULES=UDPSocket:5 // extern PRLogModuleInfo *gUDPSocketLog; -#define UDPSOCKET_LOG(args) MOZ_LOG(gUDPSocketLog, mozilla::LogLevel::Debug, args) -#define UDPSOCKET_LOG_ENABLED() MOZ_LOG_TEST(gUDPSocketLog, mozilla::LogLevel::Debug) +#define UDPSOCKET_LOG(args) PR_LOG(gUDPSocketLog, PR_LOG_DEBUG, args) +#define UDPSOCKET_LOG_ENABLED() PR_LOG_TEST(gUDPSocketLog, PR_LOG_DEBUG) //----------------------------------------------------------------------------- diff --git a/netwerk/base/nsStandardURL.cpp b/netwerk/base/nsStandardURL.cpp index 69f7fe6efe0a..0b3f80a59e24 100644 --- a/netwerk/base/nsStandardURL.cpp +++ b/netwerk/base/nsStandardURL.cpp @@ -44,9 +44,9 @@ static PRLogModuleInfo *gStandardURLLog; // The Chromium code defines its own LOG macro which we don't want #undef LOG -#define LOG(args) MOZ_LOG(gStandardURLLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gStandardURLLog, PR_LOG_DEBUG, args) #undef LOG_ENABLED -#define LOG_ENABLED() MOZ_LOG_TEST(gStandardURLLog, mozilla::LogLevel::Debug) +#define LOG_ENABLED() PR_LOG_TEST(gStandardURLLog, PR_LOG_DEBUG) //---------------------------------------------------------------------------- diff --git a/netwerk/cache/nsCache.cpp b/netwerk/cache/nsCache.cpp index 3b2cbdea3ae7..82e7bce427be 100644 --- a/netwerk/cache/nsCache.cpp +++ b/netwerk/cache/nsCache.cpp @@ -27,7 +27,7 @@ CacheLogInit() void -CacheLogPrintPath(mozilla::LogLevel level, const char * format, nsIFile * item) +CacheLogPrintPath(PRLogModuleLevel level, const char * format, nsIFile * item) { nsAutoCString path; nsresult rv = item->GetNativePath(path); diff --git a/netwerk/cache/nsCache.h b/netwerk/cache/nsCache.h index 78cca09abed2..3760303350a3 100644 --- a/netwerk/cache/nsCache.h +++ b/netwerk/cache/nsCache.h @@ -21,14 +21,14 @@ // PR_LOG args = "format string", arg, arg, ... extern PRLogModuleInfo * gCacheLog; void CacheLogInit(); -void CacheLogPrintPath(mozilla::LogLevel level, +void CacheLogPrintPath(PRLogModuleLevel level, const char * format, nsIFile * item); #define CACHE_LOG_INIT() CacheLogInit() -#define CACHE_LOG_INFO(args) MOZ_LOG(gCacheLog, mozilla::LogLevel::Info, args) -#define CACHE_LOG_ERROR(args) MOZ_LOG(gCacheLog, mozilla::LogLevel::Error, args) -#define CACHE_LOG_WARNING(args) MOZ_LOG(gCacheLog, mozilla::LogLevel::Warning, args) -#define CACHE_LOG_DEBUG(args) MOZ_LOG(gCacheLog, mozilla::LogLevel::Debug, args) +#define CACHE_LOG_ALWAYS(args) MOZ_LOG(gCacheLog, PR_LOG_ALWAYS, args) +#define CACHE_LOG_ERROR(args) MOZ_LOG(gCacheLog, PR_LOG_ERROR, args) +#define CACHE_LOG_WARNING(args) MOZ_LOG(gCacheLog, PR_LOG_WARNING, args) +#define CACHE_LOG_DEBUG(args) MOZ_LOG(gCacheLog, PR_LOG_DEBUG, args) #define CACHE_LOG_PATH(level, format, item) \ CacheLogPrintPath(level, format, item) diff --git a/netwerk/cache/nsCacheService.cpp b/netwerk/cache/nsCacheService.cpp index 3187d361b6bf..638e81f19e80 100644 --- a/netwerk/cache/nsCacheService.cpp +++ b/netwerk/cache/nsCacheService.cpp @@ -384,7 +384,7 @@ nsCacheProfilePrefObserver::Observe(nsISupports * subject, { nsresult rv; NS_ConvertUTF16toUTF8 data(data_unicode); - CACHE_LOG_INFO(("Observe [topic=%s data=%s]\n", topic, data.get())); + CACHE_LOG_ALWAYS(("Observe [topic=%s data=%s]\n", topic, data.get())); if (!nsCacheService::IsInitialized()) { if (!strcmp("resume_process_notification", topic)) { @@ -1743,7 +1743,7 @@ nsCacheService::GetCustomOfflineDevice(nsIFile *aProfileDir, nsresult nsCacheService::CreateOfflineDevice() { - CACHE_LOG_INFO(("Creating default offline device")); + CACHE_LOG_ALWAYS(("Creating default offline device")); if (mOfflineDevice) return NS_OK; if (!nsCacheService::IsInitialized()) { @@ -1766,10 +1766,10 @@ nsCacheService::CreateCustomOfflineDevice(nsIFile *aProfileDir, { NS_ENSURE_ARG(aProfileDir); - if (MOZ_LOG_TEST(gCacheLog, LogLevel::Info)) { + if (PR_LOG_TEST(gCacheLog, PR_LOG_ALWAYS)) { nsAutoCString profilePath; aProfileDir->GetNativePath(profilePath); - CACHE_LOG_INFO(("Creating custom offline device, %s, %d", + CACHE_LOG_ALWAYS(("Creating custom offline device, %s, %d", profilePath.BeginReading(), aQuota)); } @@ -3117,18 +3117,18 @@ nsCacheService::LogCacheStatistics() { uint32_t hitPercentage = (uint32_t)((((double)mCacheHits) / ((double)(mCacheHits + mCacheMisses))) * 100); - CACHE_LOG_INFO(("\nCache Service Statistics:\n\n")); - CACHE_LOG_INFO((" TotalEntries = %d\n", mTotalEntries)); - CACHE_LOG_INFO((" Cache Hits = %d\n", mCacheHits)); - CACHE_LOG_INFO((" Cache Misses = %d\n", mCacheMisses)); - CACHE_LOG_INFO((" Cache Hit %% = %d%%\n", hitPercentage)); - CACHE_LOG_INFO((" Max Key Length = %d\n", mMaxKeyLength)); - CACHE_LOG_INFO((" Max Meta Size = %d\n", mMaxMetaSize)); - CACHE_LOG_INFO((" Max Data Size = %d\n", mMaxDataSize)); - CACHE_LOG_INFO(("\n")); - CACHE_LOG_INFO((" Deactivate Failures = %d\n", + CACHE_LOG_ALWAYS(("\nCache Service Statistics:\n\n")); + CACHE_LOG_ALWAYS((" TotalEntries = %d\n", mTotalEntries)); + CACHE_LOG_ALWAYS((" Cache Hits = %d\n", mCacheHits)); + CACHE_LOG_ALWAYS((" Cache Misses = %d\n", mCacheMisses)); + CACHE_LOG_ALWAYS((" Cache Hit %% = %d%%\n", hitPercentage)); + CACHE_LOG_ALWAYS((" Max Key Length = %d\n", mMaxKeyLength)); + CACHE_LOG_ALWAYS((" Max Meta Size = %d\n", mMaxMetaSize)); + CACHE_LOG_ALWAYS((" Max Data Size = %d\n", mMaxDataSize)); + CACHE_LOG_ALWAYS(("\n")); + CACHE_LOG_ALWAYS((" Deactivate Failures = %d\n", mDeactivateFailures)); - CACHE_LOG_INFO((" Deactivated Unbound Entries = %d\n", + CACHE_LOG_ALWAYS((" Deactivated Unbound Entries = %d\n", mDeactivatedUnboundEntries)); } diff --git a/netwerk/cache/nsDiskCacheDevice.cpp b/netwerk/cache/nsDiskCacheDevice.cpp index 31b3f93bfc76..b025b14e6c74 100644 --- a/netwerk/cache/nsDiskCacheDevice.cpp +++ b/netwerk/cache/nsDiskCacheDevice.cpp @@ -993,8 +993,8 @@ nsDiskCacheDevice::OpenDiskCache() if (!exists) { nsCacheService::MarkStartingFresh(); rv = mCacheDirectory->Create(nsIFile::DIRECTORY_TYPE, 0777); - CACHE_LOG_PATH(LogLevel::Info, "\ncreate cache directory: %s\n", mCacheDirectory); - CACHE_LOG_INFO(("mCacheDirectory->Create() = %x\n", rv)); + CACHE_LOG_PATH(PR_LOG_ALWAYS, "\ncreate cache directory: %s\n", mCacheDirectory); + CACHE_LOG_ALWAYS(("mCacheDirectory->Create() = %x\n", rv)); if (NS_FAILED(rv)) return rv; diff --git a/netwerk/cache/nsDiskCacheDeviceSQL.cpp b/netwerk/cache/nsDiskCacheDeviceSQL.cpp index a0f0c64ec065..bef126fa2fe0 100644 --- a/netwerk/cache/nsDiskCacheDeviceSQL.cpp +++ b/netwerk/cache/nsDiskCacheDeviceSQL.cpp @@ -225,7 +225,7 @@ nsOfflineCacheEvictionFunction::Apply() LOG(("nsOfflineCacheEvictionFunction::Apply\n")); for (int32_t i = 0; i < mItems.Count(); i++) { - if (MOZ_LOG_TEST(gCacheLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gCacheLog, PR_LOG_DEBUG)) { nsAutoCString path; mItems[i]->GetNativePath(path); LOG((" removing %s\n", path.get())); diff --git a/netwerk/cache2/CacheEntry.cpp b/netwerk/cache2/CacheEntry.cpp index 61792af39581..37f42799ec85 100644 --- a/netwerk/cache2/CacheEntry.cpp +++ b/netwerk/cache2/CacheEntry.cpp @@ -199,6 +199,8 @@ CacheEntry::~CacheEntry() MOZ_COUNT_DTOR(CacheEntry); } +#ifdef PR_LOG + char const * CacheEntry::StateString(uint32_t aState) { switch (aState) { @@ -213,6 +215,8 @@ char const * CacheEntry::StateString(uint32_t aState) return "?"; } +#endif + nsresult CacheEntry::HashingKeyWithStorage(nsACString &aResult) const { return HashingKey(mStorageID, mEnhanceID, mURI, aResult); diff --git a/netwerk/cache2/CacheEntry.h b/netwerk/cache2/CacheEntry.h index 03e1f35288fa..98a0f5bbd92c 100644 --- a/netwerk/cache2/CacheEntry.h +++ b/netwerk/cache2/CacheEntry.h @@ -294,7 +294,9 @@ private: // fails to open an output stream. bool mHasData : 1; +#ifdef PR_LOG static char const * StateString(uint32_t aState); +#endif enum EState { // transiting to: NOTLOADED = 0, // -> LOADING | EMPTY diff --git a/netwerk/cache2/CacheLog.cpp b/netwerk/cache2/CacheLog.cpp index 8ad96df76c48..e7710b5af5b8 100644 --- a/netwerk/cache2/CacheLog.cpp +++ b/netwerk/cache2/CacheLog.cpp @@ -14,7 +14,7 @@ namespace net { // set NSPR_LOG_MODULES=cache2:5 // set NSPR_LOG_FILE=nspr.log // -// this enables LogLevel::Debug level information and places all output in +// this enables PR_LOG_DEBUG level information and places all output in // the file nspr.log PRLogModuleInfo* GetCache2Log() { diff --git a/netwerk/cache2/CacheLog.h b/netwerk/cache2/CacheLog.h index 751f2471dfb6..65834be28269 100644 --- a/netwerk/cache2/CacheLog.h +++ b/netwerk/cache2/CacheLog.h @@ -11,8 +11,8 @@ namespace mozilla { namespace net { extern PRLogModuleInfo* GetCache2Log(); -#define LOG(x) MOZ_LOG(GetCache2Log(), mozilla::LogLevel::Debug, x) -#define LOG_ENABLED() MOZ_LOG_TEST(GetCache2Log(), mozilla::LogLevel::Debug) +#define LOG(x) MOZ_LOG(GetCache2Log(), PR_LOG_DEBUG, x) +#define LOG_ENABLED() PR_LOG_TEST(GetCache2Log(), PR_LOG_DEBUG) } // net } // mozilla diff --git a/netwerk/cookie/nsCookieService.cpp b/netwerk/cookie/nsCookieService.cpp index b7cb6800237e..a090c95c1819 100644 --- a/netwerk/cookie/nsCookieService.cpp +++ b/netwerk/cookie/nsCookieService.cpp @@ -204,7 +204,7 @@ GetCookieLog() #define COOKIE_LOGEVICTED(a, details) \ PR_BEGIN_MACRO \ - if (MOZ_LOG_TEST(GetCookieLog(), LogLevel::Debug)) \ + if (PR_LOG_TEST(GetCookieLog(), PR_LOG_DEBUG)) \ LogEvicted(a, details); \ PR_END_MACRO @@ -218,27 +218,27 @@ static void LogFailure(bool aSetCookie, nsIURI *aHostURI, const char *aCookieString, const char *aReason) { // if logging isn't enabled, return now to save cycles - if (!MOZ_LOG_TEST(GetCookieLog(), LogLevel::Warning)) + if (!PR_LOG_TEST(GetCookieLog(), PR_LOG_WARNING)) return; nsAutoCString spec; if (aHostURI) aHostURI->GetAsciiSpec(spec); - MOZ_LOG(GetCookieLog(), LogLevel::Warning, + MOZ_LOG(GetCookieLog(), PR_LOG_WARNING, ("===== %s =====\n", aSetCookie ? "COOKIE NOT ACCEPTED" : "COOKIE NOT SENT")); - MOZ_LOG(GetCookieLog(), LogLevel::Warning,("request URL: %s\n", spec.get())); + MOZ_LOG(GetCookieLog(), PR_LOG_WARNING,("request URL: %s\n", spec.get())); if (aSetCookie) - MOZ_LOG(GetCookieLog(), LogLevel::Warning,("cookie string: %s\n", aCookieString)); + MOZ_LOG(GetCookieLog(), PR_LOG_WARNING,("cookie string: %s\n", aCookieString)); PRExplodedTime explodedTime; PR_ExplodeTime(PR_Now(), PR_GMTParameters, &explodedTime); char timeString[40]; PR_FormatTimeUSEnglish(timeString, 40, "%c GMT", &explodedTime); - MOZ_LOG(GetCookieLog(), LogLevel::Warning,("current time: %s", timeString)); - MOZ_LOG(GetCookieLog(), LogLevel::Warning,("rejected because %s\n", aReason)); - MOZ_LOG(GetCookieLog(), LogLevel::Warning,("\n")); + MOZ_LOG(GetCookieLog(), PR_LOG_WARNING,("current time: %s", timeString)); + MOZ_LOG(GetCookieLog(), PR_LOG_WARNING,("rejected because %s\n", aReason)); + MOZ_LOG(GetCookieLog(), PR_LOG_WARNING,("\n")); } static void @@ -249,27 +249,27 @@ LogCookie(nsCookie *aCookie) char timeString[40]; PR_FormatTimeUSEnglish(timeString, 40, "%c GMT", &explodedTime); - MOZ_LOG(GetCookieLog(), LogLevel::Debug,("current time: %s", timeString)); + MOZ_LOG(GetCookieLog(), PR_LOG_DEBUG,("current time: %s", timeString)); if (aCookie) { - MOZ_LOG(GetCookieLog(), LogLevel::Debug,("----------------\n")); - MOZ_LOG(GetCookieLog(), LogLevel::Debug,("name: %s\n", aCookie->Name().get())); - MOZ_LOG(GetCookieLog(), LogLevel::Debug,("value: %s\n", aCookie->Value().get())); - MOZ_LOG(GetCookieLog(), LogLevel::Debug,("%s: %s\n", aCookie->IsDomain() ? "domain" : "host", aCookie->Host().get())); - MOZ_LOG(GetCookieLog(), LogLevel::Debug,("path: %s\n", aCookie->Path().get())); + MOZ_LOG(GetCookieLog(), PR_LOG_DEBUG,("----------------\n")); + MOZ_LOG(GetCookieLog(), PR_LOG_DEBUG,("name: %s\n", aCookie->Name().get())); + MOZ_LOG(GetCookieLog(), PR_LOG_DEBUG,("value: %s\n", aCookie->Value().get())); + MOZ_LOG(GetCookieLog(), PR_LOG_DEBUG,("%s: %s\n", aCookie->IsDomain() ? "domain" : "host", aCookie->Host().get())); + MOZ_LOG(GetCookieLog(), PR_LOG_DEBUG,("path: %s\n", aCookie->Path().get())); PR_ExplodeTime(aCookie->Expiry() * int64_t(PR_USEC_PER_SEC), PR_GMTParameters, &explodedTime); PR_FormatTimeUSEnglish(timeString, 40, "%c GMT", &explodedTime); - MOZ_LOG(GetCookieLog(), LogLevel::Debug, + MOZ_LOG(GetCookieLog(), PR_LOG_DEBUG, ("expires: %s%s", timeString, aCookie->IsSession() ? " (at end of session)" : "")); PR_ExplodeTime(aCookie->CreationTime(), PR_GMTParameters, &explodedTime); PR_FormatTimeUSEnglish(timeString, 40, "%c GMT", &explodedTime); - MOZ_LOG(GetCookieLog(), LogLevel::Debug,("created: %s", timeString)); + MOZ_LOG(GetCookieLog(), PR_LOG_DEBUG,("created: %s", timeString)); - MOZ_LOG(GetCookieLog(), LogLevel::Debug,("is secure: %s\n", aCookie->IsSecure() ? "true" : "false")); - MOZ_LOG(GetCookieLog(), LogLevel::Debug,("is httpOnly: %s\n", aCookie->IsHttpOnly() ? "true" : "false")); + MOZ_LOG(GetCookieLog(), PR_LOG_DEBUG,("is secure: %s\n", aCookie->IsSecure() ? "true" : "false")); + MOZ_LOG(GetCookieLog(), PR_LOG_DEBUG,("is httpOnly: %s\n", aCookie->IsHttpOnly() ? "true" : "false")); } } @@ -277,7 +277,7 @@ static void LogSuccess(bool aSetCookie, nsIURI *aHostURI, const char *aCookieString, nsCookie *aCookie, bool aReplacing) { // if logging isn't enabled, return now to save cycles - if (!MOZ_LOG_TEST(GetCookieLog(), LogLevel::Debug)) { + if (!PR_LOG_TEST(GetCookieLog(), PR_LOG_DEBUG)) { return; } @@ -285,27 +285,27 @@ LogSuccess(bool aSetCookie, nsIURI *aHostURI, const char *aCookieString, nsCooki if (aHostURI) aHostURI->GetAsciiSpec(spec); - MOZ_LOG(GetCookieLog(), LogLevel::Debug, + MOZ_LOG(GetCookieLog(), PR_LOG_DEBUG, ("===== %s =====\n", aSetCookie ? "COOKIE ACCEPTED" : "COOKIE SENT")); - MOZ_LOG(GetCookieLog(), LogLevel::Debug,("request URL: %s\n", spec.get())); - MOZ_LOG(GetCookieLog(), LogLevel::Debug,("cookie string: %s\n", aCookieString)); + MOZ_LOG(GetCookieLog(), PR_LOG_DEBUG,("request URL: %s\n", spec.get())); + MOZ_LOG(GetCookieLog(), PR_LOG_DEBUG,("cookie string: %s\n", aCookieString)); if (aSetCookie) - MOZ_LOG(GetCookieLog(), LogLevel::Debug,("replaces existing cookie: %s\n", aReplacing ? "true" : "false")); + MOZ_LOG(GetCookieLog(), PR_LOG_DEBUG,("replaces existing cookie: %s\n", aReplacing ? "true" : "false")); LogCookie(aCookie); - MOZ_LOG(GetCookieLog(), LogLevel::Debug,("\n")); + MOZ_LOG(GetCookieLog(), PR_LOG_DEBUG,("\n")); } static void LogEvicted(nsCookie *aCookie, const char* details) { - MOZ_LOG(GetCookieLog(), LogLevel::Debug,("===== COOKIE EVICTED =====\n")); - MOZ_LOG(GetCookieLog(), LogLevel::Debug,("%s\n", details)); + MOZ_LOG(GetCookieLog(), PR_LOG_DEBUG,("===== COOKIE EVICTED =====\n")); + MOZ_LOG(GetCookieLog(), PR_LOG_DEBUG,("%s\n", details)); LogCookie(aCookie); - MOZ_LOG(GetCookieLog(), LogLevel::Debug,("\n")); + MOZ_LOG(GetCookieLog(), PR_LOG_DEBUG,("\n")); } // inline wrappers to make passing in nsAFlatCStrings easier @@ -351,13 +351,13 @@ protected: public: NS_IMETHOD HandleError(mozIStorageError* aError) override { - if (MOZ_LOG_TEST(GetCookieLog(), LogLevel::Warning)) { + if (PR_LOG_TEST(GetCookieLog(), PR_LOG_WARNING)) { int32_t result = -1; aError->GetResult(&result); nsAutoCString message; aError->GetMessage(message); - COOKIE_LOGSTRING(LogLevel::Warning, + COOKIE_LOGSTRING(PR_LOG_WARNING, ("DBListenerErrorHandler::HandleError(): Error %d occurred while " "performing operation '%s' with message '%s'; rebuilding database.", result, GetOpType(), message.get())); @@ -396,7 +396,7 @@ public: // so. if (mDBState->corruptFlag == DBState::REBUILDING && aReason == mozIStorageStatementCallback::REASON_FINISHED) { - COOKIE_LOGSTRING(LogLevel::Debug, + COOKIE_LOGSTRING(PR_LOG_DEBUG, ("InsertCookieDBListener::HandleCompletion(): rebuild complete")); mDBState->corruptFlag = DBState::OK; } @@ -527,12 +527,12 @@ public: case mozIStorageStatementCallback::REASON_CANCELED: // Nothing more to do here. The partially read data has already been // thrown away. - COOKIE_LOGSTRING(LogLevel::Debug, ("Read canceled")); + COOKIE_LOGSTRING(PR_LOG_DEBUG, ("Read canceled")); break; case mozIStorageStatementCallback::REASON_ERROR: // Nothing more to do here. DBListenerErrorHandler::HandleError() // can handle it. - COOKIE_LOGSTRING(LogLevel::Debug, ("Read error")); + COOKIE_LOGSTRING(PR_LOG_DEBUG, ("Read error")); break; default: NS_NOTREACHED("invalid reason"); @@ -758,7 +758,7 @@ nsCookieService::Init() mPermissionService = do_GetService(NS_COOKIEPERMISSION_CONTRACTID); if (!mPermissionService) { NS_WARNING("nsICookiePermission implementation not available - some features won't work!"); - COOKIE_LOGSTRING(LogLevel::Warning, ("Init(): nsICookiePermission implementation not available")); + COOKIE_LOGSTRING(PR_LOG_WARNING, ("Init(): nsICookiePermission implementation not available")); } return NS_OK; @@ -782,7 +782,7 @@ nsCookieService::InitDBStates() getter_AddRefs(mDefaultDBState->cookieFile)); if (NS_FAILED(rv)) { // We've already set up our DBStates appropriately; nothing more to do. - COOKIE_LOGSTRING(LogLevel::Warning, + COOKIE_LOGSTRING(PR_LOG_WARNING, ("InitDBStates(): couldn't get cookie file")); return; } @@ -794,7 +794,7 @@ nsCookieService::InitDBStates() if (result == RESULT_RETRY) { // Database may be corrupt. Synchronously close the connection, clean up the // default DBState, and try again. - COOKIE_LOGSTRING(LogLevel::Warning, ("InitDBStates(): retrying TryInitDB()")); + COOKIE_LOGSTRING(PR_LOG_WARNING, ("InitDBStates(): retrying TryInitDB()")); CleanupCachedStatements(); CleanupDefaultDBConnection(); result = TryInitDB(true); @@ -805,7 +805,7 @@ nsCookieService::InitDBStates() } if (result == RESULT_FAILURE) { - COOKIE_LOGSTRING(LogLevel::Warning, + COOKIE_LOGSTRING(PR_LOG_WARNING, ("InitDBStates(): TryInitDB() failed, closing connection")); // Connection failure is unrecoverable. Clean up our connection. We can run @@ -1098,7 +1098,7 @@ nsCookieService::TryInitDB(bool aRecreateDB) "DROP TABLE moz_cookies_old")); NS_ENSURE_SUCCESS(rv, RESULT_RETRY); - COOKIE_LOGSTRING(LogLevel::Debug, + COOKIE_LOGSTRING(PR_LOG_DEBUG, ("Upgraded database to schema version 5")); } @@ -1353,7 +1353,7 @@ nsCookieService::CleanupDefaultDBConnection() void nsCookieService::HandleDBClosed(DBState* aDBState) { - COOKIE_LOGSTRING(LogLevel::Debug, + COOKIE_LOGSTRING(PR_LOG_DEBUG, ("HandleDBClosed(): DBState %x closed", aDBState)); switch (aDBState->corruptFlag) { @@ -1377,7 +1377,7 @@ nsCookieService::HandleDBClosed(DBState* aDBState) nsresult rv = backupFile->MoveToNative(nullptr, NS_LITERAL_CSTRING(COOKIES_FILE ".bak-rebuild")); - COOKIE_LOGSTRING(LogLevel::Warning, + COOKIE_LOGSTRING(PR_LOG_WARNING, ("HandleDBClosed(): DBState %x encountered error rebuilding db; move to " "'cookies.sqlite.bak-rebuild' gave rv 0x%x", aDBState, rv)); mObserverService->NotifyObservers(nullptr, "cookie-db-closed", nullptr); @@ -1392,12 +1392,12 @@ nsCookieService::HandleCorruptDB(DBState* aDBState) if (mDefaultDBState != aDBState) { // We've either closed the state or we've switched profiles. It's getting // a bit late to rebuild -- bail instead. - COOKIE_LOGSTRING(LogLevel::Warning, + COOKIE_LOGSTRING(PR_LOG_WARNING, ("HandleCorruptDB(): DBState %x is already closed, aborting", aDBState)); return; } - COOKIE_LOGSTRING(LogLevel::Debug, + COOKIE_LOGSTRING(PR_LOG_DEBUG, ("HandleCorruptDB(): DBState %x has corruptFlag %u", aDBState, aDBState->corruptFlag)); @@ -1474,13 +1474,13 @@ nsCookieService::RebuildCorruptDB(DBState* aDBState) // a bit late to rebuild -- bail instead. In any case, we were waiting // on rebuild completion to notify of the db closure, which won't happen -- // do so now. - COOKIE_LOGSTRING(LogLevel::Warning, + COOKIE_LOGSTRING(PR_LOG_WARNING, ("RebuildCorruptDB(): DBState %x is stale, aborting", aDBState)); mObserverService->NotifyObservers(nullptr, "cookie-db-closed", nullptr); return; } - COOKIE_LOGSTRING(LogLevel::Debug, + COOKIE_LOGSTRING(PR_LOG_DEBUG, ("RebuildCorruptDB(): creating new database")); // The database has been closed, and we're ready to rebuild. Open a @@ -1489,7 +1489,7 @@ nsCookieService::RebuildCorruptDB(DBState* aDBState) if (result != RESULT_OK) { // We're done. Reset our DB connection and statements, and notify of // closure. - COOKIE_LOGSTRING(LogLevel::Warning, + COOKIE_LOGSTRING(PR_LOG_WARNING, ("RebuildCorruptDB(): TryInitDB() failed with result %u", result)); CleanupCachedStatements(); CleanupDefaultDBConnection(); @@ -1511,7 +1511,7 @@ nsCookieService::RebuildCorruptDB(DBState* aDBState) uint32_t length; paramsArray->GetLength(&length); if (length == 0) { - COOKIE_LOGSTRING(LogLevel::Debug, + COOKIE_LOGSTRING(PR_LOG_DEBUG, ("RebuildCorruptDB(): nothing to write, rebuild complete")); mDefaultDBState->corruptFlag = DBState::OK; return; @@ -1934,7 +1934,7 @@ nsCookieService::RemoveAll() NS_ASSERT_SUCCESS(rv); } else { // Recreate the database. - COOKIE_LOGSTRING(LogLevel::Debug, + COOKIE_LOGSTRING(PR_LOG_DEBUG, ("RemoveAll(): corruption detected with rv 0x%x", rv)); HandleCorruptDB(mDefaultDBState); } @@ -2210,7 +2210,7 @@ nsCookieService::AsyncReadComplete() mDefaultDBState->hostArray.Clear(); mDefaultDBState->readSet.Clear(); - COOKIE_LOGSTRING(LogLevel::Debug, ("Read(): %ld cookies read", + COOKIE_LOGSTRING(PR_LOG_DEBUG, ("Read(): %ld cookies read", mDefaultDBState->cookieCount)); mObserverService->NotifyObservers(nullptr, "cookie-db-read", nullptr); @@ -2281,7 +2281,7 @@ nsCookieService::EnsureReadDomain(const nsCookieKey &aKey) if (NS_FAILED(rv)) { // Recreate the database. - COOKIE_LOGSTRING(LogLevel::Debug, + COOKIE_LOGSTRING(PR_LOG_DEBUG, ("EnsureReadDomain(): corruption detected when creating statement " "with rv 0x%x", rv)); HandleCorruptDB(mDefaultDBState); @@ -2311,7 +2311,7 @@ nsCookieService::EnsureReadDomain(const nsCookieKey &aKey) rv = mDefaultDBState->stmtReadDomain->ExecuteStep(&hasResult); if (NS_FAILED(rv)) { // Recreate the database. - COOKIE_LOGSTRING(LogLevel::Debug, + COOKIE_LOGSTRING(PR_LOG_DEBUG, ("EnsureReadDomain(): corruption detected when reading result " "with rv 0x%x", rv)); HandleCorruptDB(mDefaultDBState); @@ -2333,7 +2333,7 @@ nsCookieService::EnsureReadDomain(const nsCookieKey &aKey) // Add it to the hashset of read entries, so we don't read it again. mDefaultDBState->readSet.PutEntry(aKey); - COOKIE_LOGSTRING(LogLevel::Debug, + COOKIE_LOGSTRING(PR_LOG_DEBUG, ("EnsureReadDomain(): %ld cookies read for base domain %s, " " appId=%u, inBrowser=%d", array.Length(), aKey.mBaseDomain.get(), (unsigned)aKey.mAppId, (int)aKey.mInBrowserElement)); @@ -2374,7 +2374,7 @@ nsCookieService::EnsureReadComplete() if (NS_FAILED(rv)) { // Recreate the database. - COOKIE_LOGSTRING(LogLevel::Debug, + COOKIE_LOGSTRING(PR_LOG_DEBUG, ("EnsureReadComplete(): corruption detected when creating statement " "with rv 0x%x", rv)); HandleCorruptDB(mDefaultDBState); @@ -2389,7 +2389,7 @@ nsCookieService::EnsureReadComplete() rv = stmt->ExecuteStep(&hasResult); if (NS_FAILED(rv)) { // Recreate the database. - COOKIE_LOGSTRING(LogLevel::Debug, + COOKIE_LOGSTRING(PR_LOG_DEBUG, ("EnsureReadComplete(): corruption detected when reading result " "with rv 0x%x", rv)); HandleCorruptDB(mDefaultDBState); @@ -2423,7 +2423,7 @@ nsCookieService::EnsureReadComplete() mDefaultDBState->syncConn = nullptr; mDefaultDBState->readSet.Clear(); - COOKIE_LOGSTRING(LogLevel::Debug, + COOKIE_LOGSTRING(PR_LOG_DEBUG, ("EnsureReadComplete(): %ld cookies read", array.Length())); } @@ -2595,7 +2595,7 @@ nsCookieService::ImportCookies(nsIFile *aCookieFile) } - COOKIE_LOGSTRING(LogLevel::Debug, ("ImportCookies(): %ld cookies imported", + COOKIE_LOGSTRING(PR_LOG_DEBUG, ("ImportCookies(): %ld cookies imported", mDefaultDBState->cookieCount)); return NS_OK; @@ -3771,7 +3771,7 @@ nsCookieService::PurgeCookies(int64_t aCurrentTimeInUsec) EnsureReadComplete(); uint32_t initialCookieCount = mDBState->cookieCount; - COOKIE_LOGSTRING(LogLevel::Debug, + COOKIE_LOGSTRING(PR_LOG_DEBUG, ("PurgeCookies(): beginning purge with %ld cookies and %lld oldest age", mDBState->cookieCount, aCurrentTimeInUsec - mDBState->cookieOldestTime)); @@ -3835,7 +3835,7 @@ nsCookieService::PurgeCookies(int64_t aCurrentTimeInUsec) // reset the oldest time indicator mDBState->cookieOldestTime = data.oldestTime; - COOKIE_LOGSTRING(LogLevel::Debug, + COOKIE_LOGSTRING(PR_LOG_DEBUG, ("PurgeCookies(): %ld expired; %ld purged; %ld remain; %lld oldest age", initialCookieCount - postExpiryCookieCount, postExpiryCookieCount - mDBState->cookieCount, diff --git a/netwerk/dns/GetAddrInfo.cpp b/netwerk/dns/GetAddrInfo.cpp index c2182c73f8de..cf70664fd124 100644 --- a/netwerk/dns/GetAddrInfo.cpp +++ b/netwerk/dns/GetAddrInfo.cpp @@ -25,9 +25,9 @@ #include "mozilla/Logging.h" static PRLogModuleInfo *gGetAddrInfoLog = PR_NewLogModule("GetAddrInfo"); #define LOG(msg, ...) \ - MOZ_LOG(gGetAddrInfoLog, LogLevel::Debug, ("[DNS]: " msg, ##__VA_ARGS__)) + MOZ_LOG(gGetAddrInfoLog, PR_LOG_DEBUG, ("[DNS]: " msg, ##__VA_ARGS__)) #define LOG_WARNING(msg, ...) \ - MOZ_LOG(gGetAddrInfoLog, LogLevel::Warning, ("[DNS]: " msg, ##__VA_ARGS__)) + MOZ_LOG(gGetAddrInfoLog, PR_LOG_WARNING, ("[DNS]: " msg, ##__VA_ARGS__)) #if DNSQUERY_AVAILABLE // There is a bug in windns.h where the type of parameter ppQueryResultsSet for diff --git a/netwerk/dns/nsHostResolver.cpp b/netwerk/dns/nsHostResolver.cpp index 87eb24b05093..9b7cfde48821 100644 --- a/netwerk/dns/nsHostResolver.cpp +++ b/netwerk/dns/nsHostResolver.cpp @@ -70,7 +70,7 @@ PR_STATIC_ASSERT (HighThreadThreshold <= MAX_RESOLVER_THREADS); //---------------------------------------------------------------------------- static PRLogModuleInfo *gHostResolverLog = nullptr; -#define LOG(args) MOZ_LOG(gHostResolverLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gHostResolverLog, PR_LOG_DEBUG, args) #define LOG_HOST(host, interface) host, \ (interface && interface[0] != '\0') ? " on interface " : "", \ diff --git a/netwerk/protocol/ftp/FTPChannelChild.cpp b/netwerk/protocol/ftp/FTPChannelChild.cpp index a573b17c68b7..c2ce3d8473de 100644 --- a/netwerk/protocol/ftp/FTPChannelChild.cpp +++ b/netwerk/protocol/ftp/FTPChannelChild.cpp @@ -22,7 +22,7 @@ using namespace mozilla::ipc; #undef LOG -#define LOG(args) MOZ_LOG(gFTPLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gFTPLog, PR_LOG_DEBUG, args) namespace mozilla { namespace net { diff --git a/netwerk/protocol/ftp/FTPChannelParent.cpp b/netwerk/protocol/ftp/FTPChannelParent.cpp index 32e200d05c9b..8cc3f800572f 100644 --- a/netwerk/protocol/ftp/FTPChannelParent.cpp +++ b/netwerk/protocol/ftp/FTPChannelParent.cpp @@ -24,7 +24,7 @@ using namespace mozilla::ipc; #undef LOG -#define LOG(args) MOZ_LOG(gFTPLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gFTPLog, PR_LOG_DEBUG, args) namespace mozilla { namespace net { diff --git a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp index 9424f0bfd20d..b5c46f99594c 100644 --- a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp +++ b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp @@ -46,8 +46,8 @@ #endif extern PRLogModuleInfo* gFTPLog; -#define LOG(args) MOZ_LOG(gFTPLog, mozilla::LogLevel::Debug, args) -#define LOG_INFO(args) MOZ_LOG(gFTPLog, mozilla::LogLevel::Info, args) +#define LOG(args) MOZ_LOG(gFTPLog, PR_LOG_DEBUG, args) +#define LOG_ALWAYS(args) MOZ_LOG(gFTPLog, PR_LOG_ALWAYS, args) using namespace mozilla::net; @@ -92,7 +92,7 @@ nsFtpState::nsFtpState() , mControlStatus(NS_OK) , mDeferredCallbackPending(false) { - LOG_INFO(("FTP:(%x) nsFtpState created", this)); + LOG_ALWAYS(("FTP:(%x) nsFtpState created", this)); // make sure handler stays around NS_ADDREF(gFtpHandler); @@ -100,7 +100,7 @@ nsFtpState::nsFtpState() nsFtpState::~nsFtpState() { - LOG_INFO(("FTP:(%x) nsFtpState destroyed", this)); + LOG_ALWAYS(("FTP:(%x) nsFtpState destroyed", this)); if (mProxyRequest) mProxyRequest->Cancel(NS_ERROR_FAILURE); @@ -1763,7 +1763,7 @@ nsFtpState::KillControlConnection() mControlConnection->IsAlive() && mCacheConnection) { - LOG_INFO(("FTP:(%p) caching CC(%p)", this, mControlConnection.get())); + LOG_ALWAYS(("FTP:(%p) caching CC(%p)", this, mControlConnection.get())); // Store connection persistent data mControlConnection->mServerType = mServerType; @@ -1821,7 +1821,7 @@ nsFtpState::StopProcessing() return NS_OK; mKeepRunning = false; - LOG_INFO(("FTP:(%x) nsFtpState stopping", this)); + LOG_ALWAYS(("FTP:(%x) nsFtpState stopping", this)); #ifdef DEBUG_dougt printf("FTP Stopped: [response code %d] [response msg follows:]\n%s\n", mResponseCode, mResponseMsg.get()); diff --git a/netwerk/protocol/ftp/nsFtpControlConnection.cpp b/netwerk/protocol/ftp/nsFtpControlConnection.cpp index 1f158593baac..e93fff1f8c36 100644 --- a/netwerk/protocol/ftp/nsFtpControlConnection.cpp +++ b/netwerk/protocol/ftp/nsFtpControlConnection.cpp @@ -16,8 +16,8 @@ #include extern PRLogModuleInfo* gFTPLog; -#define LOG(args) MOZ_LOG(gFTPLog, mozilla::LogLevel::Debug, args) -#define LOG_INFO(args) MOZ_LOG(gFTPLog, mozilla::LogLevel::Info, args) +#define LOG(args) MOZ_LOG(gFTPLog, PR_LOG_DEBUG, args) +#define LOG_ALWAYS(args) MOZ_LOG(gFTPLog, PR_LOG_ALWAYS, args) // // nsFtpControlConnection implementation ... @@ -66,12 +66,12 @@ nsFtpControlConnection::nsFtpControlConnection(const nsCSubstring& host, : mServerType(0), mSessionId(gFtpHandler->GetSessionId()) , mUseUTF8(false), mHost(host), mPort(port) { - LOG_INFO(("FTP:CC created @%p", this)); + LOG_ALWAYS(("FTP:CC created @%p", this)); } nsFtpControlConnection::~nsFtpControlConnection() { - LOG_INFO(("FTP:CC destroyed @%p", this)); + LOG_ALWAYS(("FTP:CC destroyed @%p", this)); } bool @@ -153,7 +153,7 @@ nsFtpControlConnection::Disconnect(nsresult status) if (!mSocket) return NS_OK; // already disconnected - LOG_INFO(("FTP:(%p) CC disconnecting (%x)", this, status)); + LOG_ALWAYS(("FTP:(%p) CC disconnecting (%x)", this, status)); if (NS_FAILED(status)) { // break cyclic reference! diff --git a/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp b/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp index 977fcc4e712c..6d59a4d0142e 100644 --- a/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp +++ b/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp @@ -42,12 +42,12 @@ using namespace mozilla::net; // set NSPR_LOG_MODULES=nsFtp:5 // set NSPR_LOG_FILE=nspr.log // -// this enables LogLevel::Debug level information and places all output in +// this enables PR_LOG_DEBUG level information and places all output in // the file nspr.log // PRLogModuleInfo* gFTPLog = nullptr; #undef LOG -#define LOG(args) MOZ_LOG(gFTPLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gFTPLog, PR_LOG_DEBUG, args) //----------------------------------------------------------------------------- diff --git a/netwerk/protocol/http/HttpBaseChannel.h b/netwerk/protocol/http/HttpBaseChannel.h index 21a74e2a54bc..d2433e05abfe 100644 --- a/netwerk/protocol/http/HttpBaseChannel.h +++ b/netwerk/protocol/http/HttpBaseChannel.h @@ -474,7 +474,7 @@ protected: template nsresult HttpAsyncAborter::AsyncAbort(nsresult status) { - MOZ_LOG(gHttpLog, LogLevel::Debug, + MOZ_LOG(gHttpLog, 4, ("HttpAsyncAborter::AsyncAbort [this=%p status=%x]\n", mThis, status)); mThis->mStatus = status; @@ -491,7 +491,7 @@ inline void HttpAsyncAborter::HandleAsyncAbort() NS_PRECONDITION(!mCallOnResume, "How did that happen?"); if (mThis->mSuspendCount) { - MOZ_LOG(gHttpLog, LogLevel::Debug, + MOZ_LOG(gHttpLog, 4, ("Waiting until resume to do async notification [this=%p]\n", mThis)); mCallOnResume = &T::HandleAsyncAbort; return; diff --git a/netwerk/protocol/http/HttpLog.h b/netwerk/protocol/http/HttpLog.h index a79e0c76557f..7d91a72374d9 100644 --- a/netwerk/protocol/http/HttpLog.h +++ b/netwerk/protocol/http/HttpLog.h @@ -31,24 +31,24 @@ // set NSPR_LOG_MODULES=nsHttp:5 // set NSPR_LOG_FILE=http.log // -// this enables LogLevel::Debug level information and places all output in +// this enables PR_LOG_ALWAYS level information and places all output in // the file http.log // extern PRLogModuleInfo *gHttpLog; // http logging -#define LOG1(args) MOZ_LOG(gHttpLog, mozilla::LogLevel::Error, args) -#define LOG2(args) MOZ_LOG(gHttpLog, mozilla::LogLevel::Warning, args) -#define LOG3(args) MOZ_LOG(gHttpLog, mozilla::LogLevel::Info, args) -#define LOG4(args) MOZ_LOG(gHttpLog, mozilla::LogLevel::Debug, args) -#define LOG5(args) MOZ_LOG(gHttpLog, mozilla::LogLevel::Verbose, args) +#define LOG1(args) MOZ_LOG(gHttpLog, 1, args) +#define LOG2(args) MOZ_LOG(gHttpLog, 2, args) +#define LOG3(args) MOZ_LOG(gHttpLog, 3, args) +#define LOG4(args) MOZ_LOG(gHttpLog, 4, args) +#define LOG5(args) MOZ_LOG(gHttpLog, 5, args) #define LOG(args) LOG4(args) -#define LOG1_ENABLED() MOZ_LOG_TEST(gHttpLog, mozilla::LogLevel::Error) -#define LOG2_ENABLED() MOZ_LOG_TEST(gHttpLog, mozilla::LogLevel::Warning) -#define LOG3_ENABLED() MOZ_LOG_TEST(gHttpLog, mozilla::LogLevel::Info) -#define LOG4_ENABLED() MOZ_LOG_TEST(gHttpLog, mozilla::LogLevel::Debug) -#define LOG5_ENABLED() MOZ_LOG_TEST(gHttpLog, mozilla::LogLevel::Verbose) +#define LOG1_ENABLED() PR_LOG_TEST(gHttpLog, 1) +#define LOG2_ENABLED() PR_LOG_TEST(gHttpLog, 2) +#define LOG3_ENABLED() PR_LOG_TEST(gHttpLog, 3) +#define LOG4_ENABLED() PR_LOG_TEST(gHttpLog, 4) +#define LOG5_ENABLED() PR_LOG_TEST(gHttpLog, 5) #define LOG_ENABLED() LOG4_ENABLED() #endif // HttpLog_h__ diff --git a/netwerk/protocol/http/nsHttpConnectionInfo.h b/netwerk/protocol/http/nsHttpConnectionInfo.h index baea08efff83..5682bd191938 100644 --- a/netwerk/protocol/http/nsHttpConnectionInfo.h +++ b/netwerk/protocol/http/nsHttpConnectionInfo.h @@ -54,7 +54,7 @@ public: private: virtual ~nsHttpConnectionInfo() { - MOZ_LOG(gHttpLog, LogLevel::Debug, ("Destroying nsHttpConnectionInfo @%x\n", this)); + MOZ_LOG(gHttpLog, 4, ("Destroying nsHttpConnectionInfo @%x\n", this)); } void BuildHashKey(); diff --git a/netwerk/protocol/res/nsResProtocolHandler.cpp b/netwerk/protocol/res/nsResProtocolHandler.cpp index efe0753636c2..231d507d61b0 100644 --- a/netwerk/protocol/res/nsResProtocolHandler.cpp +++ b/netwerk/protocol/res/nsResProtocolHandler.cpp @@ -17,7 +17,6 @@ #include "mozilla/Omnijar.h" using mozilla::dom::ContentParent; -using mozilla::LogLevel; using mozilla::unused; static NS_DEFINE_CID(kResURLCID, NS_RESURL_CID); @@ -32,7 +31,7 @@ static nsResProtocolHandler *gResHandler = nullptr; // set NSPR_LOG_MODULES=nsResProtocol:5 // set NSPR_LOG_FILE=log.txt // -// this enables LogLevel::Debug level information and places all output in +// this enables PR_LOG_ALWAYS level information and places all output in // the file log.txt // static PRLogModuleInfo *gResLog; @@ -448,10 +447,10 @@ nsResProtocolHandler::ResolveURI(nsIURI *uri, nsACString &result) rv = baseURI->Resolve(nsDependentCString(p, path.Length()-1), result); - if (MOZ_LOG_TEST(gResLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gResLog, PR_LOG_DEBUG)) { nsAutoCString spec; uri->GetAsciiSpec(spec); - MOZ_LOG(gResLog, LogLevel::Debug, + MOZ_LOG(gResLog, PR_LOG_DEBUG, ("%s\n -> %s\n", spec.get(), PromiseFlatCString(result).get())); } return rv; diff --git a/netwerk/protocol/rtsp/controller/RtspController.cpp b/netwerk/protocol/rtsp/controller/RtspController.cpp index f2c4c2bfe84c..d63335bdd95d 100644 --- a/netwerk/protocol/rtsp/controller/RtspController.cpp +++ b/netwerk/protocol/rtsp/controller/RtspController.cpp @@ -45,7 +45,7 @@ extern PRLogModuleInfo* gRtspLog; #undef LOG -#define LOG(args) MOZ_LOG(gRtspLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gRtspLog, PR_LOG_DEBUG, args) namespace mozilla { namespace net { diff --git a/netwerk/protocol/rtsp/controller/RtspControllerChild.cpp b/netwerk/protocol/rtsp/controller/RtspControllerChild.cpp index 147b8c691a10..2d449e60067f 100644 --- a/netwerk/protocol/rtsp/controller/RtspControllerChild.cpp +++ b/netwerk/protocol/rtsp/controller/RtspControllerChild.cpp @@ -18,7 +18,7 @@ PRLogModuleInfo* gRtspChildLog = nullptr; #undef LOG -#define LOG(args) MOZ_LOG(gRtspChildLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gRtspChildLog, PR_LOG_DEBUG, args) const uint32_t kRtspTotalTracks = 2; const unsigned long kRtspCommandDelayMs = 200; diff --git a/netwerk/protocol/rtsp/controller/RtspControllerParent.cpp b/netwerk/protocol/rtsp/controller/RtspControllerParent.cpp index 56e780fb5e83..22b095ebf5a7 100644 --- a/netwerk/protocol/rtsp/controller/RtspControllerParent.cpp +++ b/netwerk/protocol/rtsp/controller/RtspControllerParent.cpp @@ -19,7 +19,7 @@ PRLogModuleInfo* gRtspLog; #undef LOG -#define LOG(args) MOZ_LOG(gRtspLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gRtspLog, PR_LOG_DEBUG, args) #define SEND_DISCONNECT_IF_ERROR(rv) \ if (NS_FAILED(rv) && mIPCOpen && mTotalTracks > 0ul) { \ diff --git a/netwerk/protocol/rtsp/rtsp/RtspPrlog.h b/netwerk/protocol/rtsp/rtsp/RtspPrlog.h index fb4d26492b8c..3ebd3958f282 100644 --- a/netwerk/protocol/rtsp/rtsp/RtspPrlog.h +++ b/netwerk/protocol/rtsp/rtsp/RtspPrlog.h @@ -11,9 +11,9 @@ extern PRLogModuleInfo* gRtspLog; -#define LOGI(msg, ...) MOZ_LOG(gRtspLog, mozilla::LogLevel::Info, (msg, ##__VA_ARGS__)) -#define LOGV(msg, ...) MOZ_LOG(gRtspLog, mozilla::LogLevel::Debug, (msg, ##__VA_ARGS__)) -#define LOGE(msg, ...) MOZ_LOG(gRtspLog, mozilla::LogLevel::Error, (msg, ##__VA_ARGS__)) -#define LOGW(msg, ...) MOZ_LOG(gRtspLog, mozilla::LogLevel::Warning, (msg, ##__VA_ARGS__)) +#define LOGI(msg, ...) MOZ_LOG(gRtspLog, PR_LOG_ALWAYS, (msg, ##__VA_ARGS__)) +#define LOGV(msg, ...) MOZ_LOG(gRtspLog, PR_LOG_DEBUG, (msg, ##__VA_ARGS__)) +#define LOGE(msg, ...) MOZ_LOG(gRtspLog, PR_LOG_ERROR, (msg, ##__VA_ARGS__)) +#define LOGW(msg, ...) MOZ_LOG(gRtspLog, PR_LOG_WARNING, (msg, ##__VA_ARGS__)) #endif // RTSPPRLOG_H diff --git a/netwerk/protocol/websocket/WebSocketLog.h b/netwerk/protocol/websocket/WebSocketLog.h index 3c4190d3f6e0..c84f8f482bcd 100644 --- a/netwerk/protocol/websocket/WebSocketLog.h +++ b/netwerk/protocol/websocket/WebSocketLog.h @@ -14,6 +14,6 @@ extern PRLogModuleInfo* webSocketLog; #undef LOG -#define LOG(args) MOZ_LOG(webSocketLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(webSocketLog, PR_LOG_DEBUG, args) #endif diff --git a/netwerk/protocol/wyciwyg/nsWyciwyg.h b/netwerk/protocol/wyciwyg/nsWyciwyg.h index 7fbd24a404db..21de9eefb650 100644 --- a/netwerk/protocol/wyciwyg/nsWyciwyg.h +++ b/netwerk/protocol/wyciwyg/nsWyciwyg.h @@ -20,22 +20,22 @@ // set NSPR_LOG_MODULES=nsWyciwyg:5 // set NSPR_LOG_FILE=wyciwyg.log // -// this enables LogLevel::Debug level information and places all output in +// this enables PR_LOG_ALWAYS level information and places all output in // the file wyciwyg.log // extern PRLogModuleInfo *gWyciwygLog; // http logging -#define LOG1(args) MOZ_LOG(gWyciwygLog, mozilla::LogLevel::Error, args) -#define LOG2(args) MOZ_LOG(gWyciwygLog, mozilla::LogLevel::Warning, args) -#define LOG3(args) MOZ_LOG(gWyciwygLog, mozilla::LogLevel::Info, args) -#define LOG4(args) MOZ_LOG(gWyciwygLog, mozilla::LogLevel::Debug, args) +#define LOG1(args) MOZ_LOG(gWyciwygLog, 1, args) +#define LOG2(args) MOZ_LOG(gWyciwygLog, 2, args) +#define LOG3(args) MOZ_LOG(gWyciwygLog, 3, args) +#define LOG4(args) MOZ_LOG(gWyciwygLog, 4, args) #define LOG(args) LOG4(args) -#define LOG1_ENABLED() MOZ_LOG_TEST(gWyciwygLog, mozilla::LogLevel::Error) -#define LOG2_ENABLED() MOZ_LOG_TEST(gWyciwygLog, mozilla::LogLevel::Warning) -#define LOG3_ENABLED() MOZ_LOG_TEST(gWyciwygLog, mozilla::LogLevel::Info) -#define LOG4_ENABLED() MOZ_LOG_TEST(gWyciwygLog, mozilla::LogLevel::Debug) +#define LOG1_ENABLED() PR_LOG_TEST(gWyciwygLog, 1) +#define LOG2_ENABLED() PR_LOG_TEST(gWyciwygLog, 2) +#define LOG3_ENABLED() PR_LOG_TEST(gWyciwygLog, 3) +#define LOG4_ENABLED() PR_LOG_TEST(gWyciwygLog, 4) #define LOG_ENABLED() LOG4_ENABLED() #define WYCIWYG_TYPE "text/html" diff --git a/netwerk/sctp/datachannel/DataChannel.cpp b/netwerk/sctp/datachannel/DataChannel.cpp index e9da62a7870b..e1e4f5f4113d 100644 --- a/netwerk/sctp/datachannel/DataChannel.cpp +++ b/netwerk/sctp/datachannel/DataChannel.cpp @@ -178,7 +178,7 @@ debug_printf(const char *format, ...) va_list ap; char buffer[1024]; - if (MOZ_LOG_TEST(GetSCTPLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetSCTPLog(), PR_LOG_ALWAYS)) { va_start(ap, format); #ifdef _WIN32 if (vsnprintf_s(buffer, sizeof(buffer), _TRUNCATE, format, ap) > 0) { @@ -334,8 +334,8 @@ DataChannelConnection::Init(unsigned short aPort, uint16_t aNumStreams, bool aUs ); } - // Set logging to SCTP:LogLevel::Debug to get SCTP debugs - if (MOZ_LOG_TEST(GetSCTPLog(), LogLevel::Debug)) { + // Set logging to SCTP:PR_LOG_DEBUG to get SCTP debugs + if (PR_LOG_TEST(GetSCTPLog(), PR_LOG_ALWAYS)) { usrsctp_sysctl_set_sctp_debug_on(SCTP_DEBUG_ALL); } @@ -653,7 +653,7 @@ void DataChannelConnection::SctpDtlsInput(TransportFlow *flow, const unsigned char *data, size_t len) { - if (MOZ_LOG_TEST(GetSCTPLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetSCTPLog(), PR_LOG_DEBUG)) { char *buf; if ((buf = usrsctp_dumppacket((void *)data, len, SCTP_DUMP_INBOUND)) != nullptr) { @@ -683,7 +683,7 @@ DataChannelConnection::SctpDtlsOutput(void *addr, void *buffer, size_t length, DataChannelConnection *peer = static_cast(addr); int res; - if (MOZ_LOG_TEST(GetSCTPLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetSCTPLog(), PR_LOG_DEBUG)) { char *buf; if ((buf = usrsctp_dumppacket(buffer, length, SCTP_DUMP_OUTBOUND)) != nullptr) { diff --git a/netwerk/sctp/datachannel/DataChannelLog.h b/netwerk/sctp/datachannel/DataChannelLog.h index dfa6eb607709..de9c37b09cb7 100644 --- a/netwerk/sctp/datachannel/DataChannelLog.h +++ b/netwerk/sctp/datachannel/DataChannelLog.h @@ -14,6 +14,6 @@ extern PRLogModuleInfo* GetDataChannelLog(); extern PRLogModuleInfo* GetSCTPLog(); #undef LOG -#define LOG(args) MOZ_LOG(GetDataChannelLog(), mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(GetDataChannelLog(), PR_LOG_DEBUG, args) #endif diff --git a/netwerk/socket/nsSOCKSIOLayer.cpp b/netwerk/socket/nsSOCKSIOLayer.cpp index 81761a6dd93b..13c58738988d 100644 --- a/netwerk/socket/nsSOCKSIOLayer.cpp +++ b/netwerk/socket/nsSOCKSIOLayer.cpp @@ -22,7 +22,6 @@ #include "mozilla/Logging.h" #include "mozilla/net/DNS.h" -using mozilla::LogLevel; using namespace mozilla::net; static PRDescIdentity nsSOCKSIOLayerIdentity; @@ -31,8 +30,8 @@ static bool firstTime = true; static bool ipv6Supported = true; static PRLogModuleInfo *gSOCKSLog; -#define LOGDEBUG(args) MOZ_LOG(gSOCKSLog, mozilla::LogLevel::Debug, args) -#define LOGERROR(args) MOZ_LOG(gSOCKSLog, mozilla::LogLevel::Error , args) +#define LOGDEBUG(args) MOZ_LOG(gSOCKSLog, PR_LOG_DEBUG, args) +#define LOGERROR(args) MOZ_LOG(gSOCKSLog, PR_LOG_ERROR , args) class nsSOCKSSocketInfo : public nsISOCKSSocketInfo , public nsIDNSListener @@ -425,7 +424,7 @@ nsSOCKSSocketInfo::ConnectToProxy(PRFileDesc *fd) return PR_FAILURE; } - if (MOZ_LOG_TEST(gSOCKSLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gSOCKSLog, PR_LOG_DEBUG)) { char buf[kIPv6CStrBufSize]; NetAddrToString(&mInternalProxyAddr, buf, sizeof(buf)); LOGDEBUG(("socks: trying proxy server, %s:%hu", diff --git a/netwerk/streamconv/converters/nsFTPDirListingConv.cpp b/netwerk/streamconv/converters/nsFTPDirListingConv.cpp index 29747eb46e19..90fff4640c30 100644 --- a/netwerk/streamconv/converters/nsFTPDirListingConv.cpp +++ b/netwerk/streamconv/converters/nsFTPDirListingConv.cpp @@ -27,7 +27,7 @@ // set NSPR_LOG_MODULES=nsFTPDirListConv:5 // set NSPR_LOG_FILE=nspr.log // -// this enables LogLevel::Debug level information and places all output in +// this enables PR_LOG_DEBUG level information and places all output in // the file nspr.log // PRLogModuleInfo* gFTPDirListConvLog = nullptr; @@ -61,7 +61,7 @@ nsFTPDirListingConv::AsyncConvertData(const char *aFromType, const char *aToType mFinalListener = aListener; NS_ADDREF(mFinalListener); - MOZ_LOG(gFTPDirListConvLog, LogLevel::Debug, + MOZ_LOG(gFTPDirListConvLog, PR_LOG_DEBUG, ("nsFTPDirListingConv::AsyncConvertData() converting FROM raw, TO application/http-index-format\n")); return NS_OK; @@ -95,7 +95,7 @@ nsFTPDirListingConv::OnDataAvailable(nsIRequest* request, nsISupports *ctxt, // the dir listings are ascii text, null terminate this sucker. buffer[streamLen] = '\0'; - MOZ_LOG(gFTPDirListConvLog, LogLevel::Debug, ("nsFTPDirListingConv::OnData(request = %x, ctxt = %x, inStr = %x, sourceOffset = %llu, count = %u)\n", request, ctxt, inStr, sourceOffset, count)); + MOZ_LOG(gFTPDirListConvLog, PR_LOG_DEBUG, ("nsFTPDirListingConv::OnData(request = %x, ctxt = %x, inStr = %x, sourceOffset = %llu, count = %u)\n", request, ctxt, inStr, sourceOffset, count)); if (!mBuffer.IsEmpty()) { // we have data left over from a previous OnDataAvailable() call. @@ -110,7 +110,7 @@ nsFTPDirListingConv::OnDataAvailable(nsIRequest* request, nsISupports *ctxt, } #ifndef DEBUG_dougt - MOZ_LOG(gFTPDirListConvLog, LogLevel::Debug, ("::OnData() received the following %d bytes...\n\n%s\n\n", streamLen, buffer.get()) ); + MOZ_LOG(gFTPDirListConvLog, PR_LOG_DEBUG, ("::OnData() received the following %d bytes...\n\n%s\n\n", streamLen, buffer.get()) ); #else printf("::OnData() received the following %d bytes...\n\n%s\n\n", streamLen, buffer); #endif // DEBUG_dougt @@ -132,7 +132,7 @@ nsFTPDirListingConv::OnDataAvailable(nsIRequest* request, nsISupports *ctxt, line = DigestBufferLines(line, indexFormat); #ifndef DEBUG_dougt - MOZ_LOG(gFTPDirListConvLog, LogLevel::Debug, ("::OnData() sending the following %d bytes...\n\n%s\n\n", + MOZ_LOG(gFTPDirListConvLog, PR_LOG_DEBUG, ("::OnData() sending the following %d bytes...\n\n%s\n\n", indexFormat.Length(), indexFormat.get()) ); #else char *unescData = ToNewCString(indexFormat); @@ -146,7 +146,7 @@ nsFTPDirListingConv::OnDataAvailable(nsIRequest* request, nsISupports *ctxt, // if there's any data left over, buffer it. if (line && *line) { mBuffer.Append(line); - MOZ_LOG(gFTPDirListConvLog, LogLevel::Debug, ("::OnData() buffering the following %d bytes...\n\n%s\n\n", + MOZ_LOG(gFTPDirListConvLog, PR_LOG_DEBUG, ("::OnData() buffering the following %d bytes...\n\n%s\n\n", strlen(line), line) ); } diff --git a/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp b/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp index 3a415658421f..ca38adb162cf 100644 --- a/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp +++ b/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp @@ -39,7 +39,7 @@ using namespace mozilla; static PRLogModuleInfo *gNotifyAddrLog = nullptr; -#define LOG(args) MOZ_LOG(gNotifyAddrLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gNotifyAddrLog, PR_LOG_DEBUG, args) #define NETWORK_NOTIFY_CHANGED_PREF "network.notify.changed" diff --git a/netwerk/system/win32/nsNotifyAddrListener.cpp b/netwerk/system/win32/nsNotifyAddrListener.cpp index 7646305061c2..f5745d3aa7b5 100644 --- a/netwerk/system/win32/nsNotifyAddrListener.cpp +++ b/netwerk/system/win32/nsNotifyAddrListener.cpp @@ -36,7 +36,7 @@ using namespace mozilla; static PRLogModuleInfo *gNotifyAddrLog = nullptr; -#define LOG(args) MOZ_LOG(gNotifyAddrLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gNotifyAddrLog, PR_LOG_DEBUG, args) static HMODULE sNetshell; static decltype(NcFreeNetconProperties)* sNcFreeNetconProperties; diff --git a/netwerk/test/TestBlockingSocket.cpp b/netwerk/test/TestBlockingSocket.cpp index 33acfcf40760..bf0151fe4d71 100644 --- a/netwerk/test/TestBlockingSocket.cpp +++ b/netwerk/test/TestBlockingSocket.cpp @@ -23,7 +23,7 @@ // set NSPR_LOG_MODULES=Test:5 // static PRLogModuleInfo *gTestLog = nullptr; -#define LOG(args) MOZ_LOG(gTestLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gTestLog, PR_LOG_DEBUG, args) //////////////////////////////////////////////////////////////////////////////// diff --git a/netwerk/test/TestIOThreads.cpp b/netwerk/test/TestIOThreads.cpp index 0bebad868085..6e368c479b08 100644 --- a/netwerk/test/TestIOThreads.cpp +++ b/netwerk/test/TestIOThreads.cpp @@ -15,7 +15,7 @@ // set NSPR_LOG_MODULES=Test:5 // static PRLogModuleInfo *gTestLog = nullptr; -#define LOG(args) MOZ_LOG(gTestLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gTestLog, PR_LOG_DEBUG, args) class nsIOEvent : public nsIRunnable { public: diff --git a/netwerk/test/TestOverlappedIO.cpp b/netwerk/test/TestOverlappedIO.cpp index db954b4f6295..5d403507a1a5 100644 --- a/netwerk/test/TestOverlappedIO.cpp +++ b/netwerk/test/TestOverlappedIO.cpp @@ -27,7 +27,7 @@ #include "nsIByteArrayInputStream.h" static PRLogModuleInfo *gTestSocketIOLog; -#define LOG(args) MOZ_LOG(gTestSocketIOLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gTestSocketIOLog, PR_LOG_DEBUG, args) static NS_DEFINE_CID(kSocketTransportServiceCID, NS_SOCKETTRANSPORTSERVICE_CID); static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); diff --git a/netwerk/test/TestProtocols.cpp b/netwerk/test/TestProtocols.cpp index 412285685e7b..cdd274d4053f 100644 --- a/netwerk/test/TestProtocols.cpp +++ b/netwerk/test/TestProtocols.cpp @@ -65,7 +65,7 @@ namespace TestProtocols { // set NSPR_LOG_MODULES=Test:5 // static PRLogModuleInfo *gTestLog = nullptr; -#define LOG(args) MOZ_LOG(gTestLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gTestLog, PR_LOG_DEBUG, args) static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID); diff --git a/netwerk/test/TestServ.cpp b/netwerk/test/TestServ.cpp index 79a6a336fd30..a824d8279168 100644 --- a/netwerk/test/TestServ.cpp +++ b/netwerk/test/TestServ.cpp @@ -17,7 +17,7 @@ // set NSPR_LOG_MODULES=Test:5 // static PRLogModuleInfo *gTestLog = nullptr; -#define LOG(args) MOZ_LOG(gTestLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gTestLog, PR_LOG_DEBUG, args) class MySocketListener : public nsIServerSocketListener { diff --git a/netwerk/test/TestSocketIO.cpp b/netwerk/test/TestSocketIO.cpp index 319e8e1a4bcc..3716928c9f55 100644 --- a/netwerk/test/TestSocketIO.cpp +++ b/netwerk/test/TestSocketIO.cpp @@ -26,7 +26,7 @@ #include "nsIByteArrayInputStream.h" static PRLogModuleInfo *gTestSocketIOLog; -#define LOG(args) MOZ_LOG(gTestSocketIOLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gTestSocketIOLog, PR_LOG_DEBUG, args) static NS_DEFINE_CID(kSocketTransportServiceCID, NS_SOCKETTRANSPORTSERVICE_CID); static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); diff --git a/netwerk/test/TestSocketTransport.cpp b/netwerk/test/TestSocketTransport.cpp index a702e9261ce3..45a3dbed4abd 100644 --- a/netwerk/test/TestSocketTransport.cpp +++ b/netwerk/test/TestSocketTransport.cpp @@ -31,7 +31,7 @@ // set NSPR_LOG_MODULES=Test:5 // static PRLogModuleInfo *gTestLog = nullptr; -#define LOG(args) MOZ_LOG(gTestLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gTestLog, PR_LOG_DEBUG, args) //////////////////////////////////////////////////////////////////////////////// diff --git a/netwerk/test/TestStreamChannel.cpp b/netwerk/test/TestStreamChannel.cpp index 80ee03d736e2..d0fffa2886ab 100644 --- a/netwerk/test/TestStreamChannel.cpp +++ b/netwerk/test/TestStreamChannel.cpp @@ -29,7 +29,7 @@ // set NSPR_LOG_MODULES=Test:5 // static PRLogModuleInfo *gTestLog = nullptr; -#define LOG(args) MOZ_LOG(gTestLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gTestLog, PR_LOG_DEBUG, args) //////////////////////////////////////////////////////////////////////////////// diff --git a/netwerk/test/TestStreamLoader.cpp b/netwerk/test/TestStreamLoader.cpp index 1ddc105036f2..d5aef5dfbe43 100644 --- a/netwerk/test/TestStreamLoader.cpp +++ b/netwerk/test/TestStreamLoader.cpp @@ -10,7 +10,7 @@ // set NSPR_LOG_MODULES=Test:5 // static PRLogModuleInfo *gTestLog = nullptr; -#define LOG(args) MOZ_LOG(gTestLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gTestLog, PR_LOG_DEBUG, args) class MyStreamLoaderObserver final : public nsIStreamLoaderObserver { diff --git a/netwerk/test/TestStreamPump.cpp b/netwerk/test/TestStreamPump.cpp index 376b9deb7cba..b24751d02700 100644 --- a/netwerk/test/TestStreamPump.cpp +++ b/netwerk/test/TestStreamPump.cpp @@ -31,7 +31,7 @@ // set NSPR_LOG_MODULES=Test:5 // static PRLogModuleInfo *gTestLog = nullptr; -#define LOG(args) MOZ_LOG(gTestLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gTestLog, PR_LOG_DEBUG, args) //////////////////////////////////////////////////////////////////////////////// diff --git a/netwerk/test/TestStreamTransport.cpp b/netwerk/test/TestStreamTransport.cpp index dd6230aeedca..5d50e544255a 100644 --- a/netwerk/test/TestStreamTransport.cpp +++ b/netwerk/test/TestStreamTransport.cpp @@ -29,7 +29,7 @@ // set NSPR_LOG_MODULES=Test:5 // static PRLogModuleInfo *gTestLog = nullptr; -#define LOG(args) MOZ_LOG(gTestLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gTestLog, PR_LOG_DEBUG, args) //////////////////////////////////////////////////////////////////////////////// diff --git a/netwerk/test/TestUpload.cpp b/netwerk/test/TestUpload.cpp index e65e9c0228fb..d39e8def8bd8 100644 --- a/netwerk/test/TestUpload.cpp +++ b/netwerk/test/TestUpload.cpp @@ -20,7 +20,7 @@ // set NSPR_LOG_MODULES=Test:5 // static PRLogModuleInfo *gTestLog = nullptr; -#define LOG(args) MOZ_LOG(gTestLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gTestLog, PR_LOG_DEBUG, args) //----------------------------------------------------------------------------- // InputTestConsumer diff --git a/netwerk/wifi/nsWifiAccessPoint.cpp b/netwerk/wifi/nsWifiAccessPoint.cpp index d3dbcfee84c8..dab50a8c13bd 100644 --- a/netwerk/wifi/nsWifiAccessPoint.cpp +++ b/netwerk/wifi/nsWifiAccessPoint.cpp @@ -8,7 +8,7 @@ #include "mozilla/Logging.h" extern PRLogModuleInfo *gWifiMonitorLog; -#define LOG(args) MOZ_LOG(gWifiMonitorLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gWifiMonitorLog, PR_LOG_DEBUG, args) NS_IMPL_ISUPPORTS(nsWifiAccessPoint, nsIWifiAccessPoint) diff --git a/netwerk/wifi/nsWifiMonitor.h b/netwerk/wifi/nsWifiMonitor.h index 4ab5962b1ed2..a199623b87bc 100644 --- a/netwerk/wifi/nsWifiMonitor.h +++ b/netwerk/wifi/nsWifiMonitor.h @@ -27,7 +27,7 @@ #endif extern PRLogModuleInfo *gWifiMonitorLog; -#define LOG(args) MOZ_LOG(gWifiMonitorLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gWifiMonitorLog, PR_LOG_DEBUG, args) class nsWifiAccessPoint; diff --git a/parser/htmlparser/nsExpatDriver.cpp b/parser/htmlparser/nsExpatDriver.cpp index e3d58010268c..45173048b579 100644 --- a/parser/htmlparser/nsExpatDriver.cpp +++ b/parser/htmlparser/nsExpatDriver.cpp @@ -29,10 +29,6 @@ #include "nsXPCOMCIDInternal.h" #include "nsUnicharInputStream.h" -#include "mozilla/Logging.h" - -using mozilla::LogLevel; - #define kExpatSeparatorChar 0xFFFF static const char16_t kUTF16[] = { 'U', 'T', 'F', '-', '1', '6', '\0' }; @@ -1062,7 +1058,7 @@ nsExpatDriver::ConsumeToken(nsScanner& aScanner, bool& aFlushTokens) nsScannerIterator end; aScanner.EndReading(end); - MOZ_LOG(GetExpatDriverLog(), LogLevel::Debug, + MOZ_LOG(GetExpatDriverLog(), PR_LOG_DEBUG, ("Remaining in expat's buffer: %i, remaining in scanner: %i.", mExpatBuffered, Distance(start, end))); @@ -1083,7 +1079,7 @@ nsExpatDriver::ConsumeToken(nsScanner& aScanner, bool& aFlushTokens) length = 0; if (blocked) { - MOZ_LOG(GetExpatDriverLog(), LogLevel::Debug, + MOZ_LOG(GetExpatDriverLog(), PR_LOG_DEBUG, ("Resuming Expat, will parse data remaining in Expat's " "buffer.\nContent of Expat's buffer:\n-----\n%s\n-----\n", NS_ConvertUTF16toUTF8(currentExpatPosition.get(), @@ -1092,7 +1088,7 @@ nsExpatDriver::ConsumeToken(nsScanner& aScanner, bool& aFlushTokens) else { NS_ASSERTION(mExpatBuffered == Distance(currentExpatPosition, end), "Didn't pass all the data to Expat?"); - MOZ_LOG(GetExpatDriverLog(), LogLevel::Debug, + MOZ_LOG(GetExpatDriverLog(), PR_LOG_DEBUG, ("Last call to Expat, will parse data remaining in Expat's " "buffer.\nContent of Expat's buffer:\n-----\n%s\n-----\n", NS_ConvertUTF16toUTF8(currentExpatPosition.get(), @@ -1103,7 +1099,7 @@ nsExpatDriver::ConsumeToken(nsScanner& aScanner, bool& aFlushTokens) buffer = start.get(); length = uint32_t(start.size_forward()); - MOZ_LOG(GetExpatDriverLog(), LogLevel::Debug, + MOZ_LOG(GetExpatDriverLog(), PR_LOG_DEBUG, ("Calling Expat, will parse data remaining in Expat's buffer and " "new data.\nContent of Expat's buffer:\n-----\n%s\n-----\nNew " "data:\n-----\n%s\n-----\n", @@ -1143,7 +1139,7 @@ nsExpatDriver::ConsumeToken(nsScanner& aScanner, bool& aFlushTokens) mExpatBuffered += length - consumed; if (BlockedOrInterrupted()) { - MOZ_LOG(GetExpatDriverLog(), LogLevel::Debug, + MOZ_LOG(GetExpatDriverLog(), PR_LOG_DEBUG, ("Blocked or interrupted parser (probably for loading linked " "stylesheets or scripts).")); @@ -1204,7 +1200,7 @@ nsExpatDriver::ConsumeToken(nsScanner& aScanner, bool& aFlushTokens) aScanner.SetPosition(currentExpatPosition, true); aScanner.Mark(); - MOZ_LOG(GetExpatDriverLog(), LogLevel::Debug, + MOZ_LOG(GetExpatDriverLog(), PR_LOG_DEBUG, ("Remaining in expat's buffer: %i, remaining in scanner: %i.", mExpatBuffered, Distance(currentExpatPosition, end))); diff --git a/rdf/base/nsInMemoryDataSource.cpp b/rdf/base/nsInMemoryDataSource.cpp index 199ae611319a..7414408e37d2 100644 --- a/rdf/base/nsInMemoryDataSource.cpp +++ b/rdf/base/nsInMemoryDataSource.cpp @@ -69,8 +69,6 @@ #include "rdfIDataSource.h" #include "rdfITripleVisitor.h" -using mozilla::LogLevel; - // This struct is used as the slot value in the forward and reverse // arcs hash tables. // @@ -795,7 +793,7 @@ InMemoryDataSource::~InMemoryDataSource() PL_DHashTableEnumerate(&mForwardArcs, DeleteForwardArcsEntry, nullptr); } - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_NOTICE, ("InMemoryDataSource(%p): destroyed.", this)); MOZ_COUNT_DTOR(InMemoryDataSource); @@ -851,7 +849,7 @@ InMemoryDataSource::LogOperation(const char* aOperation, nsIRDFNode* aTarget, bool aTruthValue) { - if (! MOZ_LOG_TEST(gLog, LogLevel::Debug)) + if (! PR_LOG_TEST(gLog, PR_LOG_NOTICE)) return; nsXPIDLCString uri; diff --git a/rdf/base/nsRDFContentSink.cpp b/rdf/base/nsRDFContentSink.cpp index 7310f91c6887..e4a7deeae9a8 100644 --- a/rdf/base/nsRDFContentSink.cpp +++ b/rdf/base/nsRDFContentSink.cpp @@ -307,7 +307,7 @@ RDFContentSinkImpl::~RDFContentSinkImpl() NS_IF_RELEASE(mDocumentURL); if (mContextStack) { - MOZ_LOG(gLog, LogLevel::Warning, + MOZ_LOG(gLog, PR_LOG_WARNING, ("rdfxml: warning! unclosed tag")); // XXX we should never need to do this, but, we'll write the @@ -323,10 +323,10 @@ RDFContentSinkImpl::~RDFContentSinkImpl() // print some fairly useless debugging info // XXX we should save line numbers on the context stack: this'd // be about 1000x more helpful. - if (resource && MOZ_LOG_TEST(gLog, LogLevel::Debug)) { + if (resource && PR_LOG_TEST(gLog, PR_LOG_NOTICE)) { nsXPIDLCString uri; resource->GetValue(getter_Copies(uri)); - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_NOTICE, ("rdfxml: uri=%s", (const char*) uri)); } @@ -421,7 +421,7 @@ RDFContentSinkImpl::HandleStartElement(const char16_t *aName, break; case eRDFContentSinkState_InEpilog: - MOZ_LOG(gLog, LogLevel::Warning, + MOZ_LOG(gLog, PR_LOG_WARNING, ("rdfxml: unexpected content in epilog at line %d", aLineNumber)); break; @@ -438,7 +438,7 @@ RDFContentSinkImpl::HandleEndElement(const char16_t *aName) nsIRDFResource* resource; if (NS_FAILED(PopContext(resource, mState, mParseMode))) { // XXX parser didn't catch unmatched tags? - if (MOZ_LOG_TEST(gLog, LogLevel::Warning)) { + if (PR_LOG_TEST(gLog, PR_LOG_WARNING)) { nsAutoString tagStr(aName); char* tagCStr = ToNewCString(tagStr); @@ -850,7 +850,7 @@ RDFContentSinkImpl::GetIdAboutAttribute(const char16_t** aAttributes, } else if (localName == kAboutEachAtom) { // XXX we don't deal with aboutEach... - //MOZ_LOG(gLog, LogLevel::Warning, + //MOZ_LOG(gLog, PR_LOG_WARNING, // ("rdfxml: ignoring aboutEach at line %d", // aNode.GetSourceLineNumber())); } @@ -1039,7 +1039,7 @@ RDFContentSinkImpl::OpenRDF(const char16_t* aName) SplitExpatName(aName, getter_AddRefs(localName)); if (!nameSpaceURI.EqualsLiteral(RDF_NAMESPACE_URI) || localName != kRDFAtom) { - // MOZ_LOG(gLog, LogLevel::Info, + // MOZ_LOG(gLog, PR_LOG_ALWAYS, // ("rdfxml: expected RDF:RDF at line %d", // aNode.GetSourceLineNumber())); @@ -1213,7 +1213,7 @@ RDFContentSinkImpl::OpenMember(const char16_t* aName, if (!nameSpaceURI.EqualsLiteral(RDF_NAMESPACE_URI) || localName != kLiAtom) { - MOZ_LOG(gLog, LogLevel::Error, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("rdfxml: expected RDF:li at line %d", -1)); // XXX pass in line number diff --git a/rdf/base/nsRDFService.cpp b/rdf/base/nsRDFService.cpp index ee7401eeecff..1540d888efdd 100644 --- a/rdf/base/nsRDFService.cpp +++ b/rdf/base/nsRDFService.cpp @@ -834,7 +834,7 @@ RDFServiceImpl::GetResource(const nsACString& aURI, nsIRDFResource** aResource) return NS_ERROR_INVALID_ARG; const nsAFlatCString& flatURI = PromiseFlatCString(aURI); - MOZ_LOG(gLog, LogLevel::Debug, ("rdfserv get-resource %s", flatURI.get())); + MOZ_LOG(gLog, PR_LOG_DEBUG, ("rdfserv get-resource %s", flatURI.get())); // First, check the cache to see if we've already created and // registered this thing. @@ -1133,7 +1133,7 @@ RDFServiceImpl::RegisterResource(nsIRDFResource* aResource, bool aReplace) // only ever held a weak reference to it. We simply replace // it. - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_DEBUG, ("rdfserv replace-resource [%p] <-- [%p] %s", static_cast(hdr)->mResource, aResource, (const char*) uri)); @@ -1143,7 +1143,7 @@ RDFServiceImpl::RegisterResource(nsIRDFResource* aResource, bool aReplace) if (! hdr) return NS_ERROR_OUT_OF_MEMORY; - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_DEBUG, ("rdfserv register-resource [%p] %s", aResource, (const char*) uri)); } @@ -1176,7 +1176,7 @@ RDFServiceImpl::UnregisterResource(nsIRDFResource* aResource) if (! uri) return NS_ERROR_UNEXPECTED; - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_DEBUG, ("rdfserv unregister-resource [%p] %s", aResource, (const char*) uri)); @@ -1212,7 +1212,7 @@ RDFServiceImpl::RegisterDataSource(nsIRDFDataSource* aDataSource, bool aReplace) // N.B., we only hold a weak reference to the datasource, so // just replace the old with the new and don't touch any // refcounts. - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_NOTICE, ("rdfserv replace-datasource [%p] <-- [%p] %s", (*hep)->value, aDataSource, (const char*) uri)); @@ -1225,7 +1225,7 @@ RDFServiceImpl::RegisterDataSource(nsIRDFDataSource* aDataSource, bool aReplace) PL_HashTableAdd(mNamedDataSources, key, aDataSource); - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_NOTICE, ("rdfserv register-datasource [%p] %s", aDataSource, (const char*) uri)); @@ -1265,7 +1265,7 @@ RDFServiceImpl::UnregisterDataSource(nsIRDFDataSource* aDataSource) // don't release here. PL_HashTableRawRemove(mNamedDataSources, hep, *hep); - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_NOTICE, ("rdfserv unregister-datasource [%p] %s", aDataSource, (const char*) uri)); @@ -1389,7 +1389,7 @@ RDFServiceImpl::RegisterLiteral(nsIRDFLiteral* aLiteral) entry->mLiteral = aLiteral; entry->mKey = value; - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_DEBUG, ("rdfserv register-literal [%p] %s", aLiteral, (const char16_t*) value)); @@ -1410,7 +1410,7 @@ RDFServiceImpl::UnregisterLiteral(nsIRDFLiteral* aLiteral) // N.B. that we _don't_ release the literal: we only held a weak // reference to it in the hashtable. - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_DEBUG, ("rdfserv unregister-literal [%p] %s", aLiteral, (const char16_t*) value)); @@ -1441,7 +1441,7 @@ RDFServiceImpl::RegisterInt(nsIRDFInt* aInt) entry->mInt = aInt; entry->mKey = value; - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_DEBUG, ("rdfserv register-int [%p] %d", aInt, value)); @@ -1462,7 +1462,7 @@ RDFServiceImpl::UnregisterInt(nsIRDFInt* aInt) // N.B. that we _don't_ release the literal: we only held a weak // reference to it in the hashtable. - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_DEBUG, ("rdfserv unregister-int [%p] %d", aInt, value)); @@ -1493,7 +1493,7 @@ RDFServiceImpl::RegisterDate(nsIRDFDate* aDate) entry->mDate = aDate; entry->mKey = value; - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_DEBUG, ("rdfserv register-date [%p] %ld", aDate, value)); @@ -1514,7 +1514,7 @@ RDFServiceImpl::UnregisterDate(nsIRDFDate* aDate) // N.B. that we _don't_ release the literal: we only held a weak // reference to it in the hashtable. - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_DEBUG, ("rdfserv unregister-date [%p] %ld", aDate, value)); @@ -1539,7 +1539,7 @@ RDFServiceImpl::RegisterBlob(BlobImpl *aBlob) // made will be owned by the callee. entry->mBlob = aBlob; - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_DEBUG, ("rdfserv register-blob [%p] %s", aBlob, aBlob->mData.mBytes)); @@ -1556,7 +1556,7 @@ RDFServiceImpl::UnregisterBlob(BlobImpl *aBlob) // N.B. that we _don't_ release the literal: we only held a weak // reference to it in the hashtable. - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_DEBUG, ("rdfserv unregister-blob [%p] %s", aBlob, aBlob->mData.mBytes)); diff --git a/rdf/base/nsRDFXMLDataSource.cpp b/rdf/base/nsRDFXMLDataSource.cpp index 4579a1838fb1..d281c1a7e7a2 100644 --- a/rdf/base/nsRDFXMLDataSource.cpp +++ b/rdf/base/nsRDFXMLDataSource.cpp @@ -827,10 +827,10 @@ RDFXMLDataSourceImpl::Flush(void) if (! mURL) return NS_ERROR_NOT_INITIALIZED; - if (MOZ_LOG_TEST(gLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gLog, PR_LOG_NOTICE)) { nsAutoCString spec; mURL->GetSpec(spec); - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_NOTICE, ("rdfxml[%p] flush(%s)", this, spec.get())); } @@ -911,13 +911,13 @@ RDFXMLDataSourceImpl::Refresh(bool aBlocking) if (mURL) { mURL->GetSpec(spec); } - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_NOTICE, ("rdfxml[%p] refresh(%s) %sblocking", this, spec.get(), (aBlocking ? "" : "non"))); // If an asynchronous load is already pending, then just let it do // the honors. if (IsLoading()) { - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_NOTICE, ("rdfxml[%p] refresh(%s) a load was pending", this, spec.get())); if (aBlocking) { @@ -969,12 +969,12 @@ RDFXMLDataSourceImpl::Refresh(bool aBlocking) NS_IMETHODIMP RDFXMLDataSourceImpl::BeginLoad(void) { - if (MOZ_LOG_TEST(gLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gLog, PR_LOG_NOTICE)) { nsAutoCString spec; if (mURL) { mURL->GetSpec(spec); } - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_NOTICE, ("rdfxml[%p] begin-load(%s)", this, spec.get())); } @@ -995,12 +995,12 @@ RDFXMLDataSourceImpl::BeginLoad(void) NS_IMETHODIMP RDFXMLDataSourceImpl::Interrupt(void) { - if (MOZ_LOG_TEST(gLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gLog, PR_LOG_NOTICE)) { nsAutoCString spec; if (mURL) { mURL->GetSpec(spec); } - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_NOTICE, ("rdfxml[%p] interrupt(%s)", this, spec.get())); } @@ -1020,12 +1020,12 @@ RDFXMLDataSourceImpl::Interrupt(void) NS_IMETHODIMP RDFXMLDataSourceImpl::Resume(void) { - if (MOZ_LOG_TEST(gLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gLog, PR_LOG_NOTICE)) { nsAutoCString spec; if (mURL) { mURL->GetSpec(spec); } - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_NOTICE, ("rdfxml[%p] resume(%s)", this, spec.get())); } @@ -1045,12 +1045,12 @@ RDFXMLDataSourceImpl::Resume(void) NS_IMETHODIMP RDFXMLDataSourceImpl::EndLoad(void) { - if (MOZ_LOG_TEST(gLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gLog, PR_LOG_NOTICE)) { nsAutoCString spec; if (mURL) { mURL->GetSpec(spec); } - MOZ_LOG(gLog, LogLevel::Debug, + MOZ_LOG(gLog, PR_LOG_NOTICE, ("rdfxml[%p] end-load(%s)", this, spec.get())); } diff --git a/security/apps/AppSignatureVerification.cpp b/security/apps/AppSignatureVerification.cpp index e3a8a66ac974..43bc990a8a60 100644 --- a/security/apps/AppSignatureVerification.cpp +++ b/security/apps/AppSignatureVerification.cpp @@ -775,7 +775,7 @@ OpenSignedAppFile(AppTrustedRoot aTrustedRoot, nsIFile* aJarFile, rv = entries->GetNext(entryFilename); NS_ENSURE_SUCCESS(rv, rv); - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("Verifying digests for %s", + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("Verifying digests for %s", entryFilename.get())); // The files that comprise the signature mechanism are not covered by the diff --git a/security/certverifier/CertVerifier.cpp b/security/certverifier/CertVerifier.cpp index 9136445e7969..b2aa28f29ccc 100644 --- a/security/certverifier/CertVerifier.cpp +++ b/security/certverifier/CertVerifier.cpp @@ -68,7 +68,7 @@ IsCertBuiltInRoot(CERTCertificate* cert, bool& result) { } for (PK11SlotListElement* le = slots->head; le; le = le->next) { char* token = PK11_GetTokenName(le->slot); - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("BuiltInRoot? subject=%s token=%s",cert->subjectName, token)); if (strcmp("Builtin Object Token", token) == 0) { result = true; @@ -125,7 +125,7 @@ CertVerifier::VerifyCert(CERTCertificate* cert, SECCertificateUsage usage, /*optional out*/ OCSPStaplingStatus* ocspStaplingStatus, /*optional out*/ KeySizeStatus* keySizeStatus) { - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, ("Top of VerifyCert\n")); + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("Top of VerifyCert\n")); PR_ASSERT(cert); PR_ASSERT(usage == certificateUsageSSLServer || !(flags & FLAG_MUST_BE_EV)); diff --git a/security/certverifier/NSSCertDBTrustDomain.cpp b/security/certverifier/NSSCertDBTrustDomain.cpp index f4360df39ac1..1a4203f9798b 100644 --- a/security/certverifier/NSSCertDBTrustDomain.cpp +++ b/security/certverifier/NSSCertDBTrustDomain.cpp @@ -199,7 +199,7 @@ NSSCertDBTrustDomain::GetCertTrust(EndEntityOrCA endEntityOrCA, } if (isCertRevoked) { - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("NSSCertDBTrustDomain: certificate is in blocklist")); return Result::ERROR_REVOKED_CERTIFICATE; } @@ -341,7 +341,7 @@ NSSCertDBTrustDomain::CheckRevocation(EndEntityOrCA endEntityOrCA, // TODO: need to verify that IsRevoked isn't called for trust anchors AND // that that fact is documented in mozillapkix. - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("NSSCertDBTrustDomain: Top of CheckRevocation\n")); // Bug 991815: The BR allow OCSP for intermediates to be up to one year old. @@ -375,7 +375,7 @@ NSSCertDBTrustDomain::CheckRevocation(EndEntityOrCA endEntityOrCA, if (stapledOCSPResponseResult == Success) { // stapled OCSP response present and good mOCSPStaplingStatus = CertVerifier::OCSP_STAPLING_GOOD; - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("NSSCertDBTrustDomain: stapled OCSP response: good")); return Success; } @@ -383,19 +383,19 @@ NSSCertDBTrustDomain::CheckRevocation(EndEntityOrCA endEntityOrCA, expired) { // stapled OCSP response present but expired mOCSPStaplingStatus = CertVerifier::OCSP_STAPLING_EXPIRED; - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("NSSCertDBTrustDomain: expired stapled OCSP response")); } else { // stapled OCSP response present but invalid for some reason mOCSPStaplingStatus = CertVerifier::OCSP_STAPLING_INVALID; - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("NSSCertDBTrustDomain: stapled OCSP response: failure")); return stapledOCSPResponseResult; } } else if (endEntityOrCA == EndEntityOrCA::MustBeEndEntity) { // no stapled OCSP response mOCSPStaplingStatus = CertVerifier::OCSP_STAPLING_NONE; - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("NSSCertDBTrustDomain: no stapled OCSP response")); } @@ -406,20 +406,20 @@ NSSCertDBTrustDomain::CheckRevocation(EndEntityOrCA endEntityOrCA, cachedResponseValidThrough); if (cachedResponsePresent) { if (cachedResponseResult == Success && cachedResponseValidThrough >= time) { - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("NSSCertDBTrustDomain: cached OCSP response: good")); return Success; } // If we have a cached revoked response, use it. if (cachedResponseResult == Result::ERROR_REVOKED_CERTIFICATE) { - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("NSSCertDBTrustDomain: cached OCSP response: revoked")); return Result::ERROR_REVOKED_CERTIFICATE; } // The cached response may indicate an unknown certificate or it may be // expired. Don't return with either of these statuses yet - we may be // able to fetch a more recent one. - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("NSSCertDBTrustDomain: cached OCSP response: error %ld valid " "until %lld", cachedResponseResult, cachedResponseValidThrough)); // When a good cached response has expired, it is more convenient @@ -438,7 +438,7 @@ NSSCertDBTrustDomain::CheckRevocation(EndEntityOrCA endEntityOrCA, cachedResponsePresent = false; } } else { - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("NSSCertDBTrustDomain: no cached OCSP response")); } // At this point, if and only if cachedErrorResult is Success, there was no @@ -571,25 +571,25 @@ NSSCertDBTrustDomain::CheckRevocation(EndEntityOrCA endEntityOrCA, } } if (mOCSPFetching != FetchOCSPForDVSoftFail) { - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("NSSCertDBTrustDomain: returning SECFailure after " "OCSP request failure")); return error; } if (cachedResponseResult == Result::ERROR_OCSP_UNKNOWN_CERT) { - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("NSSCertDBTrustDomain: returning SECFailure from cached " "response after OCSP request failure")); return cachedResponseResult; } if (stapledOCSPResponseResult != Success) { - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("NSSCertDBTrustDomain: returning SECFailure from expired " "stapled response after OCSP request failure")); return stapledOCSPResponseResult; } - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("NSSCertDBTrustDomain: returning SECSuccess after " "OCSP request failure")); return Success; // Soft fail -> success :( @@ -604,7 +604,7 @@ NSSCertDBTrustDomain::CheckRevocation(EndEntityOrCA endEntityOrCA, response, ResponseIsFromNetwork, expired); if (rv == Success || mOCSPFetching != FetchOCSPForDVSoftFail) { - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("NSSCertDBTrustDomain: returning after VerifyEncodedOCSPResponse")); return rv; } @@ -614,13 +614,13 @@ NSSCertDBTrustDomain::CheckRevocation(EndEntityOrCA endEntityOrCA, return rv; } if (stapledOCSPResponseResult != Success) { - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("NSSCertDBTrustDomain: returning SECFailure from expired stapled " "response after OCSP request verification failure")); return stapledOCSPResponseResult; } - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("NSSCertDBTrustDomain: end of CheckRevocation")); return Success; // Soft fail -> success :( @@ -658,7 +658,7 @@ NSSCertDBTrustDomain::VerifyAndMaybeCacheEncodedOCSPResponse( rv == Success || rv == Result::ERROR_REVOKED_CERTIFICATE || rv == Result::ERROR_OCSP_UNKNOWN_CERT) { - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("NSSCertDBTrustDomain: caching OCSP response")); Result putRV = mOCSPCache.Put(certID, rv, thisUpdate, validThrough); if (putRV != Success) { @@ -706,7 +706,7 @@ private: Result NSSCertDBTrustDomain::IsChainValid(const DERArray& certArray, Time time) { - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("NSSCertDBTrustDomain: IsChainValid")); ScopedCERTCertList certList; diff --git a/security/certverifier/OCSPCache.cpp b/security/certverifier/OCSPCache.cpp index 29796bc61d2c..fd480cd7d2c2 100644 --- a/security/certverifier/OCSPCache.cpp +++ b/security/certverifier/OCSPCache.cpp @@ -138,7 +138,7 @@ OCSPCache::FindInternal(const CertID& aCertID, /*out*/ size_t& index, static inline void LogWithCertID(const char* aMessage, const CertID& aCertID) { - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, (aMessage, &aCertID)); + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, (aMessage, &aCertID)); } void @@ -261,7 +261,7 @@ void OCSPCache::Clear() { MutexAutoLock lock(mMutex); - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, ("OCSPCache::Clear: clearing cache")); + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("OCSPCache::Clear: clearing cache")); // First go through and delete the memory being pointed to by the pointers // in the vector. for (Entry** entry = mEntries.begin(); entry < mEntries.end(); diff --git a/security/certverifier/OCSPRequestor.cpp b/security/certverifier/OCSPRequestor.cpp index c750447e6283..23fe6d829173 100644 --- a/security/certverifier/OCSPRequestor.cpp +++ b/security/certverifier/OCSPRequestor.cpp @@ -56,7 +56,7 @@ AppendEscapedBase64Item(const SECItem* encodedRequest, nsACString& path) return rv; } - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("Setting up OCSP GET path, pre path =%s\n", PromiseFlatCString(path).get())); @@ -159,7 +159,7 @@ DoOCSPRequest(PLArenaPool* arena, const char* url, } else { path.Assign("/"); } - MOZ_LOG(gCertVerifierLog, LogLevel::Debug, + MOZ_LOG(gCertVerifierLog, PR_LOG_DEBUG, ("Setting up OCSP request: pre all path =%s pathlen=%d\n", path.get(), pathLen)); nsAutoCString method("POST"); diff --git a/security/manager/ssl/CertBlocklist.cpp b/security/manager/ssl/CertBlocklist.cpp index a03a7f21c482..29cb831fa822 100644 --- a/security/manager/ssl/CertBlocklist.cpp +++ b/security/manager/ssl/CertBlocklist.cpp @@ -141,11 +141,11 @@ CertBlocklist::~CertBlocklist() nsresult CertBlocklist::Init() { - MOZ_LOG(gCertBlockPRLog, LogLevel::Debug, ("CertBlocklist::Init")); + MOZ_LOG(gCertBlockPRLog, PR_LOG_DEBUG, ("CertBlocklist::Init")); // Init must be on main thread for getting the profile directory if (!NS_IsMainThread()) { - MOZ_LOG(gCertBlockPRLog, LogLevel::Debug, + MOZ_LOG(gCertBlockPRLog, PR_LOG_DEBUG, ("CertBlocklist::Init - called off main thread")); return NS_ERROR_NOT_SAME_THREAD; } @@ -169,7 +169,7 @@ CertBlocklist::Init() rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(mBackingFile)); if (NS_FAILED(rv) || !mBackingFile) { - MOZ_LOG(gCertBlockPRLog, LogLevel::Debug, + MOZ_LOG(gCertBlockPRLog, PR_LOG_DEBUG, ("CertBlocklist::Init - couldn't get profile dir")); // Since we're returning NS_OK here, set mBackingFile to a safe value. // (We need initialization to succeed and CertBlocklist to be in a @@ -186,7 +186,7 @@ CertBlocklist::Init() if (NS_FAILED(rv)) { return rv; } - MOZ_LOG(gCertBlockPRLog, LogLevel::Debug, + MOZ_LOG(gCertBlockPRLog, PR_LOG_DEBUG, ("CertBlocklist::Init certList path: %s", path.get())); return NS_OK; @@ -195,13 +195,13 @@ CertBlocklist::Init() nsresult CertBlocklist::EnsureBackingFileInitialized(MutexAutoLock& lock) { - MOZ_LOG(gCertBlockPRLog, LogLevel::Debug, + MOZ_LOG(gCertBlockPRLog, PR_LOG_DEBUG, ("CertBlocklist::EnsureBackingFileInitialized")); if (mBackingFileIsInitialized || !mBackingFile) { return NS_OK; } - MOZ_LOG(gCertBlockPRLog, LogLevel::Debug, + MOZ_LOG(gCertBlockPRLog, PR_LOG_DEBUG, ("CertBlocklist::EnsureBackingFileInitialized - not initialized")); bool exists = false; @@ -210,7 +210,7 @@ CertBlocklist::EnsureBackingFileInitialized(MutexAutoLock& lock) return rv; } if (!exists) { - MOZ_LOG(gCertBlockPRLog, LogLevel::Warning, + MOZ_LOG(gCertBlockPRLog, PR_LOG_WARN, ("CertBlocklist::EnsureBackingFileInitialized no revocations file")); return NS_OK; } @@ -263,11 +263,11 @@ CertBlocklist::EnsureBackingFileInitialized(MutexAutoLock& lock) if (DN.IsEmpty() || other.IsEmpty()) { continue; } - MOZ_LOG(gCertBlockPRLog, LogLevel::Debug, + MOZ_LOG(gCertBlockPRLog, PR_LOG_DEBUG, ("CertBlocklist::EnsureBackingFileInitialized adding: %s %s", DN.get(), other.get())); - MOZ_LOG(gCertBlockPRLog, LogLevel::Debug, + MOZ_LOG(gCertBlockPRLog, PR_LOG_DEBUG, ("CertBlocklist::EnsureBackingFileInitialized - pre-decode")); rv = AddRevokedCertInternal(DN, other, mechanism, CertOldFromLocalCache, @@ -276,7 +276,7 @@ CertBlocklist::EnsureBackingFileInitialized(MutexAutoLock& lock) if (NS_FAILED(rv)) { // we warn here, rather than abandoning, since we need to // ensure that as many items as possible are read - MOZ_LOG(gCertBlockPRLog, LogLevel::Warning, + MOZ_LOG(gCertBlockPRLog, PR_LOG_WARN, ("CertBlocklist::EnsureBackingFileInitialized adding revoked cert " "failed")); } @@ -290,7 +290,7 @@ NS_IMETHODIMP CertBlocklist::RevokeCertBySubjectAndPubKey(const char* aSubject, const char* aPubKeyHash) { - MOZ_LOG(gCertBlockPRLog, LogLevel::Debug, + MOZ_LOG(gCertBlockPRLog, PR_LOG_DEBUG, ("CertBlocklist::RevokeCertBySubjectAndPubKey - subject is: %s and pubKeyHash: %s", aSubject, aPubKeyHash)); MutexAutoLock lock(mMutex); @@ -306,7 +306,7 @@ NS_IMETHODIMP CertBlocklist::RevokeCertByIssuerAndSerial(const char* aIssuer, const char* aSerialNumber) { - MOZ_LOG(gCertBlockPRLog, LogLevel::Debug, + MOZ_LOG(gCertBlockPRLog, PR_LOG_DEBUG, ("CertBlocklist::RevokeCertByIssuerAndSerial - issuer is: %s and serial: %s", aIssuer, aSerialNumber)); MutexAutoLock lock(mMutex); @@ -481,7 +481,7 @@ WriteIssuer(nsCStringHashKey* aHashKey, void* aUserArg) NS_IMETHODIMP CertBlocklist::SaveEntries() { - MOZ_LOG(gCertBlockPRLog, LogLevel::Debug, + MOZ_LOG(gCertBlockPRLog, PR_LOG_DEBUG, ("CertBlocklist::SaveEntries - not initialized")); MutexAutoLock lock(mMutex); if (!mModified) { @@ -495,7 +495,7 @@ CertBlocklist::SaveEntries() if (!mBackingFile) { // We allow this to succeed with no profile directory for tests - MOZ_LOG(gCertBlockPRLog, LogLevel::Warning, + MOZ_LOG(gCertBlockPRLog, PR_LOG_WARN, ("CertBlocklist::SaveEntries no file in profile to write to")); return NS_OK; } @@ -516,14 +516,14 @@ CertBlocklist::SaveEntries() mBlocklist.EnumerateEntries(ProcessBlocklistEntry, &saveInfo); if (!saveInfo.success) { - MOZ_LOG(gCertBlockPRLog, LogLevel::Warning, + MOZ_LOG(gCertBlockPRLog, PR_LOG_WARN, ("CertBlocklist::SaveEntries writing revocation data failed")); return NS_ERROR_FAILURE; } saveInfo.issuers.EnumerateEntries(WriteIssuer, &saveInfo); if (!saveInfo.success) { - MOZ_LOG(gCertBlockPRLog, LogLevel::Warning, + MOZ_LOG(gCertBlockPRLog, PR_LOG_WARN, ("CertBlocklist::SaveEntries writing revocation data failed")); return NS_ERROR_FAILURE; } @@ -536,7 +536,7 @@ CertBlocklist::SaveEntries() } rv = safeStream->Finish(); if (NS_FAILED(rv)) { - MOZ_LOG(gCertBlockPRLog, LogLevel::Warning, + MOZ_LOG(gCertBlockPRLog, PR_LOG_WARN, ("CertBlocklist::SaveEntries saving revocation data failed")); return rv; } @@ -627,12 +627,12 @@ CertBlocklist::IsBlocklistFresh(bool* _retval) if (now > sLastBlocklistUpdate) { int64_t interval = now - sLastBlocklistUpdate; - MOZ_LOG(gCertBlockPRLog, LogLevel::Warning, + MOZ_LOG(gCertBlockPRLog, PR_LOG_WARN, ("CertBlocklist::IsBlocklistFresh we're after the last BlocklistUpdate " "interval is %i, staleness %u", interval, sMaxStaleness)); *_retval = sMaxStaleness > interval; } - MOZ_LOG(gCertBlockPRLog, LogLevel::Warning, + MOZ_LOG(gCertBlockPRLog, PR_LOG_WARN, ("CertBlocklist::IsBlocklistFresh ? %s", *_retval ? "true" : "false")); return NS_OK; } @@ -646,7 +646,7 @@ CertBlocklist::PreferenceChanged(const char* aPref, void* aClosure) CertBlocklist* blocklist = reinterpret_cast(aClosure); MutexAutoLock lock(blocklist->mMutex); - MOZ_LOG(gCertBlockPRLog, LogLevel::Warning, + MOZ_LOG(gCertBlockPRLog, PR_LOG_WARN, ("CertBlocklist::PreferenceChanged %s changed", aPref)); if (strcmp(aPref, PREF_BACKGROUND_UPDATE_TIMER) == 0) { sLastBlocklistUpdate = Preferences::GetUint(PREF_BACKGROUND_UPDATE_TIMER, diff --git a/security/manager/ssl/PSMContentListener.cpp b/security/manager/ssl/PSMContentListener.cpp index ddbd8d852fe8..3de40f92b4d1 100644 --- a/security/manager/ssl/PSMContentListener.cpp +++ b/security/manager/ssl/PSMContentListener.cpp @@ -109,7 +109,7 @@ NS_IMPL_ISUPPORTS(PSMContentStreamListener, nsIStreamListener, nsIRequestObserve NS_IMETHODIMP PSMContentStreamListener::OnStartRequest(nsIRequest* request, nsISupports* context) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("CertDownloader::OnStartRequest\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("CertDownloader::OnStartRequest\n")); int64_t contentLength = ComputeContentLength(request); if (contentLength < 0) { @@ -127,7 +127,7 @@ PSMContentStreamListener::OnDataAvailable(nsIRequest* request, uint64_t aSourceOffset, uint32_t aLength) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("CertDownloader::OnDataAvailable\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("CertDownloader::OnDataAvailable\n")); nsCString chunk; nsresult rv = NS_ReadInputStreamToString(aIStream, chunk, aLength); @@ -144,7 +144,7 @@ PSMContentStreamListener::OnStopRequest(nsIRequest* request, nsISupports* context, nsresult aStatus) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("CertDownloader::OnStopRequest\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("CertDownloader::OnStopRequest\n")); // Because importing the cert can spin the event loop (via alerts), we can't // do it here. Do it off the event loop instead. @@ -398,7 +398,7 @@ PSMContentListener::DoContent(const nsACString& aContentType, uint32_t type; type = getPSMContentType(PromiseFlatCString(aContentType).get()); if (gPIPNSSLog) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("PSMContentListener::DoContent\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("PSMContentListener::DoContent\n")); } if (type != UNKNOWN_TYPE) { nsCOMPtr downloader; diff --git a/security/manager/ssl/PublicKeyPinningService.cpp b/security/manager/ssl/PublicKeyPinningService.cpp index 262bd4d61ce3..338ab7a1ac55 100644 --- a/security/manager/ssl/PublicKeyPinningService.cpp +++ b/security/manager/ssl/PublicKeyPinningService.cpp @@ -59,7 +59,7 @@ EvalCertWithHashType(const CERTCertificate* cert, SECOidTag hashType, { certMatchesPinset = false; if (!fingerprints && !dynamicFingerprints) { - MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug, + MOZ_LOG(gPublicKeyPinningLog, PR_LOG_DEBUG, ("pkpin: No hashes found for hash type: %d\n", hashType)); return NS_ERROR_INVALID_ARG; } @@ -67,7 +67,7 @@ EvalCertWithHashType(const CERTCertificate* cert, SECOidTag hashType, nsAutoCString base64Out; nsresult rv = GetBase64HashSPKI(cert, hashType, base64Out); if (NS_FAILED(rv)) { - MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug, + MOZ_LOG(gPublicKeyPinningLog, PR_LOG_DEBUG, ("pkpin: GetBase64HashSPKI failed!\n")); return rv; } @@ -75,7 +75,7 @@ EvalCertWithHashType(const CERTCertificate* cert, SECOidTag hashType, if (fingerprints) { for (size_t i = 0; i < fingerprints->size; i++) { if (base64Out.Equals(fingerprints->data[i])) { - MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug, + MOZ_LOG(gPublicKeyPinningLog, PR_LOG_DEBUG, ("pkpin: found pin base_64 ='%s'\n", base64Out.get())); certMatchesPinset = true; return NS_OK; @@ -85,7 +85,7 @@ EvalCertWithHashType(const CERTCertificate* cert, SECOidTag hashType, if (dynamicFingerprints) { for (size_t i = 0; i < dynamicFingerprints->Length(); i++) { if (base64Out.Equals((*dynamicFingerprints)[i])) { - MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug, + MOZ_LOG(gPublicKeyPinningLog, PR_LOG_DEBUG, ("pkpin: found pin base_64 ='%s'\n", base64Out.get())); certMatchesPinset = true; return NS_OK; @@ -126,9 +126,9 @@ EvalChainWithHashType(const CERTCertList* certList, SECOidTag hashType, for (node = CERT_LIST_HEAD(certList); !CERT_LIST_END(node, certList); node = CERT_LIST_NEXT(node)) { currentCert = node->cert; - MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug, + MOZ_LOG(gPublicKeyPinningLog, PR_LOG_DEBUG, ("pkpin: certArray subject: '%s'\n", currentCert->subjectName)); - MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug, + MOZ_LOG(gPublicKeyPinningLog, PR_LOG_DEBUG, ("pkpin: certArray issuer: '%s'\n", currentCert->issuerName)); nsresult rv = EvalCertWithHashType(currentCert, hashType, fingerprints, dynamicFingerprints, @@ -140,7 +140,7 @@ EvalChainWithHashType(const CERTCertList* certList, SECOidTag hashType, return NS_OK; } } - MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug, ("pkpin: no matches found\n")); + MOZ_LOG(gPublicKeyPinningLog, PR_LOG_DEBUG, ("pkpin: no matches found\n")); return NS_OK; } @@ -212,7 +212,7 @@ FindPinningInformation(const char* hostname, mozilla::pkix::Time time, char *evalPart; // Notice how the (xx = strchr) prevents pins for unqualified domain names. while (!foundEntry && (evalPart = strchr(evalHost, '.'))) { - MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug, + MOZ_LOG(gPublicKeyPinningLog, PR_LOG_DEBUG, ("pkpin: Querying pinsets for host: '%s'\n", evalHost)); // Attempt dynamic pins first nsresult rv; @@ -225,7 +225,7 @@ FindPinningInformation(const char* hostname, mozilla::pkix::Time time, return rv; } if (found && (evalHost == hostname || includeSubdomains)) { - MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug, + MOZ_LOG(gPublicKeyPinningLog, PR_LOG_DEBUG, ("pkpin: Found dyn match for host: '%s'\n", evalHost)); dynamicFingerprints = pinArray; return NS_OK; @@ -237,7 +237,7 @@ FindPinningInformation(const char* hostname, mozilla::pkix::Time time, sizeof(TransportSecurityPreload), TransportSecurityPreloadCompare); if (foundEntry) { - MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug, + MOZ_LOG(gPublicKeyPinningLog, PR_LOG_DEBUG, ("pkpin: Found pinset for host: '%s'\n", evalHost)); if (evalHost != hostname) { if (!foundEntry->mIncludeSubdomains) { @@ -246,7 +246,7 @@ FindPinningInformation(const char* hostname, mozilla::pkix::Time time, } } } else { - MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug, + MOZ_LOG(gPublicKeyPinningLog, PR_LOG_DEBUG, ("pkpin: Didn't find pinset for host: '%s'\n", evalHost)); } // Add one for '.' @@ -335,7 +335,7 @@ CheckPinsForHostname(const CERTCertList* certList, const char* hostname, } } - MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug, + MOZ_LOG(gPublicKeyPinningLog, PR_LOG_DEBUG, ("pkpin: Pin check %s for %s host '%s' (mode=%s)\n", enforceTestModeResult ? "passed" : "failed", staticFingerprints->mIsMoz ? "mozilla" : "non-mozilla", diff --git a/security/manager/ssl/RootCertificateTelemetryUtils.cpp b/security/manager/ssl/RootCertificateTelemetryUtils.cpp index 2ca71627dd0a..1bb31eab6f9b 100644 --- a/security/manager/ssl/RootCertificateTelemetryUtils.cpp +++ b/security/manager/ssl/RootCertificateTelemetryUtils.cpp @@ -60,7 +60,7 @@ RootCABinNumber(const SECItem* cert) // Compare against list of stored hashes size_t idx; - MOZ_LOG(gPublicKeyPinningTelemetryLog, LogLevel::Debug, + MOZ_LOG(gPublicKeyPinningTelemetryLog, PR_LOG_DEBUG, ("pkpinTelem: First bytes %02hx %02hx %02hx %02hx\n", digest.get().data[0], digest.get().data[1], digest.get().data[2], digest.get().data[3])); @@ -69,7 +69,7 @@ RootCABinNumber(const SECItem* cert) reinterpret_cast(digest.get().data), digest.get().len), &idx)) { - MOZ_LOG(gPublicKeyPinningTelemetryLog, LogLevel::Debug, + MOZ_LOG(gPublicKeyPinningTelemetryLog, PR_LOG_DEBUG, ("pkpinTelem: Telemetry index was %lu, bin is %d\n", idx, ROOT_TABLE[idx].binNumber)); return (int32_t) ROOT_TABLE[idx].binNumber; diff --git a/security/manager/ssl/SSLServerCertVerification.cpp b/security/manager/ssl/SSLServerCertVerification.cpp index 05072b4c98b9..8b4862f3c7ae 100644 --- a/security/manager/ssl/SSLServerCertVerification.cpp +++ b/security/manager/ssl/SSLServerCertVerification.cpp @@ -448,7 +448,7 @@ DetermineCertOverrideErrors(CERTCertificate* cert, const char* hostName, SSLServerCertVerificationResult* CertErrorRunnable::CheckCertOverrides() { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("[%p][%p] top of CheckCertOverrides\n", + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p][%p] top of CheckCertOverrides\n", mFdForLogging, this)); // "Use" mFdForLogging in non-PR_LOGGING builds, too, to suppress // clang's -Wunused-private-field build warning for this variable: @@ -464,7 +464,7 @@ CertErrorRunnable::CheckCertOverrides() NS_ISUPPORTS_CAST(nsITransportSecurityInfo*, mInfoObject)); if (sslSocketControl && sslSocketControl->GetBypassAuthentication()) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p][%p] Bypass Auth in CheckCertOverrides\n", mFdForLogging, this)); return new SSLServerCertVerificationResult(mInfoObject, 0); @@ -487,7 +487,7 @@ CertErrorRunnable::CheckCertOverrides() bool hasPinningInformation = false; nsCOMPtr sss(do_GetService(NS_SSSERVICE_CONTRACTID)); if (!sss) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p][%p] couldn't get nsISiteSecurityService to check for HSTS/HPKP\n", mFdForLogging, this)); return new SSLServerCertVerificationResult(mInfoObject, @@ -498,7 +498,7 @@ CertErrorRunnable::CheckCertOverrides() mProviderFlags, &strictTransportSecurityEnabled); if (NS_FAILED(nsrv)) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p][%p] checking for HSTS failed\n", mFdForLogging, this)); return new SSLServerCertVerificationResult(mInfoObject, mDefaultErrorCodeToReport); @@ -508,14 +508,14 @@ CertErrorRunnable::CheckCertOverrides() mProviderFlags, &hasPinningInformation); if (NS_FAILED(nsrv)) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p][%p] checking for HPKP failed\n", mFdForLogging, this)); return new SSLServerCertVerificationResult(mInfoObject, mDefaultErrorCodeToReport); } if (!strictTransportSecurityEnabled && !hasPinningInformation) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p][%p] no HSTS or HPKP - overrides allowed\n", mFdForLogging, this)); nsCOMPtr overrideService = @@ -559,18 +559,18 @@ CertErrorRunnable::CheckCertOverrides() } // all errors are covered by override rules, so let's accept the cert - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p][%p] All errors covered by override rules\n", mFdForLogging, this)); return new SSLServerCertVerificationResult(mInfoObject, 0); } } else { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p][%p] HSTS or HPKP - no overrides allowed\n", mFdForLogging, this)); } - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p][%p] Certificate error was not overridden\n", mFdForLogging, this)); @@ -668,7 +668,7 @@ CreateCertErrorRunnable(CertVerifier& certVerifier, if (!collected_errors) { // This will happen when CERT_*Verify* only returned error(s) that are // not on our whitelist of overridable certificate errors. - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("[%p] !collected_errors: %d\n", + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p] !collected_errors: %d\n", fdForLogging, static_cast(defaultErrorCodeToReport))); PR_SetError(defaultErrorCodeToReport, 0); return nullptr; @@ -818,7 +818,7 @@ BlockServerCertChangeForSpdy(nsNSSSocketInfo* infoObject, } // If GetNegotiatedNPN() failed we will assume spdy for safety's safe if (NS_FAILED(rv)) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("BlockServerCertChangeForSpdy failed GetNegotiatedNPN() call." " Assuming spdy.\n")); } @@ -832,7 +832,7 @@ BlockServerCertChangeForSpdy(nsNSSSocketInfo* infoObject, } // Report an error - changed cert is confirmed - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("SPDY Refused to allow new cert during renegotiation\n")); PR_SetError(SSL_ERROR_RENEGOTIATION_NOT_ALLOWED, 0); return SECFailure; @@ -846,7 +846,7 @@ AccumulateSubjectCommonNameTelemetry(const char* commonName, // 1 means no common name present Telemetry::Accumulate(Telemetry::BR_9_2_2_SUBJECT_COMMON_NAME, 1); } else if (!commonNameInSubjectAltNames) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("BR telemetry: common name '%s' not in subject alt. names " "(or the subject alt. names extension is not present)\n", commonName)); @@ -909,7 +909,7 @@ GatherBaselineRequirementsTelemetry(const ScopedCERTCertList& certList) bool isBuiltIn = false; SECStatus rv = IsCertBuiltInRoot(rootCert, isBuiltIn); if (rv != SECSuccess || !isBuiltIn) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("BR telemetry: root certificate for '%s' is not a built-in root " "(or IsCertBuiltInRoot failed)\n", commonName.get())); return; @@ -918,7 +918,7 @@ GatherBaselineRequirementsTelemetry(const ScopedCERTCertList& certList) rv = CERT_FindCertExtension(cert, SEC_OID_X509_SUBJECT_ALT_NAME, &altNameExtension); if (rv != SECSuccess) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("BR telemetry: no subject alt names extension for '%s'\n", commonName.get())); // 1 means there is no subject alt names extension @@ -936,7 +936,7 @@ GatherBaselineRequirementsTelemetry(const ScopedCERTCertList& certList) // manually reach in and free the memory. PORT_Free(altNameExtension.data); if (!subjectAltNames) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("BR telemetry: could not decode subject alt names for '%s'\n", commonName.get())); // 2 means the subject alt names extension could not be decoded @@ -968,7 +968,7 @@ GatherBaselineRequirementsTelemetry(const ScopedCERTCertList& certList) if (!net_IsValidHostName(altNameWithoutWildcard) || net_IsValidIPv4Addr(altName.get(), altName.Length()) || net_IsValidIPv6Addr(altName.get(), altName.Length())) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("BR telemetry: DNSName '%s' not valid (for '%s')\n", altName.get(), commonName.get())); malformedDNSNameOrIPAddressPresent = true; @@ -985,7 +985,7 @@ GatherBaselineRequirementsTelemetry(const ScopedCERTCertList& certList) memcpy(&addr.inet.ip, currentName->name.other.data, currentName->name.other.len); if (PR_NetAddrToString(&addr, buf, sizeof(buf) - 1) != PR_SUCCESS) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("BR telemetry: IPAddress (v4) not valid (for '%s')\n", commonName.get())); malformedDNSNameOrIPAddressPresent = true; @@ -997,7 +997,7 @@ GatherBaselineRequirementsTelemetry(const ScopedCERTCertList& certList) memcpy(&addr.ipv6.ip, currentName->name.other.data, currentName->name.other.len); if (PR_NetAddrToString(&addr, buf, sizeof(buf) - 1) != PR_SUCCESS) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("BR telemetry: IPAddress (v6) not valid (for '%s')\n", commonName.get())); malformedDNSNameOrIPAddressPresent = true; @@ -1005,13 +1005,13 @@ GatherBaselineRequirementsTelemetry(const ScopedCERTCertList& certList) altName.Assign(buf); } } else { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("BR telemetry: IPAddress not valid (for '%s')\n", commonName.get())); malformedDNSNameOrIPAddressPresent = true; } } else { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("BR telemetry: non-DNSName, non-IPAddress present for '%s'\n", commonName.get())); nonDNSNameOrIPAddressPresent = true; @@ -1251,7 +1251,7 @@ AuthCertificate(CertVerifier& certVerifier, } status->SetServerCert(nsc, evStatus); - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("AuthCertificate setting NEW cert %p\n", nsc.get())); } } @@ -1329,7 +1329,7 @@ SSLServerCertVerificationJob::Run() { // Runs on a cert verification thread - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p] SSLServerCertVerificationJob::Run\n", mInfoObject.get())); PRErrorCode error; @@ -1381,7 +1381,7 @@ SSLServerCertVerificationJob::Run() // will dispatch the result asynchronously, so we don't have to block // this thread waiting for it. - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p][%p] Before dispatching CertErrorRunnable\n", mFdForLogging, runnable.get())); @@ -1429,7 +1429,7 @@ AuthCertificateHook(void* arg, PRFileDesc* fd, PRBool checkSig, PRBool isServer) // Runs on the socket transport thread - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p] starting AuthCertificateHook\n", fd)); // Modern libssl always passes PR_TRUE for checkSig, and we have no means of diff --git a/security/manager/ssl/nsCertTree.cpp b/security/manager/ssl/nsCertTree.cpp index 9556de5f6d8d..0085c492213a 100644 --- a/security/manager/ssl/nsCertTree.cpp +++ b/security/manager/ssl/nsCertTree.cpp @@ -430,7 +430,7 @@ nsCertTree::GetCertsByTypeFromCertList(CERTCertList *aCertList, nsCertCompareFunc aCertCmpFn, void *aCertCmpFnArg) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("GetCertsByTypeFromCertList")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("GetCertsByTypeFromCertList")); if (!aCertList) return NS_ERROR_FAILURE; @@ -1351,23 +1351,23 @@ nsCertTree::dumpMap() { for (int i=0; iorgName); - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("thread desc[%d]: %s", i, NS_LossyConvertUTF16toASCII(td).get())); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("thread desc[%d]: %s", i, NS_LossyConvertUTF16toASCII(td).get())); } nsCOMPtr ct = GetCertAtIndex(i); if (ct) { char16_t *goo; ct->GetCommonName(&goo); nsAutoString doo(goo); - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("cert [%d]: %s", i, NS_LossyConvertUTF16toASCII(doo).get())); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("cert [%d]: %s", i, NS_LossyConvertUTF16toASCII(doo).get())); } } } diff --git a/security/manager/ssl/nsNSSCallbacks.cpp b/security/manager/ssl/nsNSSCallbacks.cpp index dadee90f8558..830fec16a7e2 100644 --- a/security/manager/ssl/nsNSSCallbacks.cpp +++ b/security/manager/ssl/nsNSSCallbacks.cpp @@ -275,7 +275,7 @@ SECStatus nsNSSHttpRequestSession::trySendAndReceiveFcn(PRPollDesc **pPollDesc, const char **http_response_data, uint32_t *http_response_data_len) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsNSSHttpRequestSession::trySendAndReceiveFcn to %s\n", mURL.get())); bool onSTSThread; @@ -313,7 +313,7 @@ SECStatus nsNSSHttpRequestSession::trySendAndReceiveFcn(PRPollDesc **pPollDesc, { if (retryable_error) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsNSSHttpRequestSession::trySendAndReceiveFcn - sleeping and retrying: %d of %d\n", retry_count, max_retries)); } @@ -335,10 +335,10 @@ SECStatus nsNSSHttpRequestSession::trySendAndReceiveFcn(PRPollDesc **pPollDesc, if (retry_count > 1) { if (retryable_error) - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsNSSHttpRequestSession::trySendAndReceiveFcn - still failing, giving up...\n")); else - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsNSSHttpRequestSession::trySendAndReceiveFcn - success at attempt %d\n", retry_count)); } @@ -660,7 +660,7 @@ nsHTTPListener::OnStreamComplete(nsIStreamLoader* aLoader, if (NS_FAILED(aStatus)) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsHTTPListener::OnStreamComplete status failed %d", aStatus)); } @@ -953,7 +953,7 @@ CanFalseStartCallback(PRFileDesc* fd, void* client_data, PRBool *canFalseStart) SSLCipherSuiteInfo cipherInfo; if (SSL_GetCipherSuiteInfo(channelInfo.cipherSuite, &cipherInfo, sizeof (cipherInfo)) != SECSuccess) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("CanFalseStartCallback [%p] failed - " + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("CanFalseStartCallback [%p] failed - " " KEA %d\n", fd, static_cast(cipherInfo.keaType))); return SECSuccess; @@ -964,7 +964,7 @@ CanFalseStartCallback(PRFileDesc* fd, void* client_data, PRBool *canFalseStart) // Prevent version downgrade attacks from TLS 1.2, and avoid False Start for // TLS 1.3 and later. See Bug 861310 for all the details as to why. if (channelInfo.protocolVersion != SSL_LIBRARY_VERSION_TLS_1_2) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("CanFalseStartCallback [%p] failed - " + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("CanFalseStartCallback [%p] failed - " "SSL Version must be TLS 1.2, was %x\n", fd, static_cast(channelInfo.protocolVersion))); reasonsForNotFalseStarting |= POSSIBLE_VERSION_DOWNGRADE; @@ -972,7 +972,7 @@ CanFalseStartCallback(PRFileDesc* fd, void* client_data, PRBool *canFalseStart) // See bug 952863 for why ECDHE is allowed, but DHE (and RSA) are not. if (cipherInfo.keaType != ssl_kea_ecdh) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("CanFalseStartCallback [%p] failed - " + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("CanFalseStartCallback [%p] failed - " "unsupported KEA %d\n", fd, static_cast(cipherInfo.keaType))); reasonsForNotFalseStarting |= KEA_NOT_SUPPORTED; @@ -982,7 +982,7 @@ CanFalseStartCallback(PRFileDesc* fd, void* client_data, PRBool *canFalseStart) // mode due to BEAST, POODLE, and other attacks on the MAC-then-Encrypt // design. See bug 1109766 for more details. if (cipherInfo.symCipher != ssl_calg_aes_gcm) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("CanFalseStartCallback [%p] failed - Symmetric cipher used, %d, " "is not supported with False Start.\n", fd, static_cast(cipherInfo.symCipher))); @@ -1001,7 +1001,7 @@ CanFalseStartCallback(PRFileDesc* fd, void* client_data, PRBool *canFalseStart) nsAutoCString negotiatedNPN; if (NS_FAILED(infoObject->GetNegotiatedNPN(negotiatedNPN)) || !negotiatedNPN.Length()) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("CanFalseStartCallback [%p] failed - " + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("CanFalseStartCallback [%p] failed - " "NPN cannot be verified\n", fd)); reasonsForNotFalseStarting |= NPN_NOT_NEGOTIATED; } @@ -1014,7 +1014,7 @@ CanFalseStartCallback(PRFileDesc* fd, void* client_data, PRBool *canFalseStart) *canFalseStart = PR_TRUE; infoObject->SetFalseStarted(); infoObject->NoteTimeUntilReady(); - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("CanFalseStartCallback [%p] ok\n", fd)); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("CanFalseStartCallback [%p] ok\n", fd)); } return SECSuccess; @@ -1124,7 +1124,7 @@ void HandshakeCallback(PRFileDesc* fd, void* client_data) { SSLVersionRange versions(infoObject->GetTLSVersionRange()); - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p] HandshakeCallback: succeeded using TLS version range (0x%04x,0x%04x)\n", fd, static_cast(versions.min), static_cast(versions.max))); @@ -1269,12 +1269,12 @@ void HandshakeCallback(PRFileDesc* fd, void* client_data) { status); if (status->HasServerCert()) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("HandshakeCallback KEEPING existing cert\n")); } else { ScopedCERTCertificate serverCert(SSL_PeerCertificate(fd)); RefPtr nssc(nsNSSCertificate::Create(serverCert.get())); - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("HandshakeCallback using NEW cert %p\n", nssc.get())); status->SetServerCert(nssc, nsNSSCertificate::ev_status_unknown); } diff --git a/security/manager/ssl/nsNSSCertificate.cpp b/security/manager/ssl/nsNSSCertificate.cpp index 7687b95b56f0..fac0ee64b242 100644 --- a/security/manager/ssl/nsNSSCertificate.cpp +++ b/security/manager/ssl/nsNSSCertificate.cpp @@ -822,7 +822,7 @@ nsNSSCertificate::GetChain(nsIArray** _rvChain) NS_ENSURE_ARG(_rvChain); nsresult rv; - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("Getting chain for \"%s\"\n", mCert->nickname)); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("Getting chain for \"%s\"\n", mCert->nickname)); mozilla::pkix::Time now(mozilla::pkix::Now()); @@ -856,7 +856,7 @@ nsNSSCertificate::GetChain(nsIArray** _rvChain) if ((usage & otherUsagesToTest) == 0) { continue; } - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("pipnss: PKIX attempting chain(%d) for '%s'\n", usage, mCert->nickname)); if (certVerifier->VerifyCert(mCert.get(), usage, now, @@ -874,7 +874,7 @@ nsNSSCertificate::GetChain(nsIArray** _rvChain) // There is not verified path for the chain, howeever we still want to // present to the user as much of a possible chain as possible, in the case // where there was a problem with the cert or the issuers. - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("pipnss: getchain :CertVerify failed to get chain for '%s'\n", mCert->nickname)); nssChain = CERT_GetCertChainFromCert(mCert.get(), PR_Now(), @@ -895,7 +895,7 @@ nsNSSCertificate::GetChain(nsIArray** _rvChain) for (node = CERT_LIST_HEAD(nssChain.get()); !CERT_LIST_END(node, nssChain.get()); node = CERT_LIST_NEXT(node)) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("adding %s to chain\n", node->cert->nickname)); nsCOMPtr cert = nsNSSCertificate::Create(node->cert); array->AppendElement(cert, false); @@ -921,7 +921,7 @@ nsNSSCertificate::GetAllTokenNames(uint32_t* aLength, char16_t*** aTokenNames) // Get the slots from NSS ScopedPK11SlotList slots; - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("Getting slots for \"%s\"\n", mCert->nickname)); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("Getting slots for \"%s\"\n", mCert->nickname)); slots = PK11_GetAllSlotsForCert(mCert.get(), nullptr); if (!slots) { if (PORT_GetError() == SEC_ERROR_NO_TOKEN) @@ -1148,7 +1148,7 @@ nsNSSCertificate::ExportAsCMS(uint32_t chainMode, ScopedNSSCMSMessage cmsg(NSS_CMSMessage_Create(nullptr)); if (!cmsg) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsNSSCertificate::ExportAsCMS - can't create CMS message\n")); return NS_ERROR_OUT_OF_MEMORY; } @@ -1157,7 +1157,7 @@ nsNSSCertificate::ExportAsCMS(uint32_t chainMode, ScopedNSSCMSSignedData sigd( NSS_CMSSignedData_CreateCertsOnly(cmsg, mCert.get(), false)); if (!sigd) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsNSSCertificate::ExportAsCMS - can't create SignedData\n")); return NS_ERROR_FAILURE; } @@ -1183,7 +1183,7 @@ nsNSSCertificate::ExportAsCMS(uint32_t chainMode, certChain.forget(); } else { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsNSSCertificate::ExportAsCMS - can't add chain\n")); return NS_ERROR_FAILURE; } @@ -1195,7 +1195,7 @@ nsNSSCertificate::ExportAsCMS(uint32_t chainMode, issuerCert.forget(); } else { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsNSSCertificate::ExportAsCMS - can't add issuer cert\n")); return NS_ERROR_FAILURE; } @@ -1209,14 +1209,14 @@ nsNSSCertificate::ExportAsCMS(uint32_t chainMode, sigd.forget(); } else { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsNSSCertificate::ExportAsCMS - can't attach SignedData\n")); return NS_ERROR_FAILURE; } ScopedPLArenaPool arena(PORT_NewArena(1024)); if (!arena) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsNSSCertificate::ExportAsCMS - out of memory\n")); return NS_ERROR_OUT_OF_MEMORY; } @@ -1227,13 +1227,13 @@ nsNSSCertificate::ExportAsCMS(uint32_t chainMode, nullptr, nullptr, nullptr, nullptr, nullptr); if (!ecx) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsNSSCertificate::ExportAsCMS - can't create encoder context\n")); return NS_ERROR_FAILURE; } if (NSS_CMSEncoder_Finish(ecx) != SECSuccess) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsNSSCertificate::ExportAsCMS - failed to add encoded data\n")); return NS_ERROR_FAILURE; } diff --git a/security/manager/ssl/nsNSSCertificateDB.cpp b/security/manager/ssl/nsNSSCertificateDB.cpp index c9505e39b3ac..710805804c42 100644 --- a/security/manager/ssl/nsNSSCertificateDB.cpp +++ b/security/manager/ssl/nsNSSCertificateDB.cpp @@ -106,13 +106,13 @@ nsNSSCertificateDB::FindCertByNickname(nsISupports *aToken, char *asciiname = nullptr; NS_ConvertUTF16toUTF8 aUtf8Nickname(nickname); asciiname = const_cast(aUtf8Nickname.get()); - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("Getting \"%s\"\n", asciiname)); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("Getting \"%s\"\n", asciiname)); cert = PK11_FindCertFromNickname(asciiname, nullptr); if (!cert) { cert = CERT_FindCertByNickname(CERT_GetDefaultCertDB(), asciiname); } if (cert) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("got it\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("got it\n")); nsCOMPtr pCert = nsNSSCertificate::Create(cert.get()); if (pCert) { pCert.forget(_rvCert); @@ -345,7 +345,7 @@ nsNSSCertificateDB::handleCACertDownload(nsIArray *x509Certs, if (NS_FAILED(rv)) return rv; - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("Creating temp cert\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("Creating temp cert\n")); CERTCertDBHandle *certdb = CERT_GetDefaultCertDB(); ScopedCERTCertificate tmpCert(CERT_FindCertByDERCert(certdb, &der)); if (!tmpCert) { @@ -380,11 +380,11 @@ nsNSSCertificateDB::handleCACertDownload(nsIArray *x509Certs, if (!allows) return NS_ERROR_NOT_AVAILABLE; - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("trust is %d\n", trustBits)); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("trust is %d\n", trustBits)); nsXPIDLCString nickname; nickname.Adopt(CERT_MakeCANickname(tmpCert.get())); - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("Created nick \"%s\"\n", nickname.get())); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("Created nick \"%s\"\n", nickname.get())); nsNSSCertTrust trust; trust.SetValidCA(); @@ -967,7 +967,7 @@ nsNSSCertificateDB::DeleteCertificate(nsIX509Cert *aCert) srv = CERT_ChangeCertTrust(CERT_GetDefaultCertDB(), cert.get(), trust.GetTrust()); } - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("cert deleted: %d", srv)); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("cert deleted: %d", srv)); return (srv) ? NS_ERROR_FAILURE : NS_OK; } @@ -1222,7 +1222,7 @@ nsNSSCertificateDB::getCertNames(CERTCertList *certList, uint32_t numcerts = 0, i=0; char16_t **tmpArray = nullptr; - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("List of certs %d:\n", type)); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("List of certs %d:\n", type)); for (node = CERT_LIST_HEAD(certList); !CERT_LIST_END(node, certList); node = CERT_LIST_NEXT(node)) { @@ -1230,7 +1230,7 @@ nsNSSCertificateDB::getCertNames(CERTCertList *certList, numcerts++; } } - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("num certs: %d\n", numcerts)); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("num certs: %d\n", numcerts)); int nc = (numcerts == 0) ? 1 : numcerts; tmpArray = (char16_t **)moz_xmalloc(sizeof(char16_t *) * nc); if (numcerts == 0) goto finish; @@ -1613,7 +1613,7 @@ NS_IMETHODIMP nsNSSCertificateDB::AddCertFromBase64(const char* aBase64, rv = newCert->GetRawDER(&der.len, (uint8_t **)&der.data); NS_ENSURE_SUCCESS(rv, rv); - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("Creating temp cert\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("Creating temp cert\n")); CERTCertDBHandle *certdb = CERT_GetDefaultCertDB(); ScopedCERTCertificate tmpCert(CERT_FindCertByDERCert(certdb, &der)); if (!tmpCert) @@ -1637,7 +1637,7 @@ NS_IMETHODIMP nsNSSCertificateDB::AddCertFromBase64(const char* aBase64, nsXPIDLCString nickname; nickname.Adopt(CERT_MakeCANickname(tmpCert.get())); - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("Created nick \"%s\"\n", nickname.get())); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("Created nick \"%s\"\n", nickname.get())); rv = attemptToLogInWithDefaultPassword(); if (NS_WARN_IF(rv != NS_OK)) { diff --git a/security/manager/ssl/nsNSSComponent.cpp b/security/manager/ssl/nsNSSComponent.cpp index e0a6d0d1294c..25350cbbbfe9 100644 --- a/security/manager/ssl/nsNSSComponent.cpp +++ b/security/manager/ssl/nsNSSComponent.cpp @@ -227,7 +227,7 @@ nsNSSComponent::nsNSSComponent() { if (!gPIPNSSLog) gPIPNSSLog = PR_NewLogModule("pipnss"); - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsNSSComponent::ctor\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsNSSComponent::ctor\n")); mObserversRegistered = false; NS_ASSERTION( (0 == mInstanceCount), "nsNSSComponent is a singleton, but instantiated multiple times!"); @@ -265,7 +265,7 @@ nsNSSComponent::createBackgroundThreads() nsNSSComponent::~nsNSSComponent() { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsNSSComponent::dtor\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsNSSComponent::dtor\n")); deleteBackgroundThreads(); @@ -281,7 +281,7 @@ nsNSSComponent::~nsNSSComponent() // potential nss initialization later. EnsureNSSInitialized(nssShutdown); - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsNSSComponent::dtor finished\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsNSSComponent::dtor finished\n")); } NS_IMETHODIMP @@ -371,7 +371,7 @@ nsNSSComponent::LaunchSmartCardThreads() SECMODModuleList* list; SECMODListLock* lock = SECMOD_GetDefaultModuleListLock(); if (!lock) { - MOZ_LOG(gPIPNSSLog, LogLevel::Error, + MOZ_LOG(gPIPNSSLog, PR_LOG_ERROR, ("Couldn't get the module list lock, can't launch smart card threads\n")); return; } @@ -439,7 +439,7 @@ nsNSSComponent::LoadLoadableRoots() SECMODModuleList* list; SECMODListLock* lock = SECMOD_GetDefaultModuleListLock(); if (!lock) { - MOZ_LOG(gPIPNSSLog, LogLevel::Error, + MOZ_LOG(gPIPNSSLog, PR_LOG_ERROR, ("Couldn't get the module list lock, can't install loadable roots\n")); return; } @@ -930,7 +930,7 @@ GetNSSProfilePath(nsAutoCString& aProfilePath) aProfilePath.Truncate(); const char* dbDirOverride = getenv("MOZPSM_NSSDBDIR_OVERRIDE"); if (dbDirOverride && strlen(dbDirOverride) > 0) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("Using specified MOZPSM_NSSDBDIR_OVERRIDE as NSS DB dir: %s\n", dbDirOverride)); aProfilePath.Assign(dbDirOverride); @@ -941,7 +941,7 @@ GetNSSProfilePath(nsAutoCString& aProfilePath) nsresult rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(profileFile)); if (NS_FAILED(rv)) { - MOZ_LOG(gPIPNSSLog, LogLevel::Error, + MOZ_LOG(gPIPNSSLog, PR_LOG_ERROR, ("Unable to get profile directory - continuing with no NSS DB\n")); return NS_OK; } @@ -951,7 +951,7 @@ GetNSSProfilePath(nsAutoCString& aProfilePath) // codepage, using short (canonical) path as workaround. nsCOMPtr profileFileWin(do_QueryInterface(profileFile)); if (!profileFileWin) { - MOZ_LOG(gPIPNSSLog, LogLevel::Error, + MOZ_LOG(gPIPNSSLog, PR_LOG_ERROR, ("Could not get nsILocalFileWin for profile directory.\n")); return NS_ERROR_FAILURE; } @@ -960,7 +960,7 @@ GetNSSProfilePath(nsAutoCString& aProfilePath) rv = profileFile->GetNativePath(aProfilePath); #endif if (NS_FAILED(rv)) { - MOZ_LOG(gPIPNSSLog, LogLevel::Error, + MOZ_LOG(gPIPNSSLog, PR_LOG_ERROR, ("Could not get native path for profile directory.\n")); return rv; } @@ -974,7 +974,7 @@ nsNSSComponent::InitializeNSS() // Can be called both during init and profile change. // Needs mutex protection. - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsNSSComponent::InitializeNSS\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsNSSComponent::InitializeNSS\n")); static_assert(nsINSSErrorsService::NSS_SEC_ERROR_BASE == SEC_ERROR_BASE && nsINSSErrorsService::NSS_SEC_ERROR_LIMIT == SEC_ERROR_LIMIT && @@ -991,7 +991,7 @@ nsNSSComponent::InitializeNSS() return NS_ERROR_FAILURE; } - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("NSS Initialization beginning\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("NSS Initialization beginning\n")); // The call to ConfigureInternalPKCS11Token needs to be done before NSS is initialized, // but affects only static data. @@ -1014,11 +1014,11 @@ nsNSSComponent::InitializeNSS() SECStatus init_rv = ::mozilla::psm::InitializeNSS(profileStr.get(), false); // If that fails, attempt read-only mode. if (init_rv != SECSuccess) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("could not init NSS r/w in %s\n", profileStr.get())); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("could not init NSS r/w in %s\n", profileStr.get())); init_rv = ::mozilla::psm::InitializeNSS(profileStr.get(), true); } if (init_rv != SECSuccess) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("could not init in r/o either\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("could not init in r/o either\n")); } } // If we haven't succeeded in initializing the DB in our profile @@ -1028,7 +1028,7 @@ nsNSSComponent::InitializeNSS() init_rv = NSS_NoDB_Init(nullptr); } if (init_rv != SECSuccess) { - MOZ_LOG(gPIPNSSLog, LogLevel::Error, ("could not initialize NSS - panicking\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_ERROR, ("could not initialize NSS - panicking\n")); nsPSMInitPanic::SetPanic(); return NS_ERROR_NOT_AVAILABLE; } @@ -1081,7 +1081,7 @@ nsNSSComponent::InitializeNSS() ALPN_ENABLED_DEFAULT)); if (NS_FAILED(InitializeCipherSuite())) { - MOZ_LOG(gPIPNSSLog, LogLevel::Error, ("Unable to initialize cipher suite settings\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_ERROR, ("Unable to initialize cipher suite settings\n")); return NS_ERROR_FAILURE; } @@ -1106,12 +1106,12 @@ nsNSSComponent::InitializeNSS() nsCOMPtr sssService = do_GetService(NS_SSSERVICE_CONTRACTID); if (!sssService) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("Cannot initialize site security service\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("Cannot initialize site security service\n")); return NS_ERROR_FAILURE; } - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("NSS Initialization done\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("NSS Initialization done\n")); return NS_OK; } @@ -1121,7 +1121,7 @@ nsNSSComponent::ShutdownNSS() // Can be called both during init and profile change, // needs mutex protection. - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsNSSComponent::ShutdownNSS\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsNSSComponent::ShutdownNSS\n")); MutexAutoLock lock(mutex); @@ -1132,7 +1132,7 @@ nsNSSComponent::ShutdownNSS() Preferences::RemoveObserver(this, "security."); if (NS_FAILED(CipherSuiteChangeObserver::StopObserve())) { - MOZ_LOG(gPIPNSSLog, LogLevel::Error, ("nsNSSComponent::ShutdownNSS cannot stop observing cipher suite change\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_ERROR, ("nsNSSComponent::ShutdownNSS cannot stop observing cipher suite change\n")); } #ifndef MOZ_NO_SMART_CARDS @@ -1143,14 +1143,14 @@ nsNSSComponent::ShutdownNSS() #ifndef MOZ_NO_EV_CERTS CleanupIdentityInfo(); #endif - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("evaporating psm resources\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("evaporating psm resources\n")); mShutdownObjectList->evaporateAllNSSResources(); EnsureNSSInitialized(nssShutdown); if (SECSuccess != ::NSS_Shutdown()) { - MOZ_LOG(gPIPNSSLog, LogLevel::Error, ("NSS SHUTDOWN FAILURE\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_ALWAYS, ("NSS SHUTDOWN FAILURE\n")); } else { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("NSS shutdown =====>> OK <<=====\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("NSS shutdown =====>> OK <<=====\n")); } } } @@ -1163,17 +1163,17 @@ nsNSSComponent::Init() nsresult rv = NS_OK; - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("Beginning NSS initialization\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("Beginning NSS initialization\n")); if (!mShutdownObjectList) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("NSS init, out of memory in constructor\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("NSS init, out of memory in constructor\n")); return NS_ERROR_OUT_OF_MEMORY; } rv = InitializePIPNSSBundle(); if (NS_FAILED(rv)) { - MOZ_LOG(gPIPNSSLog, LogLevel::Error, ("Unable to create pipnss bundle.\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_ERROR, ("Unable to create pipnss bundle.\n")); return rv; } @@ -1195,7 +1195,7 @@ nsNSSComponent::Init() rv = InitializeNSS(); if (NS_FAILED(rv)) { - MOZ_LOG(gPIPNSSLog, LogLevel::Error, ("Unable to Initialize NSS.\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_ERROR, ("Unable to Initialize NSS.\n")); DeregisterObservers(); mPIPNSSBundle = nullptr; @@ -1207,7 +1207,7 @@ nsNSSComponent::Init() createBackgroundThreads(); if (!mCertVerificationThread) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("NSS init, could not create threads\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("NSS init, could not create threads\n")); DeregisterObservers(); mPIPNSSBundle = nullptr; @@ -1270,11 +1270,11 @@ nsNSSComponent::Observe(nsISupports* aSubject, const char* aTopic, const char16_t* someData) { if (nsCRT::strcmp(aTopic, PROFILE_CHANGE_TEARDOWN_TOPIC) == 0) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("in PSM code, receiving change-teardown\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("in PSM code, receiving change-teardown\n")); DoProfileChangeTeardown(aSubject); } else if (nsCRT::strcmp(aTopic, PROFILE_BEFORE_CHANGE_TOPIC) == 0) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("receiving profile change topic\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("receiving profile change topic\n")); DoProfileBeforeChange(aSubject); } else if (nsCRT::strcmp(aTopic, PROFILE_DO_CHANGE_TOPIC) == 0) { @@ -1306,13 +1306,13 @@ nsNSSComponent::Observe(nsISupports* aSubject, const char* aTopic, if (needsInit) { if (NS_FAILED(InitializeNSS())) { - MOZ_LOG(gPIPNSSLog, LogLevel::Error, ("Unable to Initialize NSS after profile switch.\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_ERROR, ("Unable to Initialize NSS after profile switch.\n")); } } } else if (nsCRT::strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsNSSComponent: XPCom shutdown observed\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsNSSComponent: XPCom shutdown observed\n")); // Cleanup code that requires services, it's too late in destructor. @@ -1369,11 +1369,11 @@ nsNSSComponent::Observe(nsISupports* aSubject, const char* aTopic, SSL_ClearSessionCache(); } else if (nsCRT::strcmp(aTopic, PROFILE_CHANGE_NET_TEARDOWN_TOPIC) == 0) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("receiving network teardown topic\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("receiving network teardown topic\n")); DoProfileChangeNetTeardown(); } else if (nsCRT::strcmp(aTopic, PROFILE_CHANGE_NET_RESTORE_TOPIC) == 0) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("receiving network restore topic\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("receiving network restore topic\n")); DoProfileChangeNetRestore(); } @@ -1457,7 +1457,7 @@ nsNSSComponent::RegisterObservers() NS_ASSERTION(observerService, "could not get observer service"); if (observerService) { mObserversRegistered = true; - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsNSSComponent: adding observers\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsNSSComponent: adding observers\n")); // We are a service. // Once we are loaded, don't allow being removed from memory. @@ -1487,7 +1487,7 @@ nsNSSComponent::DeregisterObservers() NS_ASSERTION(observerService, "could not get observer service"); if (observerService) { mObserversRegistered = false; - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsNSSComponent: removing observers\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsNSSComponent: removing observers\n")); observerService->RemoveObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID); diff --git a/security/manager/ssl/nsNSSIOLayer.cpp b/security/manager/ssl/nsNSSIOLayer.cpp index 0490a8c10026..69c0c10bfd21 100644 --- a/security/manager/ssl/nsNSSIOLayer.cpp +++ b/security/manager/ssl/nsNSSIOLayer.cpp @@ -244,7 +244,7 @@ nsNSSSocketInfo::NoteTimeUntilReady() // This will include TCP and proxy tunnel wait time Telemetry::AccumulateTimeDelta(Telemetry::SSL_TIME_UNTIL_READY, mSocketCreationTimestamp, TimeStamp::Now()); - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p] nsNSSSocketInfo::NoteTimeUntilReady\n", mFd)); } @@ -288,7 +288,7 @@ nsNSSSocketInfo::SetHandshakeCompleted() mHandshakeCompleted = true; - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p] nsNSSSocketInfo::SetHandshakeCompleted\n", (void*) mFd)); mIsFullHandshake = false; // reset for next handshake on this connection @@ -652,7 +652,7 @@ static PRStatus nsSSLIOLayerConnect(PRFileDesc* fd, const PRNetAddr* addr, PRIntervalTime timeout) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("[%p] connecting SSL socket\n", + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p] connecting SSL socket\n", (void*) fd)); nsNSSShutDownPreventionLock locker; if (!getSocketInfoIfRunning(fd, not_reading_or_writing, locker)) @@ -660,12 +660,12 @@ nsSSLIOLayerConnect(PRFileDesc* fd, const PRNetAddr* addr, PRStatus status = fd->lower->methods->connect(fd->lower, addr, timeout); if (status != PR_SUCCESS) { - MOZ_LOG(gPIPNSSLog, LogLevel::Error, ("[%p] Lower layer connect error: %d\n", + MOZ_LOG(gPIPNSSLog, PR_LOG_ERROR, ("[%p] Lower layer connect error: %d\n", (void*) fd, PR_GetError())); return status; } - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("[%p] Connect\n", (void*) fd)); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p] Connect\n", (void*) fd)); return status; } @@ -916,7 +916,7 @@ nsSSLIOLayerClose(PRFileDesc* fd) if (!fd) return PR_FAILURE; - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("[%p] Shutting down socket\n", + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p] Shutting down socket\n", (void*) fd)); nsNSSSocketInfo* socketInfo = (nsNSSSocketInfo*) fd->secret; @@ -990,7 +990,7 @@ nsDumpBuffer(unsigned char* buf, int len) ch = buf[i]; if (l == DUMPBUF_LINESIZE) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("%s%s\n", hexbuf, chrbuf)); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("%s%s\n", hexbuf, chrbuf)); (void) memset(hexbuf, 0x20, DUMPBUF_LINESIZE*3); (void) memset(chrbuf, 0x20, DUMPBUF_LINESIZE); h = hexbuf; @@ -1011,7 +1011,7 @@ nsDumpBuffer(unsigned char* buf, int len) } i++; l++; } - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("%s%s\n", hexbuf, chrbuf)); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("%s%s\n", hexbuf, chrbuf)); } #define DEBUG_DUMP_BUFFER(buf,len) nsDumpBuffer(buf,len) @@ -1235,7 +1235,7 @@ checkHandshake(int32_t bytesTransfered, bool wasReading, } if (wantRetry) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p] checkHandshake: will retry with lower max TLS version\n", ssl_layer_fd)); // We want to cause the network layer to retry the connection. @@ -1286,7 +1286,7 @@ nsSSLIOLayerPoll(PRFileDesc* fd, int16_t in_flags, int16_t* out_flags) if (!socketInfo) { // If we get here, it is probably because certificate validation failed // and this is the first I/O operation after the failure. - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p] polling SSL socket right after certificate verification failed " "or NSS shutdown or SDR logout %d\n", fd, (int) in_flags)); @@ -1300,7 +1300,7 @@ nsSSLIOLayerPoll(PRFileDesc* fd, int16_t in_flags, int16_t* out_flags) return in_flags; } - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, (socketInfo->IsWaitingForCertVerification() ? "[%p] polling SSL socket during certificate verification using lower %d\n" : "[%p] poll SSL socket using lower %d\n", @@ -1311,7 +1311,7 @@ nsSSLIOLayerPoll(PRFileDesc* fd, int16_t in_flags, int16_t* out_flags) // it reaches any point that would be unsafe to send/receive something before // cert validation is complete. int16_t result = fd->lower->methods->poll(fd->lower, in_flags, out_flags); - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("[%p] poll SSL socket returned %d\n", + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p] poll SSL socket returned %d\n", (void*) fd, (int) result)); return result; } @@ -1417,7 +1417,7 @@ PSMRecv(PRFileDesc* fd, void* buf, int32_t amount, int flags, int32_t bytesRead = fd->lower->methods->recv(fd->lower, buf, amount, flags, timeout); - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("[%p] read %d bytes\n", (void*) fd, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p] read %d bytes\n", (void*) fd, bytesRead)); #ifdef DEBUG_SSL_VERBOSE @@ -1448,7 +1448,7 @@ PSMSend(PRFileDesc* fd, const void* buf, int32_t amount, int flags, int32_t bytesWritten = fd->lower->methods->send(fd->lower, buf, amount, flags, timeout); - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("[%p] wrote %d bytes\n", + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p] wrote %d bytes\n", fd, bytesWritten)); return checkHandshake(bytesWritten, false, fd, socketInfo); @@ -2038,7 +2038,7 @@ nsNSS_SSLGetClientAuthData(void* arg, PRFileDesc* socket, // joined on this connection, because we only show the user one hostname // (mHostName) in the client certificate UI. - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p] Not returning client cert due to previous join\n", socket)); *pRetCert = nullptr; *pRetKey = nullptr; @@ -2471,7 +2471,7 @@ nsSSLIOLayerImportFD(PRFileDesc* fd, infoObject); } if (flags & nsISocketProvider::MITM_OK) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p] nsSSLIOLayerImportFD: bypass authentication flag\n", fd)); infoObject->SetBypassAuthentication(true); } @@ -2520,7 +2520,7 @@ nsSSLIOLayerSetOptions(PRFileDesc* fd, bool forSTARTTLS, infoObject->SharedState().IOLayerHelpers() .adjustForTLSIntolerance(infoObject->GetHostName(), infoObject->GetPort(), range, strongCiphersStatus); - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p] nsSSLIOLayerSetOptions: using TLS version range (0x%04x,0x%04x)%s\n", fd, static_cast(range.min), static_cast(range.max), @@ -2538,7 +2538,7 @@ nsSSLIOLayerSetOptions(PRFileDesc* fd, bool forSTARTTLS, // when adjustForTLSIntolerance tweaks the maximum version downward, // we tell the server using this SCSV so they can detect a downgrade attack if (range.max < maxEnabledVersion) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p] nsSSLIOLayerSetOptions: enabling TLS_FALLBACK_SCSV\n", fd)); if (SECSuccess != SSL_OptionSet(fd, SSL_ENABLE_FALLBACK_SCSV, true)) { return NS_ERROR_FAILURE; @@ -2646,7 +2646,7 @@ nsSSLIOLayerAddToSocket(int32_t family, nsNSSShutDownList::trackSSLSocketCreate(); - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("[%p] Socket set up\n", (void*) sslSock)); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("[%p] Socket set up\n", (void*) sslSock)); infoObject->QueryInterface(NS_GET_IID(nsISupports), (void**) (info)); // We are going use a clear connection first // diff --git a/security/manager/ssl/nsNSSShutDown.cpp b/security/manager/ssl/nsNSSShutDown.cpp index 7a21a5cde07d..99c002902e9d 100644 --- a/security/manager/ssl/nsNSSShutDown.cpp +++ b/security/manager/ssl/nsNSSShutDown.cpp @@ -126,7 +126,7 @@ bool nsNSSShutDownList::areSSLSocketsActive() nsresult nsNSSShutDownList::doPK11Logout() { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("canceling all open SSL sockets to disallow future IO\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("canceling all open SSL sockets to disallow future IO\n")); // During our iteration we will set a bunch of PRBools to true. // Nobody else ever modifies that bool, only we do. // We only must ensure that our objects do not go away. @@ -175,11 +175,11 @@ void nsNSSShutDownList::allowUI() nsresult nsNSSShutDownList::evaporateAllNSSResources() { if (PR_SUCCESS != mActivityState.restrictActivityToCurrentThread()) { - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("failed to restrict activity to current thread\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("failed to restrict activity to current thread\n")); return NS_ERROR_FAILURE; } - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("now evaporating NSS resources\n")); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("now evaporating NSS resources\n")); int removedCount; do { MutexAutoLock lock(mListLock); diff --git a/security/manager/ssl/nsNTLMAuthModule.cpp b/security/manager/ssl/nsNTLMAuthModule.cpp index a975f2ccaffe..c4018375455b 100644 --- a/security/manager/ssl/nsNTLMAuthModule.cpp +++ b/security/manager/ssl/nsNTLMAuthModule.cpp @@ -38,8 +38,8 @@ GetNTLMLog() return sNTLMLog; } -#define LOG(x) MOZ_LOG(GetNTLMLog(), mozilla::LogLevel::Debug, x) -#define LOG_ENABLED() MOZ_LOG_TEST(GetNTLMLog(), mozilla::LogLevel::Debug) +#define LOG(x) MOZ_LOG(GetNTLMLog(), PR_LOG_DEBUG, x) +#define LOG_ENABLED() PR_LOG_TEST(GetNTLMLog(), PR_LOG_DEBUG) static void des_makekey(const uint8_t *raw, uint8_t *key); static void des_encrypt(const uint8_t *key, const uint8_t *src, uint8_t *hash); diff --git a/security/manager/ssl/nsPKCS11Slot.cpp b/security/manager/ssl/nsPKCS11Slot.cpp index c2aac0ecb0bb..9cb59e75404f 100644 --- a/security/manager/ssl/nsPKCS11Slot.cpp +++ b/security/manager/ssl/nsPKCS11Slot.cpp @@ -13,10 +13,6 @@ #include "secmod.h" -#include "mozilla/Logging.h" - -using mozilla::LogLevel; - extern PRLogModuleInfo* gPIPNSSLog; NS_IMPL_ISUPPORTS(nsPKCS11Slot, nsIPKCS11Slot) @@ -298,7 +294,7 @@ nsPKCS11Module::FindSlotByName(const char16_t *aName, return NS_ERROR_NOT_AVAILABLE; char *asciiname = ToNewUTF8String(nsDependentString(aName)); - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("Getting \"%s\"\n", asciiname)); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("Getting \"%s\"\n", asciiname)); PK11SlotInfo *slotinfo = nullptr; PK11SlotList *slotList = PK11_FindSlotsByNames(mModule->dllName, asciiname /* slotName */, nullptr /* token Name */, false); diff --git a/security/manager/ssl/nsPKCS12Blob.cpp b/security/manager/ssl/nsPKCS12Blob.cpp index 4433c878da51..77336fc05e69 100644 --- a/security/manager/ssl/nsPKCS12Blob.cpp +++ b/security/manager/ssl/nsPKCS12Blob.cpp @@ -726,8 +726,8 @@ nsPKCS12Blob::handleError(int myerr) } int prerr = PORT_GetError(); - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("PKCS12: NSS/NSPR error(%d)", prerr)); - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("PKCS12: I called(%d)", myerr)); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("PKCS12: NSS/NSPR error(%d)", prerr)); + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("PKCS12: I called(%d)", myerr)); const char * msgID = nullptr; diff --git a/security/manager/ssl/nsSecureBrowserUIImpl.cpp b/security/manager/ssl/nsSecureBrowserUIImpl.cpp index b84abadd87ef..441d98e5bbca 100644 --- a/security/manager/ssl/nsSecureBrowserUIImpl.cpp +++ b/security/manager/ssl/nsSecureBrowserUIImpl.cpp @@ -44,7 +44,7 @@ using namespace mozilla; // set NSPR_LOG_MODULES=nsSecureBrowserUI:5 // set NSPR_LOG_FILE=nspr.log // -// this enables LogLevel::Debug level information and places all output in +// this enables PR_LOG_DEBUG level information and places all output in // the file nspr.log // PRLogModuleInfo* gSecureDocLog = nullptr; @@ -128,10 +128,10 @@ NS_IMPL_ISUPPORTS(nsSecureBrowserUIImpl, NS_IMETHODIMP nsSecureBrowserUIImpl::Init(nsIDOMWindow *aWindow) { - if (MOZ_LOG_TEST(gSecureDocLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gSecureDocLog, PR_LOG_DEBUG)) { nsCOMPtr window(do_QueryReferent(mWindow)); - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: Init: mWindow: %p, aWindow: %p\n", this, window.get(), aWindow)); } @@ -310,16 +310,16 @@ static uint32_t GetSecurityStateFromSecurityInfoAndRequest(nsISupports* info, nsCOMPtr psmInfo(do_QueryInterface(info)); if (!psmInfo) { - MOZ_LOG(gSecureDocLog, LogLevel::Debug, ("SecureUI: GetSecurityState: - no nsITransportSecurityInfo for %p\n", + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI: GetSecurityState: - no nsITransportSecurityInfo for %p\n", (nsISupports *)info)); return nsIWebProgressListener::STATE_IS_INSECURE; } - MOZ_LOG(gSecureDocLog, LogLevel::Debug, ("SecureUI: GetSecurityState: - info is %p\n", + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI: GetSecurityState: - info is %p\n", (nsISupports *)info)); res = psmInfo->GetSecurityState(&securityState); if (NS_FAILED(res)) { - MOZ_LOG(gSecureDocLog, LogLevel::Debug, ("SecureUI: GetSecurityState: - GetSecurityState failed: %d\n", + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI: GetSecurityState: - GetSecurityState failed: %d\n", res)); securityState = nsIWebProgressListener::STATE_IS_BROKEN; } @@ -342,14 +342,14 @@ static uint32_t GetSecurityStateFromSecurityInfoAndRequest(nsISupports* info, bool isHttp, isFtp; if ((NS_SUCCEEDED(uri->SchemeIs("http", &isHttp)) && isHttp) || (NS_SUCCEEDED(uri->SchemeIs("ftp", &isFtp)) && isFtp)) { - MOZ_LOG(gSecureDocLog, LogLevel::Debug, ("SecureUI: GetSecurityState: - " + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI: GetSecurityState: - " "channel scheme is insecure.\n")); securityState = nsIWebProgressListener::STATE_IS_INSECURE; } } } - MOZ_LOG(gSecureDocLog, LogLevel::Debug, ("SecureUI: GetSecurityState: - Returning %d\n", + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI: GetSecurityState: - Returning %d\n", securityState)); return securityState; } @@ -395,7 +395,7 @@ nsSecureBrowserUIImpl::EvaluateAndUpdateSecurityState(nsIRequest* aRequest, temp_NewToplevelSecurityState = GetSecurityStateFromSecurityInfoAndRequest(info, aRequest); - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: OnStateChange: remember mNewToplevelSecurityState => %x\n", this, temp_NewToplevelSecurityState)); @@ -423,7 +423,7 @@ nsSecureBrowserUIImpl::EvaluateAndUpdateSecurityState(nsIRequest* aRequest, if (updateStatus) { mSSLStatus = temp_SSLStatus; } - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: remember securityInfo %p\n", this, info)); nsCOMPtr associatedContentSecurityFromRequest = @@ -457,11 +457,11 @@ nsSecureBrowserUIImpl::UpdateSubrequestMembers(nsISupports* securityInfo, if (reqState & STATE_IS_SECURE) { // do nothing } else if (reqState & STATE_IS_BROKEN) { - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: OnStateChange: subreq BROKEN\n", this)); ++mSubRequestsBrokenSecurity; } else { - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: OnStateChange: subreq INSECURE\n", this)); ++mSubRequestsNoSecurity; } @@ -608,22 +608,22 @@ nsSecureBrowserUIImpl::OnStateChange(nsIWebProgress* aWebProgress, { if (isToplevelProgress) { - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: OnStateChange: progress: for toplevel\n", this)); } else { - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: OnStateChange: progress: for something else\n", this)); } } else { - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: OnStateChange: progress: no window known\n", this)); } - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: OnStateChange\n", this)); if (isViewSource) @@ -631,15 +631,15 @@ nsSecureBrowserUIImpl::OnStateChange(nsIWebProgress* aWebProgress, if (!aRequest) { - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: OnStateChange with null request\n", this)); return NS_ERROR_NULL_POINTER; } - if (MOZ_LOG_TEST(gSecureDocLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gSecureDocLog, PR_LOG_DEBUG)) { nsXPIDLCString reqname; aRequest->GetName(reqname); - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: %p %p OnStateChange %x %s\n", this, aWebProgress, aRequest, aProgressStateFlags, reqname.get())); } @@ -679,7 +679,7 @@ nsSecureBrowserUIImpl::OnStateChange(nsIWebProgress* aWebProgress, && loadFlags & nsIChannel::LOAD_DOCUMENT_URI) { - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: OnStateChange: SOMETHING STARTS FOR TOPMOST DOCUMENT\n", this)); } @@ -691,7 +691,7 @@ nsSecureBrowserUIImpl::OnStateChange(nsIWebProgress* aWebProgress, && loadFlags & nsIChannel::LOAD_DOCUMENT_URI) { - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: OnStateChange: SOMETHING STOPS FOR TOPMOST DOCUMENT\n", this)); } @@ -707,7 +707,7 @@ nsSecureBrowserUIImpl::OnStateChange(nsIWebProgress* aWebProgress, if (!wyciwygRequest) { nsCOMPtr ftpRequest(do_QueryInterface(aRequest)); if (!ftpRequest) { - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: OnStateChange: not relevant for sub content\n", this)); isSubDocumentRelevant = false; } @@ -829,7 +829,7 @@ nsSecureBrowserUIImpl::OnStateChange(nsIWebProgress* aWebProgress, info.AppendLiteral("f contains unknown flag!"); } - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: OnStateChange: %s %s -- %s\n", this, _status, info.get(), info2.get())); @@ -837,7 +837,7 @@ nsSecureBrowserUIImpl::OnStateChange(nsIWebProgress* aWebProgress, && channel) { - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: OnStateChange: seeing STOP with security state: %d\n", this, GetSecurityStateFromSecurityInfoAndRequest(securityInfo, aRequest) )); @@ -928,13 +928,13 @@ nsSecureBrowserUIImpl::OnStateChange(nsIWebProgress* aWebProgress, if (allowSecurityStateChange && !inProgress) { - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: OnStateChange: start for toplevel document\n", this )); if (prevContentSecurity) { - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: OnStateChange: start, saving current sub state\n", this )); @@ -943,7 +943,7 @@ nsSecureBrowserUIImpl::OnStateChange(nsIWebProgress* aWebProgress, prevContentSecurity->SetCountSubRequestsBrokenSecurity(saveSubBroken); prevContentSecurity->SetCountSubRequestsNoSecurity(saveSubNo); prevContentSecurity->Flush(); - MOZ_LOG(gSecureDocLog, LogLevel::Debug, ("SecureUI:%p: Saving subs in START to %p as %d,%d\n", + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: Saving subs in START to %p as %d,%d\n", this, prevContentSecurity.get(), saveSubBroken, saveSubNo)); } @@ -970,13 +970,13 @@ nsSecureBrowserUIImpl::OnStateChange(nsIWebProgress* aWebProgress, if (newContentSecurity) { - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: OnStateChange: start, loading old sub state\n", this )); newContentSecurity->GetCountSubRequestsBrokenSecurity(&newSubBroken); newContentSecurity->GetCountSubRequestsNoSecurity(&newSubNo); - MOZ_LOG(gSecureDocLog, LogLevel::Debug, ("SecureUI:%p: Restoring subs in START from %p to %d,%d\n", + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: Restoring subs in START from %p to %d,%d\n", this, newContentSecurity.get(), newSubBroken, newSubNo)); } } @@ -1005,7 +1005,7 @@ nsSecureBrowserUIImpl::OnStateChange(nsIWebProgress* aWebProgress, // By using a counter, this code also works when the toplevel // document get's redirected, but the STOP request for the // previous toplevel document has not yet have been received. - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: OnStateChange: ++mDocumentRequestsInProgress\n", this )); ++mDocumentRequestsInProgress; @@ -1041,7 +1041,7 @@ nsSecureBrowserUIImpl::OnStateChange(nsIWebProgress* aWebProgress, return NS_OK; } - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: OnStateChange: --mDocumentRequestsInProgress\n", this )); @@ -1111,7 +1111,7 @@ nsSecureBrowserUIImpl::OnStateChange(nsIWebProgress* aWebProgress, { currentContentSecurity->GetCountSubRequestsBrokenSecurity(&subBroken); currentContentSecurity->GetCountSubRequestsNoSecurity(&subNo); - MOZ_LOG(gSecureDocLog, LogLevel::Debug, ("SecureUI:%p: Restoring subs in STOP from %p to %d,%d\n", + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: Restoring subs in STOP from %p to %d,%d\n", this, currentContentSecurity.get(), subBroken, subNo)); } @@ -1195,7 +1195,7 @@ nsSecureBrowserUIImpl::UpdateSecurityState(nsIRequest* aRequest, newSecurityState = lis_broken_security; } - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: UpdateSecurityState: old-new %d - %d\n", this, mNotifiedSecurityState, newSecurityState)); @@ -1233,13 +1233,13 @@ nsSecureBrowserUIImpl::TellTheWorld(nsIRequest* aRequest) } if (toplevelEventSink) { - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: UpdateSecurityState: calling OnSecurityChange\n", this)); toplevelEventSink->OnSecurityChange(aRequest, state); } else { - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: UpdateSecurityState: NO mToplevelEventSink!\n", this)); @@ -1257,7 +1257,7 @@ nsSecureBrowserUIImpl::OnLocationChange(nsIWebProgress* aWebProgress, NS_ASSERTION(mOnStateLocationChangeReentranceDetection == 1, "unexpected parallel nsIWebProgress OnStateChange and/or OnLocationChange notification"); #endif - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: OnLocationChange\n", this)); bool updateIsViewSource = false; @@ -1272,7 +1272,7 @@ nsSecureBrowserUIImpl::OnLocationChange(nsIWebProgress* aWebProgress, NS_ENSURE_SUCCESS(rv, rv); if (vs) { - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: OnLocationChange: view-source\n", this)); } @@ -1369,7 +1369,7 @@ nsSecureBrowserUIImpl::OnSecurityChange(nsIWebProgress *aWebProgress, if (aURI) { nsAutoCString temp; aURI->GetSpec(temp); - MOZ_LOG(gSecureDocLog, LogLevel::Debug, + MOZ_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI:%p: OnSecurityChange: (%x) %s\n", this, state, temp.get())); } diff --git a/security/manager/ssl/nsSecurityHeaderParser.cpp b/security/manager/ssl/nsSecurityHeaderParser.cpp index 7fc7e16d98a2..b8354ef75763 100644 --- a/security/manager/ssl/nsSecurityHeaderParser.cpp +++ b/security/manager/ssl/nsSecurityHeaderParser.cpp @@ -56,7 +56,7 @@ GetSHParserLog() return sSHParserLog; } -#define SHPARSERLOG(args) MOZ_LOG(GetSHParserLog(), mozilla::LogLevel::Debug, args) +#define SHPARSERLOG(args) MOZ_LOG(GetSHParserLog(), PR_LOG_DEBUG, args) nsSecurityHeaderParser::nsSecurityHeaderParser(const char *aHeader) : mCursor(aHeader) diff --git a/security/manager/ssl/nsSiteSecurityService.cpp b/security/manager/ssl/nsSiteSecurityService.cpp index 309e62bd53fd..c6db1326acc4 100644 --- a/security/manager/ssl/nsSiteSecurityService.cpp +++ b/security/manager/ssl/nsSiteSecurityService.cpp @@ -49,7 +49,7 @@ GetSSSLog() return gSSSLog; } -#define SSSLOG(args) MOZ_LOG(GetSSSLog(), mozilla::LogLevel::Debug, args) +#define SSSLOG(args) MOZ_LOG(GetSSSLog(), 4, args) //////////////////////////////////////////////////////////////////////////////// diff --git a/security/manager/ssl/nsUsageArrayHelper.cpp b/security/manager/ssl/nsUsageArrayHelper.cpp index dc598431b94a..8bbfd904ad09 100644 --- a/security/manager/ssl/nsUsageArrayHelper.cpp +++ b/security/manager/ssl/nsUsageArrayHelper.cpp @@ -129,7 +129,7 @@ nsUsageArrayHelper::check(uint32_t previousCheckResult, result = previousCheckResult; } - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, + MOZ_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("error validating certificate for usage %s: %s (%d) -> %ud \n", typestr.get(), PR_ErrorToName(error), (int) error, (int) result)); diff --git a/storage/VacuumManager.cpp b/storage/VacuumManager.cpp index 590e6ecb20ff..95d22a1c495f 100644 --- a/storage/VacuumManager.cpp +++ b/storage/VacuumManager.cpp @@ -244,14 +244,14 @@ Vacuumer::HandleError(mozIStorageError *aError) NS_WARNING(warnMsg.get()); #endif - if (MOZ_LOG_TEST(gStorageLog, LogLevel::Error)) { + if (PR_LOG_TEST(gStorageLog, PR_LOG_ERROR)) { int32_t result; nsresult rv = aError->GetResult(&result); NS_ENSURE_SUCCESS(rv, rv); nsAutoCString message; rv = aError->GetMessage(message); NS_ENSURE_SUCCESS(rv, rv); - MOZ_LOG(gStorageLog, LogLevel::Error, + MOZ_LOG(gStorageLog, PR_LOG_ERROR, ("Vacuum failed with error: %d '%s'. Database was: '%s'", result, message.get(), mDBFilename.get())); } diff --git a/storage/mozStorageAsyncStatement.cpp b/storage/mozStorageAsyncStatement.cpp index f63ed6a40a49..94948cd55dee 100644 --- a/storage/mozStorageAsyncStatement.cpp +++ b/storage/mozStorageAsyncStatement.cpp @@ -125,7 +125,7 @@ AsyncStatement::initialize(Connection *aDBConnection, mNativeConnection = aNativeConnection; mSQLString = aSQLStatement; - MOZ_LOG(gStorageLog, LogLevel::Debug, ("Inited async statement '%s' (0x%p)", + MOZ_LOG(gStorageLog, PR_LOG_NOTICE, ("Inited async statement '%s' (0x%p)", mSQLString.get())); #ifdef DEBUG @@ -270,15 +270,15 @@ AsyncStatement::getAsyncStatement(sqlite3_stmt **_stmt) int rc = mDBConnection->prepareStatement(mNativeConnection, mSQLString, &mAsyncStatement); if (rc != SQLITE_OK) { - MOZ_LOG(gStorageLog, LogLevel::Error, + MOZ_LOG(gStorageLog, PR_LOG_ERROR, ("Sqlite statement prepare error: %d '%s'", rc, ::sqlite3_errmsg(mNativeConnection))); - MOZ_LOG(gStorageLog, LogLevel::Error, + MOZ_LOG(gStorageLog, PR_LOG_ERROR, ("Statement was: '%s'", mSQLString.get())); *_stmt = nullptr; return rc; } - MOZ_LOG(gStorageLog, LogLevel::Debug, ("Initialized statement '%s' (0x%p)", + MOZ_LOG(gStorageLog, PR_LOG_NOTICE, ("Initialized statement '%s' (0x%p)", mSQLString.get(), mAsyncStatement)); } @@ -332,7 +332,7 @@ AsyncStatement::Finalize() mFinalized = true; - MOZ_LOG(gStorageLog, LogLevel::Debug, ("Finalizing statement '%s'", + MOZ_LOG(gStorageLog, PR_LOG_NOTICE, ("Finalizing statement '%s'", mSQLString.get())); asyncFinalize(); diff --git a/storage/mozStorageConnection.cpp b/storage/mozStorageConnection.cpp index 316fee0ab191..e6b9d7d4caf5 100644 --- a/storage/mozStorageConnection.cpp +++ b/storage/mozStorageConnection.cpp @@ -152,7 +152,7 @@ Module gModules[] = { void tracefunc (void *aClosure, const char *aStmt) { - MOZ_LOG(gStorageLog, LogLevel::Debug, ("sqlite3_trace on %p for '%s'", aClosure, + MOZ_LOG(gStorageLog, PR_LOG_DEBUG, ("sqlite3_trace on %p for '%s'", aClosure, aStmt)); } @@ -694,10 +694,10 @@ Connection::initializeInternal() // SQLite tracing can slow down queries (especially long queries) // significantly. Don't trace unless the user is actively monitoring SQLite. - if (MOZ_LOG_TEST(gStorageLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gStorageLog, PR_LOG_DEBUG)) { ::sqlite3_trace(mDBConn, tracefunc, this); - MOZ_LOG(gStorageLog, LogLevel::Debug, ("Opening connection to '%s' (%p)", + MOZ_LOG(gStorageLog, PR_LOG_NOTICE, ("Opening connection to '%s' (%p)", mTelemetryFilename.get(), this)); } @@ -923,11 +923,11 @@ Connection::internalClose(sqlite3 *aNativeConnection) } #endif // DEBUG - if (MOZ_LOG_TEST(gStorageLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gStorageLog, PR_LOG_NOTICE)) { nsAutoCString leafName(":memory"); if (mDatabaseFile) (void)mDatabaseFile->GetNativeLeafName(leafName); - MOZ_LOG(gStorageLog, LogLevel::Debug, ("Closing connection to '%s'", + MOZ_LOG(gStorageLog, PR_LOG_NOTICE, ("Closing connection to '%s'", leafName.get())); } @@ -953,7 +953,7 @@ Connection::internalClose(sqlite3 *aNativeConnection) sqlite3_stmt *stmt = nullptr; while ((stmt = ::sqlite3_next_stmt(aNativeConnection, stmt))) { - MOZ_LOG(gStorageLog, LogLevel::Debug, + MOZ_LOG(gStorageLog, PR_LOG_NOTICE, ("Auto-finalizing SQL statement '%s' (%x)", ::sqlite3_sql(stmt), stmt)); @@ -1103,7 +1103,7 @@ Connection::prepareStatement(sqlite3 *aNativeConnection, const nsCString &aSQL, #ifdef DEBUG NS_WARNING(warnMsg.get()); #endif - MOZ_LOG(gStorageLog, LogLevel::Error, ("%s", warnMsg.get())); + MOZ_LOG(gStorageLog, PR_LOG_ERROR, ("%s", warnMsg.get())); } (void)::sqlite3_extended_result_codes(aNativeConnection, 0); diff --git a/storage/mozStorageStatement.cpp b/storage/mozStorageStatement.cpp index 4456d49a9489..1bc93de7b71c 100644 --- a/storage/mozStorageStatement.cpp +++ b/storage/mozStorageStatement.cpp @@ -130,15 +130,15 @@ Statement::initialize(Connection *aDBConnection, PromiseFlatCString(aSQLStatement), &mDBStatement); if (srv != SQLITE_OK) { - MOZ_LOG(gStorageLog, LogLevel::Error, + MOZ_LOG(gStorageLog, PR_LOG_ERROR, ("Sqlite statement prepare error: %d '%s'", srv, ::sqlite3_errmsg(aNativeConnection))); - MOZ_LOG(gStorageLog, LogLevel::Error, + MOZ_LOG(gStorageLog, PR_LOG_ERROR, ("Statement was: '%s'", PromiseFlatCString(aSQLStatement).get())); return NS_ERROR_FAILURE; } - MOZ_LOG(gStorageLog, LogLevel::Debug, ("Initialized statement '%s' (0x%p)", + MOZ_LOG(gStorageLog, PR_LOG_NOTICE, ("Initialized statement '%s' (0x%p)", PromiseFlatCString(aSQLStatement).get(), mDBStatement)); @@ -276,7 +276,7 @@ Statement::getAsyncStatement(sqlite3_stmt **_stmt) return rc; } - MOZ_LOG(gStorageLog, LogLevel::Debug, + MOZ_LOG(gStorageLog, PR_LOG_NOTICE, ("Cloned statement 0x%p to 0x%p", mDBStatement, mAsyncStatement)); } @@ -366,7 +366,7 @@ Statement::internalFinalize(bool aDestructing) // In either case, the connection is still valid, hence closing // here is safe. // - MOZ_LOG(gStorageLog, LogLevel::Debug, ("Finalizing statement '%s' during garbage-collection", + MOZ_LOG(gStorageLog, PR_LOG_NOTICE, ("Finalizing statement '%s' during garbage-collection", ::sqlite3_sql(mDBStatement))); srv = ::sqlite3_finalize(mDBStatement); } @@ -398,7 +398,7 @@ Statement::internalFinalize(bool aDestructing) NS_WARNING(msg); #endif // 0 - MOZ_LOG(gStorageLog, LogLevel::Warning, (msg)); + MOZ_LOG(gStorageLog, PR_LOG_WARNING, (msg)); ::PR_smprintf_free(msg); } @@ -526,7 +526,7 @@ Statement::Reset() return NS_ERROR_NOT_INITIALIZED; #ifdef DEBUG - MOZ_LOG(gStorageLog, LogLevel::Debug, ("Resetting statement: '%s'", + MOZ_LOG(gStorageLog, PR_LOG_DEBUG, ("Resetting statement: '%s'", ::sqlite3_sql(mDBStatement))); checkAndLogStatementPerformance(mDBStatement); @@ -604,10 +604,10 @@ Statement::ExecuteStep(bool *_moreResults) } int srv = mDBConnection->stepStatement(mNativeConnection, mDBStatement); - if (srv != SQLITE_ROW && srv != SQLITE_DONE && MOZ_LOG_TEST(gStorageLog, LogLevel::Debug)) { + if (srv != SQLITE_ROW && srv != SQLITE_DONE && PR_LOG_TEST(gStorageLog, PR_LOG_DEBUG)) { nsAutoCString errStr; (void)mDBConnection->GetLastErrorString(errStr); - MOZ_LOG(gStorageLog, LogLevel::Debug, + MOZ_LOG(gStorageLog, PR_LOG_DEBUG, ("Statement::ExecuteStep error: %s", errStr.get())); } @@ -628,7 +628,7 @@ Statement::ExecuteStep(bool *_moreResults) mExecuting = false; } else if (mExecuting) { - MOZ_LOG(gStorageLog, LogLevel::Error, + MOZ_LOG(gStorageLog, PR_LOG_ERROR, ("SQLite error after mExecuting was true!")); mExecuting = false; } diff --git a/toolkit/components/downloads/ApplicationReputation.cpp b/toolkit/components/downloads/ApplicationReputation.cpp index bb5fee56839c..d837ac70df5d 100644 --- a/toolkit/components/downloads/ApplicationReputation.cpp +++ b/toolkit/components/downloads/ApplicationReputation.cpp @@ -66,8 +66,8 @@ using safe_browsing::ClientDownloadRequest_SignatureInfo; // NSPR_LOG_MODULES=ApplicationReputation:5 PRLogModuleInfo *ApplicationReputationService::prlog = nullptr; -#define LOG(args) MOZ_LOG(ApplicationReputationService::prlog, mozilla::LogLevel::Debug, args) -#define LOG_ENABLED() MOZ_LOG_TEST(ApplicationReputationService::prlog, mozilla::LogLevel::Debug) +#define LOG(args) MOZ_LOG(ApplicationReputationService::prlog, PR_LOG_DEBUG, args) +#define LOG_ENABLED() PR_LOG_TEST(ApplicationReputationService::prlog, PR_LOG_DEBUG) class PendingDBLookup; diff --git a/toolkit/components/filewatcher/NativeFileWatcherWin.cpp b/toolkit/components/filewatcher/NativeFileWatcherWin.cpp index e7e17880b4fc..a21a411de0f2 100644 --- a/toolkit/components/filewatcher/NativeFileWatcherWin.cpp +++ b/toolkit/components/filewatcher/NativeFileWatcherWin.cpp @@ -139,7 +139,7 @@ static PRLogModuleInfo* GetFileWatcherContextLog() return gNativeWatcherPRLog; } -#define FILEWATCHERLOG(...) MOZ_LOG(GetFileWatcherContextLog(), mozilla::LogLevel::Debug, (__VA_ARGS__)) +#define FILEWATCHERLOG(...) MOZ_LOG(GetFileWatcherContextLog(), PR_LOG_DEBUG, (__VA_ARGS__)) // The number of notifications to store within WatchedResourceDescriptor:mNotificationBuffer. // If the buffer overflows, its contents are discarded and a change callback is dispatched diff --git a/toolkit/components/url-classifier/Classifier.cpp b/toolkit/components/url-classifier/Classifier.cpp index effc7adc8205..5637eace8bde 100644 --- a/toolkit/components/url-classifier/Classifier.cpp +++ b/toolkit/components/url-classifier/Classifier.cpp @@ -17,8 +17,8 @@ // NSPR_LOG_MODULES=UrlClassifierDbService:5 extern PRLogModuleInfo *gUrlClassifierDbServiceLog; -#define LOG(args) MOZ_LOG(gUrlClassifierDbServiceLog, mozilla::LogLevel::Debug, args) -#define LOG_ENABLED() MOZ_LOG_TEST(gUrlClassifierDbServiceLog, mozilla::LogLevel::Debug) +#define LOG(args) MOZ_LOG(gUrlClassifierDbServiceLog, PR_LOG_DEBUG, args) +#define LOG_ENABLED() PR_LOG_TEST(gUrlClassifierDbServiceLog, PR_LOG_DEBUG) #define STORE_DIRECTORY NS_LITERAL_CSTRING("safebrowsing") #define TO_DELETE_DIR_SUFFIX NS_LITERAL_CSTRING("-to_delete") diff --git a/toolkit/components/url-classifier/HashStore.cpp b/toolkit/components/url-classifier/HashStore.cpp index d6390097f3f2..b792aacd102f 100644 --- a/toolkit/components/url-classifier/HashStore.cpp +++ b/toolkit/components/url-classifier/HashStore.cpp @@ -93,8 +93,8 @@ // NSPR_LOG_MODULES=UrlClassifierDbService:5 extern PRLogModuleInfo *gUrlClassifierDbServiceLog; -#define LOG(args) MOZ_LOG(gUrlClassifierDbServiceLog, mozilla::LogLevel::Debug, args) -#define LOG_ENABLED() MOZ_LOG_TEST(gUrlClassifierDbServiceLog, mozilla::LogLevel::Debug) +#define LOG(args) MOZ_LOG(gUrlClassifierDbServiceLog, PR_LOG_DEBUG, args) +#define LOG_ENABLED() PR_LOG_TEST(gUrlClassifierDbServiceLog, PR_LOG_DEBUG) // Either the return was successful or we call the Reset function (unless we // hit an OOM). Used while reading in the store. diff --git a/toolkit/components/url-classifier/LookupCache.cpp b/toolkit/components/url-classifier/LookupCache.cpp index b36be7ed6a2b..2dc6f82210b2 100644 --- a/toolkit/components/url-classifier/LookupCache.cpp +++ b/toolkit/components/url-classifier/LookupCache.cpp @@ -34,8 +34,8 @@ // NSPR_LOG_MODULES=UrlClassifierDbService:5 extern PRLogModuleInfo *gUrlClassifierDbServiceLog; -#define LOG(args) MOZ_LOG(gUrlClassifierDbServiceLog, mozilla::LogLevel::Debug, args) -#define LOG_ENABLED() MOZ_LOG_TEST(gUrlClassifierDbServiceLog, mozilla::LogLevel::Debug) +#define LOG(args) MOZ_LOG(gUrlClassifierDbServiceLog, PR_LOG_DEBUG, args) +#define LOG_ENABLED() PR_LOG_TEST(gUrlClassifierDbServiceLog, PR_LOG_DEBUG) namespace mozilla { namespace safebrowsing { diff --git a/toolkit/components/url-classifier/ProtocolParser.cpp b/toolkit/components/url-classifier/ProtocolParser.cpp index f85554f7ae11..2c79a3bd969e 100644 --- a/toolkit/components/url-classifier/ProtocolParser.cpp +++ b/toolkit/components/url-classifier/ProtocolParser.cpp @@ -14,8 +14,8 @@ // NSPR_LOG_MODULES=UrlClassifierDbService:5 extern PRLogModuleInfo *gUrlClassifierDbServiceLog; -#define LOG(args) MOZ_LOG(gUrlClassifierDbServiceLog, mozilla::LogLevel::Debug, args) -#define LOG_ENABLED() MOZ_LOG_TEST(gUrlClassifierDbServiceLog, mozilla::LogLevel::Debug) +#define LOG(args) MOZ_LOG(gUrlClassifierDbServiceLog, PR_LOG_DEBUG, args) +#define LOG_ENABLED() PR_LOG_TEST(gUrlClassifierDbServiceLog, PR_LOG_DEBUG) namespace mozilla { namespace safebrowsing { diff --git a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp index cd29cec81ad9..bcadb46ec4ed 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp @@ -56,8 +56,8 @@ using namespace mozilla::safebrowsing; // NSPR_LOG_MODULES=UrlClassifierDbService:5 PRLogModuleInfo *gUrlClassifierDbServiceLog = nullptr; -#define LOG(args) MOZ_LOG(gUrlClassifierDbServiceLog, mozilla::LogLevel::Debug, args) -#define LOG_ENABLED() MOZ_LOG_TEST(gUrlClassifierDbServiceLog, mozilla::LogLevel::Debug) +#define LOG(args) MOZ_LOG(gUrlClassifierDbServiceLog, PR_LOG_DEBUG, args) +#define LOG_ENABLED() PR_LOG_TEST(gUrlClassifierDbServiceLog, PR_LOG_DEBUG) // Prefs for implementing nsIURIClassifier to block page loads #define CHECK_MALWARE_PREF "browser.safebrowsing.malware.enabled" diff --git a/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp b/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp index d9c60960cafc..cef3d882c9e4 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp @@ -24,8 +24,8 @@ using namespace mozilla; // NSPR_LOG_MODULES=UrlClassifierPrefixSet:5 static const PRLogModuleInfo *gUrlClassifierPrefixSetLog = nullptr; -#define LOG(args) MOZ_LOG(gUrlClassifierPrefixSetLog, mozilla::LogLevel::Debug, args) -#define LOG_ENABLED() MOZ_LOG_TEST(gUrlClassifierPrefixSetLog, mozilla::LogLevel::Debug) +#define LOG(args) MOZ_LOG(gUrlClassifierPrefixSetLog, PR_LOG_DEBUG, args) +#define LOG_ENABLED() PR_LOG_TEST(gUrlClassifierPrefixSetLog, PR_LOG_DEBUG) NS_IMPL_ISUPPORTS( nsUrlClassifierPrefixSet, nsIUrlClassifierPrefixSet, nsIMemoryReporter) diff --git a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp index 422b39c23868..d349aa413602 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp @@ -25,7 +25,7 @@ static const char* gQuitApplicationMessage = "quit-application"; // NSPR_LOG_MODULES=UrlClassifierStreamUpdater:5 static const PRLogModuleInfo *gUrlClassifierStreamUpdaterLog = nullptr; -#define LOG(args) MOZ_LOG(gUrlClassifierStreamUpdaterLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gUrlClassifierStreamUpdaterLog, PR_LOG_DEBUG, args) // This class does absolutely nothing, except pass requests onto the DBService. diff --git a/toolkit/xre/nsUpdateDriver.cpp b/toolkit/xre/nsUpdateDriver.cpp index d4db40e10b86..c31755dc89dd 100644 --- a/toolkit/xre/nsUpdateDriver.cpp +++ b/toolkit/xre/nsUpdateDriver.cpp @@ -79,7 +79,7 @@ GetUpdateLog() sUpdateLog = PR_NewLogModule("updatedriver"); return sUpdateLog; } -#define LOG(args) MOZ_LOG(GetUpdateLog(), mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(GetUpdateLog(), PR_LOG_DEBUG, args) #ifdef XP_WIN #define UPDATER_BIN "updater.exe" diff --git a/uriloader/base/nsDocLoader.cpp b/uriloader/base/nsDocLoader.cpp index 240c817570ab..89411ee1c03c 100644 --- a/uriloader/base/nsDocLoader.cpp +++ b/uriloader/base/nsDocLoader.cpp @@ -35,8 +35,6 @@ #include "nsPresContext.h" #include "nsIAsyncVerifyRedirectCallback.h" -using mozilla::LogLevel; - static NS_DEFINE_CID(kThisImplCID, NS_THIS_DOCLOADER_IMPL_CID); // @@ -47,7 +45,7 @@ static NS_DEFINE_CID(kThisImplCID, NS_THIS_DOCLOADER_IMPL_CID); // set NSPR_LOG_MODULES=DocLoader:5 // set NSPR_LOG_FILE=nspr.log // -// this enables LogLevel::Debug level information and places all output in +// this enables PR_LOG_DEBUG level information and places all output in // the file nspr.log // PRLogModuleInfo* gDocLoaderLog = nullptr; @@ -121,7 +119,7 @@ nsDocLoader::nsDocLoader() ClearInternalProgress(); - MOZ_LOG(gDocLoaderLog, LogLevel::Debug, + MOZ_LOG(gDocLoaderLog, PR_LOG_DEBUG, ("DocLoader:%p: created.\n", this)); } @@ -138,7 +136,7 @@ nsDocLoader::Init() nsresult rv = NS_NewLoadGroup(getter_AddRefs(mLoadGroup), this); if (NS_FAILED(rv)) return rv; - MOZ_LOG(gDocLoaderLog, LogLevel::Debug, + MOZ_LOG(gDocLoaderLog, PR_LOG_DEBUG, ("DocLoader:%p: load group %x.\n", this, mLoadGroup.get())); return NS_OK; @@ -161,7 +159,7 @@ nsDocLoader::~nsDocLoader() Destroy(); - MOZ_LOG(gDocLoaderLog, LogLevel::Debug, + MOZ_LOG(gDocLoaderLog, PR_LOG_DEBUG, ("DocLoader:%p: deleted.\n", this)); } @@ -237,7 +235,7 @@ nsDocLoader::Stop(void) { nsresult rv = NS_OK; - MOZ_LOG(gDocLoaderLog, LogLevel::Debug, + MOZ_LOG(gDocLoaderLog, PR_LOG_DEBUG, ("DocLoader:%p: Stop() called\n", this)); NS_OBSERVER_ARRAY_NOTIFY_XPCOM_OBSERVERS(mChildList, nsDocLoader, Stop, ()); @@ -391,7 +389,7 @@ nsDocLoader::OnStartRequest(nsIRequest *request, nsISupports *aCtxt) { // called each time a request is added to the group. - if (MOZ_LOG_TEST(gDocLoaderLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gDocLoaderLog, PR_LOG_DEBUG)) { nsAutoCString name; request->GetName(name); @@ -399,7 +397,7 @@ nsDocLoader::OnStartRequest(nsIRequest *request, nsISupports *aCtxt) if (mLoadGroup) mLoadGroup->GetActiveCount(&count); - MOZ_LOG(gDocLoaderLog, LogLevel::Debug, + MOZ_LOG(gDocLoaderLog, PR_LOG_DEBUG, ("DocLoader:%p: OnStartRequest[%p](%s) mIsLoadingDocument=%s, %u active URLs", this, request, name.get(), (mIsLoadingDocument ? "true" : "false"), @@ -471,7 +469,7 @@ nsDocLoader::OnStopRequest(nsIRequest *aRequest, { nsresult rv = NS_OK; - if (MOZ_LOG_TEST(gDocLoaderLog, LogLevel::Debug)) { + if (PR_LOG_TEST(gDocLoaderLog, PR_LOG_DEBUG)) { nsAutoCString name; aRequest->GetName(name); @@ -479,7 +477,7 @@ nsDocLoader::OnStopRequest(nsIRequest *aRequest, if (mLoadGroup) mLoadGroup->GetActiveCount(&count); - MOZ_LOG(gDocLoaderLog, LogLevel::Debug, + MOZ_LOG(gDocLoaderLog, PR_LOG_DEBUG, ("DocLoader:%p: OnStopRequest[%p](%s) status=%x mIsLoadingDocument=%s, %u active URLs", this, aRequest, name.get(), aStatus, (mIsLoadingDocument ? "true" : "false"), @@ -684,7 +682,7 @@ void nsDocLoader::DocLoaderIsEmpty(bool aFlushLayout) // we don't need it anymore to CalculateMaxProgress(). ClearInternalProgress(); - MOZ_LOG(gDocLoaderLog, LogLevel::Debug, + MOZ_LOG(gDocLoaderLog, PR_LOG_DEBUG, ("DocLoader:%p: Is now idle...\n", this)); nsCOMPtr docRequest = mDocumentRequest; @@ -735,7 +733,7 @@ void nsDocLoader::doStartDocumentLoad(void) nsAutoCString buffer; GetURIStringFromRequest(mDocumentRequest, buffer); - MOZ_LOG(gDocLoaderLog, LogLevel::Debug, + MOZ_LOG(gDocLoaderLog, PR_LOG_DEBUG, ("DocLoader:%p: ++ Firing OnStateChange for start document load (...)." "\tURI: %s \n", this, buffer.get())); @@ -760,7 +758,7 @@ void nsDocLoader::doStartURLLoad(nsIRequest *request) nsAutoCString buffer; GetURIStringFromRequest(request, buffer); - MOZ_LOG(gDocLoaderLog, LogLevel::Debug, + MOZ_LOG(gDocLoaderLog, PR_LOG_DEBUG, ("DocLoader:%p: ++ Firing OnStateChange start url load (...)." "\tURI: %s\n", this, buffer.get())); @@ -779,7 +777,7 @@ void nsDocLoader::doStopURLLoad(nsIRequest *request, nsresult aStatus) nsAutoCString buffer; GetURIStringFromRequest(request, buffer); - MOZ_LOG(gDocLoaderLog, LogLevel::Debug, + MOZ_LOG(gDocLoaderLog, PR_LOG_DEBUG, ("DocLoader:%p: ++ Firing OnStateChange for end url load (...)." "\tURI: %s status=%x\n", this, buffer.get(), aStatus)); @@ -808,7 +806,7 @@ void nsDocLoader::doStopDocumentLoad(nsIRequest *request, nsAutoCString buffer; GetURIStringFromRequest(request, buffer); - MOZ_LOG(gDocLoaderLog, LogLevel::Debug, + MOZ_LOG(gDocLoaderLog, PR_LOG_DEBUG, ("DocLoader:%p: ++ Firing OnStateChange for end document load (...)." "\tURI: %s Status=%x\n", this, buffer.get(), aStatus)); @@ -995,7 +993,7 @@ NS_IMETHODIMP nsDocLoader::OnProgress(nsIRequest *aRequest, nsISupports* ctxt, nsLoadFlags lf = 0; aRequest->GetLoadFlags(&lf); if ((lf & nsIChannel::LOAD_DOCUMENT_URI) && !(lf & nsIChannel::LOAD_TARGETED)) { - MOZ_LOG(gDocLoaderLog, LogLevel::Debug, + MOZ_LOG(gDocLoaderLog, PR_LOG_DEBUG, ("DocLoader:%p Ignoring OnProgress while load is not targeted\n", this)); return NS_OK; } @@ -1044,7 +1042,7 @@ NS_IMETHODIMP nsDocLoader::OnProgress(nsIRequest *aRequest, nsISupports* ctxt, nsAutoCString buffer; GetURIStringFromRequest(aRequest, buffer); - MOZ_LOG(gDocLoaderLog, LogLevel::Debug, + MOZ_LOG(gDocLoaderLog, PR_LOG_DEBUG, ("DocLoader:%p OOPS - No Request Info for: %s\n", this, buffer.get())); #endif /* DEBUG */ @@ -1174,7 +1172,7 @@ void nsDocLoader::FireOnProgressChange(nsDocLoader *aLoadInitiator, nsAutoCString buffer; GetURIStringFromRequest(request, buffer); - MOZ_LOG(gDocLoaderLog, LogLevel::Debug, + MOZ_LOG(gDocLoaderLog, PR_LOG_DEBUG, ("DocLoader:%p: Progress (%s): curSelf: %d maxSelf: %d curTotal: %d maxTotal %d\n", this, buffer.get(), aProgress, aProgressMax, aTotalProgress, aMaxTotalProgress)); #endif /* DEBUG */ @@ -1240,7 +1238,7 @@ void nsDocLoader::DoFireOnStateChange(nsIWebProgress * const aProgress, nsAutoCString buffer; GetURIStringFromRequest(aRequest, buffer); - MOZ_LOG(gDocLoaderLog, LogLevel::Debug, + MOZ_LOG(gDocLoaderLog, PR_LOG_DEBUG, ("DocLoader:%p: Status (%s): code: %x\n", this, buffer.get(), aStateFlags)); #endif /* DEBUG */ @@ -1261,7 +1259,7 @@ nsDocLoader::FireOnLocationChange(nsIWebProgress* aWebProgress, uint32_t aFlags) { NOTIFY_LISTENERS(nsIWebProgress::NOTIFY_LOCATION, - MOZ_LOG(gDocLoaderLog, LogLevel::Debug, ("DocLoader [%p] calling %p->OnLocationChange", this, listener.get())); + MOZ_LOG(gDocLoaderLog, PR_LOG_DEBUG, ("DocLoader [%p] calling %p->OnLocationChange", this, listener.get())); listener->OnLocationChange(aWebProgress, aRequest, aUri, aFlags); ); @@ -1461,7 +1459,7 @@ NS_IMETHODIMP nsDocLoader::GetPriority(int32_t *aPriority) NS_IMETHODIMP nsDocLoader::SetPriority(int32_t aPriority) { - MOZ_LOG(gDocLoaderLog, LogLevel::Debug, + MOZ_LOG(gDocLoaderLog, PR_LOG_DEBUG, ("DocLoader:%p: SetPriority(%d) called\n", this, aPriority)); nsCOMPtr p = do_QueryInterface(mLoadGroup); @@ -1476,7 +1474,7 @@ NS_IMETHODIMP nsDocLoader::SetPriority(int32_t aPriority) NS_IMETHODIMP nsDocLoader::AdjustPriority(int32_t aDelta) { - MOZ_LOG(gDocLoaderLog, LogLevel::Debug, + MOZ_LOG(gDocLoaderLog, PR_LOG_DEBUG, ("DocLoader:%p: AdjustPriority(%d) called\n", this, aDelta)); nsCOMPtr p = do_QueryInterface(mLoadGroup); diff --git a/uriloader/base/nsURILoader.cpp b/uriloader/base/nsURILoader.cpp index ff2bf26e6db3..b0e28ec01d57 100644 --- a/uriloader/base/nsURILoader.cpp +++ b/uriloader/base/nsURILoader.cpp @@ -53,9 +53,9 @@ PRLogModuleInfo* nsURILoader::mLog = nullptr; -#define LOG(args) MOZ_LOG(nsURILoader::mLog, mozilla::LogLevel::Debug, args) -#define LOG_ERROR(args) MOZ_LOG(nsURILoader::mLog, mozilla::LogLevel::Error, args) -#define LOG_ENABLED() MOZ_LOG_TEST(nsURILoader::mLog, mozilla::LogLevel::Debug) +#define LOG(args) MOZ_LOG(nsURILoader::mLog, PR_LOG_DEBUG, args) +#define LOG_ERROR(args) MOZ_LOG(nsURILoader::mLog, PR_LOG_ERROR, args) +#define LOG_ENABLED() PR_LOG_TEST(nsURILoader::mLog, PR_LOG_DEBUG) #define NS_PREF_DISABLE_BACKGROUND_HANDLING \ "security.exthelperapp.disable_background_handling" diff --git a/uriloader/exthandler/mac/nsOSHelperAppService.mm b/uriloader/exthandler/mac/nsOSHelperAppService.mm index a92ba82c1716..6663272d9bb7 100644 --- a/uriloader/exthandler/mac/nsOSHelperAppService.mm +++ b/uriloader/exthandler/mac/nsOSHelperAppService.mm @@ -30,8 +30,6 @@ #define HELPERAPPLAUNCHER_BUNDLE_URL "chrome://global/locale/helperAppLauncher.properties" #define BRAND_BUNDLE_URL "chrome://branding/locale/brand.properties" -using mozilla::LogLevel; - /* This is an undocumented interface (in the Foundation framework) that has * been stable since at least 10.2.8 and is still present on SnowLeopard. * Furthermore WebKit has three public methods (in WebKitSystemInterface.h) @@ -308,7 +306,7 @@ nsOSHelperAppService::GetMIMEInfoFromOS(const nsACString& aMIMEType, const nsCString& flatType = PromiseFlatCString(aMIMEType); const nsCString& flatExt = PromiseFlatCString(aFileExt); - MOZ_LOG(mLog, LogLevel::Debug, ("Mac: HelperAppService lookup for type '%s' ext '%s'\n", + MOZ_LOG(mLog, PR_LOG_DEBUG, ("Mac: HelperAppService lookup for type '%s' ext '%s'\n", flatType.get(), flatExt.get())); // Create a Mac-specific MIME info so we can use Mac-specific members. @@ -338,7 +336,7 @@ nsOSHelperAppService::GetMIMEInfoFromOS(const nsACString& aMIMEType, err = ::LSCopyApplicationForMIMEType(cfMIMEType, kLSRolesAll, &appURL); if ((err == noErr) && appURL && ::CFURLGetFSRef(appURL, &typeAppFSRef)) { haveAppForType = true; - MOZ_LOG(mLog, LogLevel::Debug, ("LSCopyApplicationForMIMEType found a default application\n")); + MOZ_LOG(mLog, PR_LOG_DEBUG, ("LSCopyApplicationForMIMEType found a default application\n")); } if (appURL) { ::CFRelease(appURL); @@ -356,7 +354,7 @@ nsOSHelperAppService::GetMIMEInfoFromOS(const nsACString& aMIMEType, kLSRolesAll, &extAppFSRef, nullptr); if (err == noErr) { haveAppForExt = true; - MOZ_LOG(mLog, LogLevel::Debug, ("LSGetApplicationForInfo found a default application\n")); + MOZ_LOG(mLog, PR_LOG_DEBUG, ("LSGetApplicationForInfo found a default application\n")); } ::CFRelease(cfExt); } @@ -528,7 +526,7 @@ nsOSHelperAppService::GetMIMEInfoFromOS(const nsACString& aMIMEType, } } - MOZ_LOG(mLog, LogLevel::Debug, ("OS gave us: type '%s' found '%i'\n", mimeType.get(), *aFound)); + MOZ_LOG(mLog, PR_LOG_DEBUG, ("OS gave us: type '%s' found '%i'\n", mimeType.get(), *aFound)); [localPool release]; return mimeInfoMac.forget(); diff --git a/uriloader/exthandler/nsExternalHelperAppService.cpp b/uriloader/exthandler/nsExternalHelperAppService.cpp index cd4831b49a37..3c30b796e90f 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.cpp +++ b/uriloader/exthandler/nsExternalHelperAppService.cpp @@ -125,11 +125,11 @@ enum { PRLogModuleInfo* nsExternalHelperAppService::mLog = nullptr; // Using level 3 here because the OSHelperAppServices use a log level -// of LogLevel::Debug (4), and we want less detailed output here -// Using 3 instead of LogLevel::Warning because we don't output warnings +// of PR_LOG_DEBUG (4), and we want less detailed output here +// Using 3 instead of PR_LOG_WARN because we don't output warnings #undef LOG -#define LOG(args) MOZ_LOG(nsExternalHelperAppService::mLog, mozilla::LogLevel::Info, args) -#define LOG_ENABLED() MOZ_LOG_TEST(nsExternalHelperAppService::mLog, mozilla::LogLevel::Info) +#define LOG(args) MOZ_LOG(nsExternalHelperAppService::mLog, 3, args) +#define LOG_ENABLED() PR_LOG_TEST(nsExternalHelperAppService::mLog, 3) static const char NEVER_ASK_FOR_SAVE_TO_DISK_PREF[] = "browser.helperApps.neverAsk.saveToDisk"; @@ -1816,10 +1816,10 @@ void nsExternalAppHandler::SendStatusChange(ErrorType type, nsresult rv, nsIRequ } break; } - MOZ_LOG(nsExternalHelperAppService::mLog, LogLevel::Error, + MOZ_LOG(nsExternalHelperAppService::mLog, PR_LOG_ERROR, ("Error: %s, type=%i, listener=0x%p, transfer=0x%p, rv=0x%08X\n", NS_LossyConvertUTF16toASCII(msgId).get(), type, mDialogProgressListener.get(), mTransfer.get(), rv)); - MOZ_LOG(nsExternalHelperAppService::mLog, LogLevel::Error, + MOZ_LOG(nsExternalHelperAppService::mLog, PR_LOG_ERROR, (" path='%s'\n", NS_ConvertUTF16toUTF8(path).get())); // Get properties file bundle and extract status string. @@ -1848,7 +1848,7 @@ void nsExternalAppHandler::SendStatusChange(ErrorType type, nsresult rv, nsIRequ 1, getter_Copies(title)); - MOZ_LOG(nsExternalHelperAppService::mLog, LogLevel::Debug, + MOZ_LOG(nsExternalHelperAppService::mLog, PR_LOG_DEBUG, ("mContentContext=0x%p, prompter=0x%p, qi rv=0x%08X, title='%s', msg='%s'", mContentContext.get(), prompter.get(), @@ -1866,7 +1866,7 @@ void nsExternalAppHandler::SendStatusChange(ErrorType type, nsresult rv, nsIRequ prompter = do_GetInterface(window->GetDocShell(), &qiRv); - MOZ_LOG(nsExternalHelperAppService::mLog, LogLevel::Debug, + MOZ_LOG(nsExternalHelperAppService::mLog, PR_LOG_DEBUG, ("No prompter from mContentContext, using DocShell, " \ "window=0x%p, docShell=0x%p, " \ "prompter=0x%p, qi rv=0x%08X", @@ -1878,7 +1878,7 @@ void nsExternalAppHandler::SendStatusChange(ErrorType type, nsresult rv, nsIRequ // If we still don't have a prompter, there's nothing else we // can do so just return. if (!prompter) { - MOZ_LOG(nsExternalHelperAppService::mLog, LogLevel::Error, + MOZ_LOG(nsExternalHelperAppService::mLog, PR_LOG_ERROR, ("No prompter from DocShell, no way to alert user")); return; } diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exthandler/unix/nsOSHelperAppService.cpp index 77a285ffbe85..b477fcfaec02 100644 --- a/uriloader/exthandler/unix/nsOSHelperAppService.cpp +++ b/uriloader/exthandler/unix/nsOSHelperAppService.cpp @@ -39,8 +39,8 @@ using namespace mozilla; -#define LOG(args) MOZ_LOG(mLog, mozilla::LogLevel::Debug, args) -#define LOG_ENABLED() MOZ_LOG_TEST(mLog, mozilla::LogLevel::Debug) +#define LOG(args) MOZ_LOG(mLog, PR_LOG_DEBUG, args) +#define LOG_ENABLED() PR_LOG_TEST(mLog, PR_LOG_DEBUG) static nsresult FindSemicolon(nsAString::const_iterator& aSemicolon_iter, diff --git a/uriloader/exthandler/win/nsOSHelperAppService.cpp b/uriloader/exthandler/win/nsOSHelperAppService.cpp index da3503233a88..634bed62d258 100644 --- a/uriloader/exthandler/win/nsOSHelperAppService.cpp +++ b/uriloader/exthandler/win/nsOSHelperAppService.cpp @@ -23,7 +23,7 @@ // shellapi.h is needed to build with WIN32_LEAN_AND_MEAN #include -#define LOG(args) MOZ_LOG(mLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(mLog, PR_LOG_DEBUG, args) // helper methods: forward declarations... static nsresult GetExtensionFrom4xRegistryInfo(const nsACString& aMimeType, diff --git a/uriloader/prefetch/OfflineCacheUpdateChild.cpp b/uriloader/prefetch/OfflineCacheUpdateChild.cpp index 4cfc0945afe9..109a3a2cb2ac 100644 --- a/uriloader/prefetch/OfflineCacheUpdateChild.cpp +++ b/uriloader/prefetch/OfflineCacheUpdateChild.cpp @@ -42,16 +42,16 @@ using mozilla::dom::ContentChild; // set NSPR_LOG_MODULES=nsOfflineCacheUpdate:5 // set NSPR_LOG_FILE=offlineupdate.log // -// this enables LogLevel::Debug level information and places all output in +// this enables PR_LOG_ALWAYS level information and places all output in // the file offlineupdate.log // extern PRLogModuleInfo *gOfflineCacheUpdateLog; #undef LOG -#define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, 4, args) #undef LOG_ENABLED -#define LOG_ENABLED() MOZ_LOG_TEST(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug) +#define LOG_ENABLED() PR_LOG_TEST(gOfflineCacheUpdateLog, 4) namespace mozilla { namespace docshell { diff --git a/uriloader/prefetch/OfflineCacheUpdateGlue.cpp b/uriloader/prefetch/OfflineCacheUpdateGlue.cpp index 6a20ccc77bae..2eed2f927f66 100644 --- a/uriloader/prefetch/OfflineCacheUpdateGlue.cpp +++ b/uriloader/prefetch/OfflineCacheUpdateGlue.cpp @@ -20,16 +20,16 @@ // set NSPR_LOG_MODULES=nsOfflineCacheUpdate:5 // set NSPR_LOG_FILE=offlineupdate.log // -// this enables LogLevel::Info level information and places all output in +// this enables PR_LOG_ALWAYS level information and places all output in // the file offlineupdate.log // extern PRLogModuleInfo *gOfflineCacheUpdateLog; #undef LOG -#define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, 4, args) #undef LOG_ENABLED -#define LOG_ENABLED() MOZ_LOG_TEST(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug) +#define LOG_ENABLED() PR_LOG_TEST(gOfflineCacheUpdateLog, 4) namespace mozilla { namespace docshell { diff --git a/uriloader/prefetch/OfflineCacheUpdateParent.cpp b/uriloader/prefetch/OfflineCacheUpdateParent.cpp index fb56987e9077..a342c62dfe26 100644 --- a/uriloader/prefetch/OfflineCacheUpdateParent.cpp +++ b/uriloader/prefetch/OfflineCacheUpdateParent.cpp @@ -23,16 +23,16 @@ using mozilla::dom::TabParent; // set NSPR_LOG_MODULES=nsOfflineCacheUpdate:5 // set NSPR_LOG_FILE=offlineupdate.log // -// this enables LogLevel::Debug level information and places all output in +// this enables PR_LOG_ALWAYS level information and places all output in // the file offlineupdate.log // extern PRLogModuleInfo *gOfflineCacheUpdateLog; #undef LOG -#define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, 4, args) #undef LOG_ENABLED -#define LOG_ENABLED() MOZ_LOG_TEST(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug) +#define LOG_ENABLED() PR_LOG_TEST(gOfflineCacheUpdateLog, 4) namespace mozilla { namespace docshell { diff --git a/uriloader/prefetch/nsOfflineCacheUpdate.cpp b/uriloader/prefetch/nsOfflineCacheUpdate.cpp index bda26798c233..999fb0240638 100644 --- a/uriloader/prefetch/nsOfflineCacheUpdate.cpp +++ b/uriloader/prefetch/nsOfflineCacheUpdate.cpp @@ -57,16 +57,16 @@ static const int32_t kCustomProfileQuota = 512000; // set NSPR_LOG_MODULES=nsOfflineCacheUpdate:5 // set NSPR_LOG_FILE=offlineupdate.log // -// this enables LogLevel::Debug level information and places all output in +// this enables PR_LOG_ALWAYS level information and places all output in // the file offlineupdate.log // extern PRLogModuleInfo *gOfflineCacheUpdateLog; #undef LOG -#define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, 4, args) #undef LOG_ENABLED -#define LOG_ENABLED() MOZ_LOG_TEST(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug) +#define LOG_ENABLED() PR_LOG_TEST(gOfflineCacheUpdateLog, 4) class AutoFreeArray { public: diff --git a/uriloader/prefetch/nsOfflineCacheUpdateService.cpp b/uriloader/prefetch/nsOfflineCacheUpdateService.cpp index dd3e4753ddf8..d5f52a395eec 100644 --- a/uriloader/prefetch/nsOfflineCacheUpdateService.cpp +++ b/uriloader/prefetch/nsOfflineCacheUpdateService.cpp @@ -76,16 +76,16 @@ typedef mozilla::docshell::OfflineCacheUpdateGlue OfflineCacheUpdateGlue; // set NSPR_LOG_MODULES=nsOfflineCacheUpdate:5 // set NSPR_LOG_FILE=offlineupdate.log // -// this enables LogLevel::Debug level information and places all output in +// this enables PR_LOG_ALWAYS level information and places all output in // the file offlineupdate.log // PRLogModuleInfo *gOfflineCacheUpdateLog; #undef LOG -#define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gOfflineCacheUpdateLog, 4, args) #undef LOG_ENABLED -#define LOG_ENABLED() MOZ_LOG_TEST(gOfflineCacheUpdateLog, mozilla::LogLevel::Debug) +#define LOG_ENABLED() PR_LOG_TEST(gOfflineCacheUpdateLog, 4) namespace { // anon diff --git a/uriloader/prefetch/nsPrefetchService.cpp b/uriloader/prefetch/nsPrefetchService.cpp index d72abde572de..7c803363e926 100644 --- a/uriloader/prefetch/nsPrefetchService.cpp +++ b/uriloader/prefetch/nsPrefetchService.cpp @@ -38,16 +38,16 @@ using namespace mozilla; // set NSPR_LOG_MODULES=nsPrefetch:5 // set NSPR_LOG_FILE=prefetch.log // -// this enables LogLevel::Debug level information and places all output in +// this enables PR_LOG_ALWAYS level information and places all output in // the file http.log // static PRLogModuleInfo *gPrefetchLog; #undef LOG -#define LOG(args) MOZ_LOG(gPrefetchLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gPrefetchLog, 4, args) #undef LOG_ENABLED -#define LOG_ENABLED() MOZ_LOG_TEST(gPrefetchLog, mozilla::LogLevel::Debug) +#define LOG_ENABLED() PR_LOG_TEST(gPrefetchLog, 4) #define PREFETCH_PREF "network.prefetch-next" diff --git a/widget/cocoa/NativeKeyBindings.mm b/widget/cocoa/NativeKeyBindings.mm index 173a48b66e10..6f12830cfd71 100644 --- a/widget/cocoa/NativeKeyBindings.mm +++ b/widget/cocoa/NativeKeyBindings.mm @@ -67,7 +67,7 @@ NativeKeyBindings::Init(NativeKeyBindingsType aType) gNativeKeyBindingsLog = PR_NewLogModule("NativeKeyBindings"); } - MOZ_LOG(gNativeKeyBindingsLog, LogLevel::Info, + MOZ_LOG(gNativeKeyBindingsLog, PR_LOG_ALWAYS, ("%p NativeKeyBindings::Init", this)); // Many selectors have a one-to-one mapping to a Gecko command. Those mappings @@ -203,7 +203,7 @@ NativeKeyBindings::Execute(const WidgetKeyboardEvent& aEvent, DoCommandCallback aCallback, void* aCallbackData) { - MOZ_LOG(gNativeKeyBindingsLog, LogLevel::Info, + MOZ_LOG(gNativeKeyBindingsLog, PR_LOG_ALWAYS, ("%p NativeKeyBindings::KeyPress", this)); // Recover the current event, which should always be the key down we are @@ -212,19 +212,19 @@ NativeKeyBindings::Execute(const WidgetKeyboardEvent& aEvent, NSEvent* cocoaEvent = reinterpret_cast(aEvent.mNativeKeyEvent); if (!cocoaEvent || [cocoaEvent type] != NSKeyDown) { - MOZ_LOG(gNativeKeyBindingsLog, LogLevel::Info, + MOZ_LOG(gNativeKeyBindingsLog, PR_LOG_ALWAYS, ("%p NativeKeyBindings::KeyPress, no Cocoa key down event", this)); return false; } - MOZ_LOG(gNativeKeyBindingsLog, LogLevel::Info, + MOZ_LOG(gNativeKeyBindingsLog, PR_LOG_ALWAYS, ("%p NativeKeyBindings::KeyPress, interpreting", this)); nsAutoTArray bindingCommands; nsCocoaUtils::GetCommandsFromKeyEvent(cocoaEvent, bindingCommands); - MOZ_LOG(gNativeKeyBindingsLog, LogLevel::Info, + MOZ_LOG(gNativeKeyBindingsLog, PR_LOG_ALWAYS, ("%p NativeKeyBindings::KeyPress, bindingCommands=%u", this, bindingCommands.Length())); @@ -233,12 +233,12 @@ NativeKeyBindings::Execute(const WidgetKeyboardEvent& aEvent, for (uint32_t i = 0; i < bindingCommands.Length(); i++) { SEL selector = bindingCommands[i].selector; - if (MOZ_LOG_TEST(gNativeKeyBindingsLog, LogLevel::Info)) { + if (PR_LOG_TEST(gNativeKeyBindingsLog, PR_LOG_ALWAYS)) { NSString* selectorString = NSStringFromSelector(selector); nsAutoString nsSelectorString; nsCocoaUtils::GetStringForNSString(selectorString, nsSelectorString); - MOZ_LOG(gNativeKeyBindingsLog, LogLevel::Info, + MOZ_LOG(gNativeKeyBindingsLog, PR_LOG_ALWAYS, ("%p NativeKeyBindings::KeyPress, selector=%s", this, NS_LossyConvertUTF16toASCII(nsSelectorString).get())); } @@ -265,7 +265,7 @@ NativeKeyBindings::Execute(const WidgetKeyboardEvent& aEvent, } if (geckoCommands.IsEmpty()) { - MOZ_LOG(gNativeKeyBindingsLog, LogLevel::Info, + MOZ_LOG(gNativeKeyBindingsLog, PR_LOG_ALWAYS, ("%p NativeKeyBindings::KeyPress, handled=false", this)); return false; @@ -274,7 +274,7 @@ NativeKeyBindings::Execute(const WidgetKeyboardEvent& aEvent, for (uint32_t i = 0; i < geckoCommands.Length(); i++) { Command geckoCommand = geckoCommands[i]; - MOZ_LOG(gNativeKeyBindingsLog, LogLevel::Info, + MOZ_LOG(gNativeKeyBindingsLog, PR_LOG_ALWAYS, ("%p NativeKeyBindings::KeyPress, command=%s", this, WidgetKeyboardEvent::GetCommandStr(geckoCommand))); @@ -282,7 +282,7 @@ NativeKeyBindings::Execute(const WidgetKeyboardEvent& aEvent, aCallback(geckoCommand, aCallbackData); } - MOZ_LOG(gNativeKeyBindingsLog, LogLevel::Info, + MOZ_LOG(gNativeKeyBindingsLog, PR_LOG_ALWAYS, ("%p NativeKeyBindings::KeyPress, handled=true", this)); return true; diff --git a/widget/cocoa/TextInputHandler.mm b/widget/cocoa/TextInputHandler.mm index 25137fa8e6ac..d3118c4eff92 100644 --- a/widget/cocoa/TextInputHandler.mm +++ b/widget/cocoa/TextInputHandler.mm @@ -364,7 +364,7 @@ TISInputSourceWrapper::TranslateToString(UInt32 aKeyCode, UInt32 aModifiers, const UCKeyboardLayout* UCKey = GetUCKeyboardLayout(); - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TISInputSourceWrapper::TranslateToString, aKeyCode=0x%X, " "aModifiers=0x%X, aKbType=0x%X UCKey=%p\n " "Shift: %s, Ctrl: %s, Opt: %s, Cmd: %s, CapsLock: %s, NumLock: %s", @@ -384,7 +384,7 @@ TISInputSourceWrapper::TranslateToString(UInt32 aKeyCode, UInt32 aModifiers, aKbType, kUCKeyTranslateNoDeadKeysMask, &deadKeyState, 5, &len, chars); - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TISInputSourceWrapper::TranslateToString, err=0x%X, len=%llu", this, err, len)); @@ -397,7 +397,7 @@ TISInputSourceWrapper::TranslateToString(UInt32 aKeyCode, UInt32 aModifiers, "size of char16_t and size of UniChar are different"); memcpy(aStr.BeginWriting(), chars, len * sizeof(char16_t)); - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TISInputSourceWrapper::TranslateToString, aStr=\"%s\"", this, NS_ConvertUTF16toUTF8(aStr).get())); @@ -759,7 +759,7 @@ TISInputSourceWrapper::InitKeyEvent(NSEvent *aNativeKeyEvent, { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TISInputSourceWrapper::InitKeyEvent, aNativeKeyEvent=%p, " "aKeyEvent.message=%s, aInsertString=%p, IsOpenedIMEMode()=%s", this, aNativeKeyEvent, GetGeckoKeyEventType(aKeyEvent), aInsertString, @@ -942,7 +942,7 @@ TISInputSourceWrapper::InitKeyEvent(NSEvent *aNativeKeyEvent, aKeyEvent.mIsRepeat = ([aNativeKeyEvent type] == NSKeyDown) ? [aNativeKeyEvent isARepeat] : false; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TISInputSourceWrapper::InitKeyEvent, " "shift=%s, ctrl=%s, alt=%s, meta=%s", this, OnOrOff(aKeyEvent.IsShift()), OnOrOff(aKeyEvent.IsControl()), @@ -959,7 +959,7 @@ TISInputSourceWrapper::InitKeyEvent(NSEvent *aNativeKeyEvent, aKeyEvent.charCode = 0; aKeyEvent.isChar = false; // XXX not used in XP level - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TISInputSourceWrapper::InitKeyEvent, keyCode=0x%X charCode=0x0", this, aKeyEvent.keyCode)); } @@ -1041,13 +1041,13 @@ TISInputSourceWrapper::InitKeyPressEvent(NSEvent *aNativeKeyEvent, NS_ASSERTION(aKeyEvent.message == NS_KEY_PRESS, "aKeyEvent must be NS_KEY_PRESS event"); - if (MOZ_LOG_TEST(gLog, LogLevel::Info)) { + if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) { nsAutoString chars; nsCocoaUtils::GetStringForNSString([aNativeKeyEvent characters], chars); NS_ConvertUTF16toUTF8 utf8Chars(chars); char16_t expectedChar = static_cast(aInsertChar); NS_ConvertUTF16toUTF8 utf8ExpectedChar(&expectedChar, 1); - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TISInputSourceWrapper::InitKeyPressEvent, aNativeKeyEvent=%p, " "[aNativeKeyEvent characters]=\"%s\", aInsertChar=0x%X(%s), " "aKeyEvent.message=%s, aKbType=0x%X, IsOpenedIMEMode()=%s", @@ -1062,7 +1062,7 @@ TISInputSourceWrapper::InitKeyPressEvent(NSEvent *aNativeKeyEvent, aKeyEvent.keyCode = 0; } - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TISInputSourceWrapper::InitKeyPressEvent, " "aKeyEvent.keyCode=0x%X, aKeyEvent.charCode=0x%X", this, aKeyEvent.keyCode, aKeyEvent.charCode)); @@ -1085,7 +1085,7 @@ TISInputSourceWrapper::InitKeyPressEvent(NSEvent *aNativeKeyEvent, lockState |= kEventKeyModifierNumLockMask; } - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TISInputSourceWrapper::InitKeyPressEvent, " "isRomanKeyboardLayout=%s, key=0x%X", this, TrueOrFalse(isRomanKeyboardLayout), aKbType, key)); @@ -1127,7 +1127,7 @@ TISInputSourceWrapper::InitKeyPressEvent(NSEvent *aNativeKeyEvent, AlternativeCharCode altCharCodes(unshiftedChar, shiftedChar); aKeyEvent.alternativeCharCodes.AppendElement(altCharCodes); } - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TISInputSourceWrapper::InitKeyPressEvent, " "aKeyEvent.isMeta=%s, isDvorakQWERTY=%s, " "unshiftedChar=U+%X, shiftedChar=U+%X", @@ -1189,7 +1189,7 @@ TISInputSourceWrapper::InitKeyPressEvent(NSEvent *aNativeKeyEvent, AlternativeCharCode altCharCodes(cmdedChar, cmdedShiftChar); aKeyEvent.alternativeCharCodes.AppendElement(altCharCodes); } - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TISInputSourceWrapper::InitKeyPressEvent, " "hasCmdShiftOnlyChar=%s, isCmdSwitchLayout=%s, isDvorakQWERTY=%s, " "cmdedChar=U+%X, cmdedShiftChar=U+%X", @@ -1201,7 +1201,7 @@ TISInputSourceWrapper::InitKeyPressEvent(NSEvent *aNativeKeyEvent, AlternativeCharCode altCharCodes(0, originalCmdedShiftChar); aKeyEvent.alternativeCharCodes.AppendElement(altCharCodes); } - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TISInputSourceWrapper::InitKeyPressEvent, " "hasCmdShiftOnlyChar=%s, originalCmdedShiftChar=U+%X", this, TrueOrFalse(hasCmdShiftOnlyChar), originalCmdedShiftChar)); @@ -1214,7 +1214,7 @@ TISInputSourceWrapper::ComputeGeckoKeyCode(UInt32 aNativeKeyCode, UInt32 aKbType, bool aCmdIsPressed) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TISInputSourceWrapper::ComputeGeckoKeyCode, aNativeKeyCode=0x%X, " "aKbType=0x%X, aCmdIsPressed=%s, IsOpenedIMEMode()=%s, " "IsASCIICapable()=%s", @@ -1443,9 +1443,9 @@ TextInputHandler::CreateAllKeyboardLayoutList() void TextInputHandler::DebugPrintAllKeyboardLayouts() { - if (MOZ_LOG_TEST(gLog, LogLevel::Info)) { + if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) { CFArrayRef list = CreateAllKeyboardLayoutList(); - MOZ_LOG(gLog, LogLevel::Info, ("Keyboard layout configuration:")); + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("Keyboard layout configuration:")); CFIndex idx = ::CFArrayGetCount(list); TISInputSourceWrapper tis; for (CFIndex i = 0; i < idx; ++i) { @@ -1455,7 +1455,7 @@ TextInputHandler::DebugPrintAllKeyboardLayouts() nsAutoString name, isid; tis.GetLocalizedName(name); tis.GetInputSourceID(isid); - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, (" %s\t<%s>%s%s\n", NS_ConvertUTF16toUTF8(name).get(), NS_ConvertUTF16toUTF8(isid).get(), @@ -1496,13 +1496,13 @@ TextInputHandler::HandleKeyDownEvent(NSEvent* aNativeEvent) NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; if (Destroyed()) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandler::HandleKeyDownEvent, " "widget has been already destroyed", this)); return false; } - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandler::HandleKeyDownEvent, aNativeEvent=%p, " "type=%s, keyCode=%lld (0x%X), modifierFlags=0x%X, characters=\"%s\", " "charactersIgnoringModifiers=\"%s\"", @@ -1537,7 +1537,7 @@ TextInputHandler::HandleKeyDownEvent(NSEvent* aNativeEvent) currentKeyEvent->mKeyDownHandled = DispatchEvent(keydownEvent); if (Destroyed()) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandler::HandleKeyDownEvent, " "widget was destroyed by keydown event", this)); return currentKeyEvent->IsDefaultPrevented(); @@ -1547,14 +1547,14 @@ TextInputHandler::HandleKeyDownEvent(NSEvent* aNativeEvent) // case we should not fire the key press. // XXX This is a special code only on Cocoa widget, why is this needed? if (firstResponder != [[mView window] firstResponder]) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandler::HandleKeyDownEvent, " "view lost focus by keydown event", this)); return currentKeyEvent->IsDefaultPrevented(); } if (currentKeyEvent->IsDefaultPrevented()) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandler::HandleKeyDownEvent, " "keydown event's default is prevented", this)); return true; @@ -1573,24 +1573,24 @@ TextInputHandler::HandleKeyDownEvent(NSEvent* aNativeEvent) bool wasComposing = IsIMEComposing(); bool interpretKeyEventsCalled = false; if (IsIMEEnabled() || IsASCIICapableOnly()) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandler::HandleKeyDownEvent, calling interpretKeyEvents", this)); [mView interpretKeyEvents:[NSArray arrayWithObject:aNativeEvent]]; interpretKeyEventsCalled = true; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandler::HandleKeyDownEvent, called interpretKeyEvents", this)); } if (Destroyed()) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandler::HandleKeyDownEvent, widget was destroyed", this)); return currentKeyEvent->IsDefaultPrevented(); } - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandler::HandleKeyDownEvent, wasComposing=%s, " "IsIMEComposing()=%s", this, TrueOrFalse(wasComposing), TrueOrFalse(IsIMEComposing()))); @@ -1615,7 +1615,7 @@ TextInputHandler::HandleKeyDownEvent(NSEvent* aNativeEvent) IsNormalCharInputtingEvent(keypressEvent))) { currentKeyEvent->mKeyPressHandled = DispatchEvent(keypressEvent); currentKeyEvent->mKeyPressDispatched = true; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandler::HandleKeyDownEvent, keypress event dispatched", this)); } @@ -1623,7 +1623,7 @@ TextInputHandler::HandleKeyDownEvent(NSEvent* aNativeEvent) // Note: mWidget might have become null here. Don't count on it from here on. - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandler::HandleKeyDownEvent, " "keydown handled=%s, keypress handled=%s, causedOtherKeyEvents=%s", this, TrueOrFalse(currentKeyEvent->mKeyDownHandled), @@ -1639,7 +1639,7 @@ TextInputHandler::HandleKeyUpEvent(NSEvent* aNativeEvent) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandler::HandleKeyUpEvent, aNativeEvent=%p, " "type=%s, keyCode=%lld (0x%X), modifierFlags=0x%X, characters=\"%s\", " "charactersIgnoringModifiers=\"%s\", " @@ -1651,7 +1651,7 @@ TextInputHandler::HandleKeyUpEvent(NSEvent* aNativeEvent) TrueOrFalse(IsIMEComposing()))); if (Destroyed()) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandler::HandleKeyUpEvent, " "widget has been already destroyed", this)); return; @@ -1676,7 +1676,7 @@ TextInputHandler::HandleFlagsChanged(NSEvent* aNativeEvent) NS_OBJC_BEGIN_TRY_ABORT_BLOCK; if (Destroyed()) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandler::HandleFlagsChanged, " "widget has been already destroyed", this)); return; @@ -1684,7 +1684,7 @@ TextInputHandler::HandleFlagsChanged(NSEvent* aNativeEvent) nsRefPtr kungFuDeathGrip(mWidget); - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandler::HandleFlagsChanged, aNativeEvent=%p, " "type=%s, keyCode=%s (0x%X), modifierFlags=0x%08X, " "sLastModifierState=0x%08X, IsIMEComposing()=%s", @@ -1995,7 +1995,7 @@ TextInputHandler::DispatchKeyEventForFlagsChanged(NSEvent* aNativeEvent, return; } - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandler::DispatchKeyEventForFlagsChanged, aNativeEvent=%p, " "type=%s, keyCode=%s (0x%X), aDispatchKeyDown=%s, IsIMEComposing()=%s", this, aNativeEvent, GetNativeKeyEventType(aNativeEvent), @@ -2039,7 +2039,7 @@ TextInputHandler::InsertText(NSAttributedString* aAttrString, KeyEventState* currentKeyEvent = GetCurrentKeyEvent(); - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandler::InsertText, aAttrString=\"%s\", " "aReplacementRange=%p { location=%llu, length=%llu }, " "IsIMEComposing()=%s, IgnoreIMEComposition()=%s, " @@ -2180,7 +2180,7 @@ TextInputHandler::DoCommandBySelector(const char* aSelector) KeyEventState* currentKeyEvent = GetCurrentKeyEvent(); - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandler::DoCommandBySelector, aSelector=\"%s\", " "Destroyed()=%s, keydownHandled=%s, keypressHandled=%s, " "causedOtherKeyEvents=%s", @@ -2197,7 +2197,7 @@ TextInputHandler::DoCommandBySelector(const char* aSelector) InitKeyEvent(currentKeyEvent->mKeyEvent, keypressEvent); currentKeyEvent->mKeyPressHandled = DispatchEvent(keypressEvent); currentKeyEvent->mKeyPressDispatched = true; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandler::DoCommandBySelector, keypress event " "dispatched, Destroyed()=%s, keypressHandled=%s", this, TrueOrFalse(Destroyed()), @@ -2260,7 +2260,7 @@ IMEInputHandler::OnCurrentTextInputSourceChange(CFNotificationCenterRef aCenter, tis.GetInputSourceID(sLatestIMEOpenedModeInputSourceID); } - if (MOZ_LOG_TEST(gLog, LogLevel::Info)) { + if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) { static CFStringRef sLastTIS = nullptr; CFStringRef newTIS; tis.GetInputSourceID(newTIS); @@ -2285,7 +2285,7 @@ IMEInputHandler::OnCurrentTextInputSourceChange(CFNotificationCenterRef aCenter, tis.GetPrimaryLanguage(lang0); tis.GetBundleID(bundleID0); - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("IMEInputHandler::OnCurrentTextInputSourceChange,\n" " Current Input Source is changed to:\n" " currentInputContext=%p\n" @@ -2348,9 +2348,9 @@ IMEInputHandler::CreateAllIMEModeList() void IMEInputHandler::DebugPrintAllIMEModes() { - if (MOZ_LOG_TEST(gLog, LogLevel::Info)) { + if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) { CFArrayRef list = CreateAllIMEModeList(); - MOZ_LOG(gLog, LogLevel::Info, ("IME mode configuration:")); + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("IME mode configuration:")); CFIndex idx = ::CFArrayGetCount(list); TISInputSourceWrapper tis; for (CFIndex i = 0; i < idx; ++i) { @@ -2360,7 +2360,7 @@ IMEInputHandler::DebugPrintAllIMEModes() nsAutoString name, isid; tis.GetLocalizedName(name); tis.GetInputSourceID(isid); - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, (" %s\t<%s>%s%s\n", NS_ConvertUTF16toUTF8(name).get(), NS_ConvertUTF16toUTF8(isid).get(), @@ -2404,7 +2404,7 @@ IMEInputHandler::NotifyIMEOfFocusChangeInGecko() { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::NotifyIMEOfFocusChangeInGecko, " "Destroyed()=%s, IsFocused()=%s, inputContext=%p", this, TrueOrFalse(Destroyed()), TrueOrFalse(IsFocused()), @@ -2443,7 +2443,7 @@ IMEInputHandler::DiscardIMEComposition() { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::DiscardIMEComposition, " "Destroyed()=%s, IsFocused()=%s, mView=%p, inputContext=%p", this, TrueOrFalse(Destroyed()), TrueOrFalse(IsFocused()), @@ -2474,7 +2474,7 @@ IMEInputHandler::SyncASCIICapableOnly() { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::SyncASCIICapableOnly, " "Destroyed()=%s, IsFocused()=%s, mIsASCIICapableOnly=%s, " "GetCurrentTSMDocumentID()=%p", @@ -2577,7 +2577,7 @@ uint32_t IMEInputHandler::ConvertToTextRangeType(uint32_t aUnderlineStyle, NSRange& aSelectedRange) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::ConvertToTextRangeType, " "aUnderlineStyle=%llu, aSelectedRange.length=%llu,", this, aUnderlineStyle, aSelectedRange.length)); @@ -2630,7 +2630,7 @@ IMEInputHandler::GetRangeCount(NSAttributedString *aAttrString) count++; } - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::GetRangeCount, aAttrString=\"%s\", count=%llu", this, GetCharacters([aAttrString string]), count)); @@ -2667,7 +2667,7 @@ IMEInputHandler::CreateTextRangeArray(NSAttributedString *aAttrString, ConvertToTextRangeType([attributeValue intValue], aSelectedRange); textRangeArray->AppendElement(range); - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::CreateTextRangeArray, " "range={ mStartOffset=%llu, mEndOffset=%llu, mRangeType=%s }", this, range.mStartOffset, range.mEndOffset, @@ -2685,7 +2685,7 @@ IMEInputHandler::CreateTextRangeArray(NSAttributedString *aAttrString, range.mRangeType = NS_TEXTRANGE_CARETPOSITION; textRangeArray->AppendElement(range); - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::CreateTextRangeArray, " "range={ mStartOffset=%llu, mEndOffset=%llu, mRangeType=%s }", this, range.mStartOffset, range.mEndOffset, @@ -2701,7 +2701,7 @@ IMEInputHandler::DispatchCompositionChangeEvent(const nsString& aText, NSAttributedString* aAttrString, NSRange& aSelectedRange) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::DispatchCompositionChangeEvent, " "aText=\"%s\", aAttrString=\"%s\", " "aSelectedRange={ location=%llu, length=%llu }, " @@ -2727,7 +2727,7 @@ IMEInputHandler::DispatchCompositionChangeEvent(const nsString& aText, bool IMEInputHandler::DispatchCompositionCommitEvent(const nsAString* aCommitString) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::DispatchCompositionCommitEvent, " "aCommitString=0x%p (\"%s\"), Destroyed()=%s", this, aCommitString, @@ -2763,7 +2763,7 @@ IMEInputHandler::InsertTextAsCommittingComposition( { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::InsertTextAsCommittingComposition, " "aAttrString=\"%s\", aReplacementRange=%p { location=%llu, length=%llu }, " "Destroyed()=%s, IsIMEComposing()=%s, " @@ -2790,7 +2790,7 @@ IMEInputHandler::InsertTextAsCommittingComposition( !NSEqualRanges(MarkedRange(), *aReplacementRange)) { DispatchCompositionCommitEvent(); if (Destroyed()) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::InsertTextAsCommittingComposition, " "destroyed by commiting composition for setting replacement range", this)); @@ -2819,7 +2819,7 @@ IMEInputHandler::InsertTextAsCommittingComposition( DispatchEvent(compStart); if (Destroyed()) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::InsertTextAsCommittingComposition, " "destroyed by compositionstart event", this)); return; @@ -2830,7 +2830,7 @@ IMEInputHandler::InsertTextAsCommittingComposition( DispatchCompositionCommitEvent(&str); if (Destroyed()) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::InsertTextAsCommittingComposition, " "destroyed by compositioncommit event", this)); return; @@ -2850,7 +2850,7 @@ IMEInputHandler::SetMarkedText(NSAttributedString* aAttrString, { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::SetMarkedText, " "aAttrString=\"%s\", aSelectedRange={ location=%llu, length=%llu }, " "aReplacementRange=%p { location=%llu, length=%llu }, " @@ -2880,7 +2880,7 @@ IMEInputHandler::SetMarkedText(NSAttributedString* aAttrString, DispatchCompositionCommitEvent(); mIgnoreIMECommit = ignoreIMECommit; if (Destroyed()) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::SetMarkedText, " "destroyed by commiting composition for setting replacement range", this)); @@ -2909,7 +2909,7 @@ IMEInputHandler::SetMarkedText(NSAttributedString* aAttrString, DispatchEvent(compStart); if (Destroyed()) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::SetMarkedText, " "destroyed by compositionstart event", this)); return; @@ -2927,7 +2927,7 @@ IMEInputHandler::SetMarkedText(NSAttributedString* aAttrString, DispatchCompositionChangeEvent(str, aAttrString, aSelectedRange); if (Destroyed()) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::SetMarkedText, " "destroyed by compositionchange event", this)); } @@ -2938,7 +2938,7 @@ IMEInputHandler::SetMarkedText(NSAttributedString* aAttrString, // current composition. DispatchCompositionCommitEvent(&EmptyString()); if (Destroyed()) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::SetMarkedText, " "destroyed by compositioncommit event", this)); return; @@ -2951,7 +2951,7 @@ IMEInputHandler::SetMarkedText(NSAttributedString* aAttrString, NSInteger IMEInputHandler::ConversationIdentifier() { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::ConversationIdentifier, Destroyed()=%s", this, TrueOrFalse(Destroyed()))); @@ -2966,7 +2966,7 @@ IMEInputHandler::ConversationIdentifier() textContent.InitForQueryTextContent(0, 0); DispatchEvent(textContent); if (!textContent.mSucceeded) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::ConversationIdentifier, Failed", this)); return reinterpret_cast(mView); } @@ -2981,7 +2981,7 @@ IMEInputHandler::GetAttributedSubstringFromRange(NSRange& aRange, { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::GetAttributedSubstringFromRange, " "aRange={ location=%llu, length=%llu }, aActualRange=%p, Destroyed()=%s", this, aRange.location, aRange.length, aActualRange, @@ -3003,7 +3003,7 @@ IMEInputHandler::GetAttributedSubstringFromRange(NSRange& aRange, textContent.RequestFontRanges(); DispatchEvent(textContent); - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::GetAttributedSubstringFromRange, " "textContent={ mSucceeded=%s, mReply={ mString=\"%s\", mOffset=%llu } }", this, TrueOrFalse(textContent.mSucceeded), @@ -3047,7 +3047,7 @@ IMEInputHandler::GetAttributedSubstringFromRange(NSRange& aRange, bool IMEInputHandler::HasMarkedText() { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::HasMarkedText, " "mMarkedRange={ location=%llu, length=%llu }", this, mMarkedRange.location, mMarkedRange.length)); @@ -3058,7 +3058,7 @@ IMEInputHandler::HasMarkedText() NSRange IMEInputHandler::MarkedRange() { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::MarkedRange, " "mMarkedRange={ location=%llu, length=%llu }", this, mMarkedRange.location, mMarkedRange.length)); @@ -3074,7 +3074,7 @@ IMEInputHandler::SelectedRange() { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::SelectedRange, Destroyed()=%s, mSelectedRange={ " "location=%llu, length=%llu }", this, TrueOrFalse(Destroyed()), mSelectedRange.location, @@ -3094,7 +3094,7 @@ IMEInputHandler::SelectedRange() WidgetQueryContentEvent selection(true, NS_QUERY_SELECTED_TEXT, mWidget); DispatchEvent(selection); - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::SelectedRange, selection={ mSucceeded=%s, " "mReply={ mOffset=%llu, mString.Length()=%llu } }", this, TrueOrFalse(selection.mSucceeded), selection.mReply.mOffset, @@ -3156,7 +3156,7 @@ IMEInputHandler::FirstRectForCharacterRange(NSRange& aRange, { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::FirstRectForCharacterRange, Destroyed()=%s, " "aRange={ location=%llu, length=%llu }, aActualRange=%p }", this, TrueOrFalse(Destroyed()), aRange.location, aRange.length, @@ -3224,7 +3224,7 @@ IMEInputHandler::FirstRectForCharacterRange(NSRange& aRange, *aActualRange = actualRange; } - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::FirstRectForCharacterRange, " "useCaretRect=%s rect={ x=%f, y=%f, width=%f, height=%f }, " "actualRange={ location=%llu, length=%llu }", @@ -3242,7 +3242,7 @@ IMEInputHandler::CharacterIndexForPoint(NSPoint& aPoint) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::CharacterIndexForPoint, aPoint={ x=%f, y=%f }", this, aPoint.x, aPoint.y)); @@ -3275,7 +3275,7 @@ IMEInputHandler::GetValidAttributesForMarkedText() { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::GetValidAttributesForMarkedText", this)); //nsRefPtr kungFuDeathGrip(this); @@ -3330,7 +3330,7 @@ IMEInputHandler::~IMEInputHandler() void IMEInputHandler::OnFocusChangeInGecko(bool aFocus) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::OnFocusChangeInGecko, aFocus=%s, Destroyed()=%s, " "sFocusedIMEHandler=%p", this, TrueOrFalse(aFocus), TrueOrFalse(Destroyed()), sFocusedIMEHandler)); @@ -3358,7 +3358,7 @@ IMEInputHandler::OnFocusChangeInGecko(bool aFocus) bool IMEInputHandler::OnDestroyWidget(nsChildView* aDestroyingWidget) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::OnDestroyWidget, aDestroyingWidget=%p, " "sFocusedIMEHandler=%p, IsIMEComposing()=%s", this, aDestroyingWidget, sFocusedIMEHandler, @@ -3391,7 +3391,7 @@ IMEInputHandler::OnStartIMEComposition() { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::OnStartIMEComposition, mView=%p, mWidget=%p" "inputContext=%p, mIsIMEComposing=%s", this, mView, mWidget, mView ? [mView inputContext] : nullptr, @@ -3408,7 +3408,7 @@ IMEInputHandler::OnUpdateIMEComposition(NSString* aIMECompositionString) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::OnUpdateIMEComposition, mView=%p, mWidget=%p, " "inputContext=%p, mIsIMEComposing=%s, aIMECompositionString=\"%s\"", this, mView, mWidget, mView ? [mView inputContext] : nullptr, @@ -3428,7 +3428,7 @@ IMEInputHandler::OnEndIMEComposition() { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::OnEndIMEComposition, mView=%p, mWidget=%p, " "inputContext=%p, mIsIMEComposing=%s", this, mView, mWidget, mView ? [mView inputContext] : nullptr, @@ -3451,7 +3451,7 @@ IMEInputHandler::SendCommittedText(NSString *aString) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::SendCommittedText, mView=%p, mWidget=%p, " "inputContext=%p, mIsIMEComposing=%s", this, mView, mWidget, mView ? [mView inputContext] : nullptr, @@ -3476,7 +3476,7 @@ IMEInputHandler::KillIMEComposition() { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::KillIMEComposition, mView=%p, mWidget=%p, " "inputContext=%p, mIsIMEComposing=%s, " "Destroyed()=%s, IsFocused()=%s", @@ -3496,7 +3496,7 @@ IMEInputHandler::KillIMEComposition() return; } - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::KillIMEComposition, Pending...", this)); // Commit the composition internally. @@ -3516,7 +3516,7 @@ IMEInputHandler::CommitIMEComposition() if (!IsIMEComposing()) return; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::CommitIMEComposition, mIMECompositionString=%s", this, GetCharacters(mIMECompositionString))); @@ -3540,7 +3540,7 @@ IMEInputHandler::CancelIMEComposition() if (!IsIMEComposing()) return; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::CancelIMEComposition, mIMECompositionString=%s", this, GetCharacters(mIMECompositionString))); @@ -3654,12 +3654,12 @@ IMEInputHandler::SetIMEOpenState(bool aOpenIME) void IMEInputHandler::OpenSystemPreferredLanguageIME() { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::OpenSystemPreferredLanguageIME", this)); CFArrayRef langList = ::CFLocaleCopyPreferredLanguages(); if (!langList) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::OpenSystemPreferredLanguageIME, langList is NULL", this)); return; @@ -3681,10 +3681,10 @@ IMEInputHandler::OpenSystemPreferredLanguageIME() TISInputSourceWrapper tis; tis.InitByLanguage(lang); if (tis.IsOpenedIMEMode()) { - if (MOZ_LOG_TEST(gLog, LogLevel::Info)) { + if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) { CFStringRef foundTIS; tis.GetInputSourceID(foundTIS); - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p IMEInputHandler::OpenSystemPreferredLanguageIME, " "foundTIS=%s, lang=%s", this, GetCharacters(foundTIS), GetCharacters(lang))); @@ -3732,7 +3732,7 @@ TextInputHandlerBase::~TextInputHandlerBase() bool TextInputHandlerBase::OnDestroyWidget(nsChildView* aDestroyingWidget) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandlerBase::OnDestroyWidget, " "aDestroyingWidget=%p, mWidget=%p", this, aDestroyingWidget, mWidget)); @@ -3751,7 +3751,7 @@ TextInputHandlerBase::DispatchEvent(WidgetGUIEvent& aEvent) if (aEvent.message == NS_KEY_PRESS) { WidgetInputEvent& inputEvent = *aEvent.AsInputEvent(); if (!inputEvent.IsMeta()) { - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandlerBase::DispatchEvent, hiding mouse cursor", this)); [NSCursor setHiddenUntilMouseMoves:YES]; } @@ -3849,7 +3849,7 @@ TextInputHandlerBase::GetWindowLevel() { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandlerBase::GetWindowLevel, Destryoed()=%s", this, TrueOrFalse(Destroyed()))); @@ -3864,7 +3864,7 @@ TextInputHandlerBase::GetWindowLevel() NS_ENSURE_TRUE(editorView, NSNormalWindowLevel); NSInteger windowLevel = [[editorView window] level]; - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandlerBase::GetWindowLevel, windowLevel=%s (%X)", this, GetWindowLevelName(windowLevel), windowLevel)); @@ -3884,7 +3884,7 @@ TextInputHandlerBase::AttachNativeKeyEvent(WidgetKeyboardEvent& aKeyEvent) return NS_OK; } - MOZ_LOG(gLog, LogLevel::Info, + MOZ_LOG(gLog, PR_LOG_ALWAYS, ("%p TextInputHandlerBase::AttachNativeKeyEvent, key=0x%X, char=0x%X, " "mod=0x%X", this, aKeyEvent.keyCode, aKeyEvent.charCode, aKeyEvent.modifiers)); diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index bec7cdb230b5..905b7c62670f 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -5623,7 +5623,7 @@ static int32_t RoundUp(double aDouble) if (!mGeckoChild) return NSDragOperationNone; - MOZ_LOG(sCocoaLog, LogLevel::Info, ("ChildView doDragAction: entered\n")); + MOZ_LOG(sCocoaLog, PR_LOG_ALWAYS, ("ChildView doDragAction: entered\n")); if (!mDragService) { CallGetService(kDragServiceContractID, &mDragService); @@ -5717,7 +5717,7 @@ static int32_t RoundUp(double aDouble) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; - MOZ_LOG(sCocoaLog, LogLevel::Info, ("ChildView draggingEntered: entered\n")); + MOZ_LOG(sCocoaLog, PR_LOG_ALWAYS, ("ChildView draggingEntered: entered\n")); // there should never be a globalDragPboard when "draggingEntered:" is // called, but just in case we'll take care of it here. @@ -5735,14 +5735,14 @@ static int32_t RoundUp(double aDouble) - (NSDragOperation)draggingUpdated:(id )sender { - MOZ_LOG(sCocoaLog, LogLevel::Info, ("ChildView draggingUpdated: entered\n")); + MOZ_LOG(sCocoaLog, PR_LOG_ALWAYS, ("ChildView draggingUpdated: entered\n")); return [self doDragAction:NS_DRAGDROP_OVER sender:sender]; } - (void)draggingExited:(id )sender { - MOZ_LOG(sCocoaLog, LogLevel::Info, ("ChildView draggingExited: entered\n")); + MOZ_LOG(sCocoaLog, PR_LOG_ALWAYS, ("ChildView draggingExited: entered\n")); nsAutoRetainCocoaObject kungFuDeathGrip(self); [self doDragAction:NS_DRAGDROP_EXIT sender:sender]; @@ -5841,7 +5841,7 @@ static int32_t RoundUp(double aDouble) nsresult rv; - MOZ_LOG(sCocoaLog, LogLevel::Info, ("ChildView namesOfPromisedFilesDroppedAtDestination: entering callback for promised files\n")); + MOZ_LOG(sCocoaLog, PR_LOG_ALWAYS, ("ChildView namesOfPromisedFilesDroppedAtDestination: entering callback for promised files\n")); nsCOMPtr targFile; NS_NewLocalFile(EmptyString(), true, getter_AddRefs(targFile)); diff --git a/widget/cocoa/nsClipboard.mm b/widget/cocoa/nsClipboard.mm index 051e3e4992bd..d4c499d89397 100644 --- a/widget/cocoa/nsClipboard.mm +++ b/widget/cocoa/nsClipboard.mm @@ -26,7 +26,6 @@ using mozilla::gfx::DataSourceSurface; using mozilla::gfx::SourceSurface; -using mozilla::LogLevel; using mozilla::RefPtr; // Screenshots use the (undocumented) png pasteboard type. @@ -419,7 +418,7 @@ nsClipboard::PasteboardDictFromTransferable(nsITransferable* aTransferable) nsXPIDLCString flavorStr; currentFlavor->ToString(getter_Copies(flavorStr)); - MOZ_LOG(sCocoaLog, LogLevel::Info, ("writing out clipboard data of type %s (%d)\n", flavorStr.get(), i)); + MOZ_LOG(sCocoaLog, PR_LOG_ALWAYS, ("writing out clipboard data of type %s (%d)\n", flavorStr.get(), i)); NSString *pboardType = nil; diff --git a/widget/cocoa/nsDragService.mm b/widget/cocoa/nsDragService.mm index e87f9825b46a..ad179fb06143 100644 --- a/widget/cocoa/nsDragService.mm +++ b/widget/cocoa/nsDragService.mm @@ -366,7 +366,7 @@ nsDragService::GetData(nsITransferable* aTransferable, uint32_t aItemIndex) nsXPIDLCString flavorStr; currentFlavor->ToString(getter_Copies(flavorStr)); - MOZ_LOG(sCocoaLog, LogLevel::Info, ("nsDragService::GetData: looking for clipboard data of type %s\n", flavorStr.get())); + MOZ_LOG(sCocoaLog, PR_LOG_ALWAYS, ("nsDragService::GetData: looking for clipboard data of type %s\n", flavorStr.get())); if (flavorStr.EqualsLiteral(kFileMime)) { NSArray* pFiles = [globalDragPboard propertyListForType:NSFilenamesPboardType]; diff --git a/widget/gtk/nsDeviceContextSpecG.cpp b/widget/gtk/nsDeviceContextSpecG.cpp index d9c3034748f7..c9be374f5ab7 100644 --- a/widget/gtk/nsDeviceContextSpecG.cpp +++ b/widget/gtk/nsDeviceContextSpecG.cpp @@ -42,7 +42,7 @@ GetDeviceContextSpecGTKLog() return sLog; } /* Macro to make lines shorter */ -#define DO_PR_DEBUG_LOG(x) MOZ_LOG(GetDeviceContextSpecGTKLog(), mozilla::LogLevel::Debug, x) +#define DO_PR_DEBUG_LOG(x) MOZ_LOG(GetDeviceContextSpecGTKLog(), PR_LOG_DEBUG, x) //---------------------------------------------------------------------------------- // The printer data is shared between the PrinterEnumerator and the nsDeviceContextSpecGTK diff --git a/widget/gtk/nsDragService.cpp b/widget/gtk/nsDragService.cpp index 4934b537f71d..38f867c9d8f7 100644 --- a/widget/gtk/nsDragService.cpp +++ b/widget/gtk/nsDragService.cpp @@ -127,7 +127,7 @@ nsDragService::nsDragService() // set up our logging module if (!sDragLm) sDragLm = PR_NewLogModule("nsDragService"); - MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::nsDragService")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::nsDragService")); mCanDrop = false; mTargetDragDataReceived = false; mTargetDragData = 0; @@ -136,7 +136,7 @@ nsDragService::nsDragService() nsDragService::~nsDragService() { - MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::~nsDragService")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::~nsDragService")); if (mTaskSource) g_source_remove(mTaskSource); @@ -160,7 +160,7 @@ nsDragService::Observe(nsISupports *aSubject, const char *aTopic, const char16_t *aData) { if (!nsCRT::strcmp(aTopic, "quit-application")) { - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::Observe(\"quit-application\")")); if (mHiddenWidget) { gtk_widget_destroy(mHiddenWidget); @@ -296,7 +296,7 @@ nsDragService::InvokeDragSession(nsIDOMNode *aDOMNode, nsIScriptableRegion * aRegion, uint32_t aActionType) { - MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::InvokeDragSession")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::InvokeDragSession")); // If the previous source drag has not yet completed, signal handlers need // to be removed from sGrabWidget and dragend needs to be dispatched to @@ -457,14 +457,14 @@ nsDragService::SetAlphaPixmap(SourceSurface *aSurface, NS_IMETHODIMP nsDragService::StartDragSession() { - MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::StartDragSession")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::StartDragSession")); return nsBaseDragService::StartDragSession(); } NS_IMETHODIMP nsDragService::EndDragSession(bool aDoneDrag) { - MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::EndDragSession %d", + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::EndDragSession %d", aDoneDrag)); if (sGrabWidget) { @@ -496,7 +496,7 @@ nsDragService::EndDragSession(bool aDoneDrag) NS_IMETHODIMP nsDragService::SetCanDrop(bool aCanDrop) { - MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::SetCanDrop %d", + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::SetCanDrop %d", aCanDrop)); mCanDrop = aCanDrop; return NS_OK; @@ -505,7 +505,7 @@ nsDragService::SetCanDrop(bool aCanDrop) NS_IMETHODIMP nsDragService::GetCanDrop(bool *aCanDrop) { - MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::GetCanDrop")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::GetCanDrop")); *aCanDrop = mCanDrop; return NS_OK; } @@ -580,10 +580,10 @@ GetTextUriListItem(const char *data, NS_IMETHODIMP nsDragService::GetNumDropItems(uint32_t * aNumItems) { - MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::GetNumDropItems")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::GetNumDropItems")); if (!mTargetWidget) { - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("*** warning: GetNumDropItems \ called without a valid target widget!\n")); *aNumItems = 0; @@ -602,7 +602,7 @@ nsDragService::GetNumDropItems(uint32_t * aNumItems) } else *aNumItems = 1; } - MOZ_LOG(sDragLm, LogLevel::Debug, ("%d items", *aNumItems)); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("%d items", *aNumItems)); return NS_OK; } @@ -611,14 +611,14 @@ NS_IMETHODIMP nsDragService::GetData(nsITransferable * aTransferable, uint32_t aItemIndex) { - MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::GetData %d", aItemIndex)); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::GetData %d", aItemIndex)); // make sure that we have a transferable if (!aTransferable) return NS_ERROR_INVALID_ARG; if (!mTargetWidget) { - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("*** warning: GetData \ called without a valid target widget!\n")); return NS_ERROR_FAILURE; @@ -642,7 +642,7 @@ nsDragService::GetData(nsITransferable * aTransferable, bool isList = IsTargetContextList(); if (isList) { - MOZ_LOG(sDragLm, LogLevel::Debug, ("it's a list...")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("it's a list...")); // find a matching flavor for (i = 0; i < cnt; ++i) { nsCOMPtr genericWrapper; @@ -655,7 +655,7 @@ nsDragService::GetData(nsITransferable * aTransferable, nsXPIDLCString flavorStr; currentFlavor->ToString(getter_Copies(flavorStr)); MOZ_LOG(sDragLm, - LogLevel::Debug, + PR_LOG_DEBUG, ("flavor is %s\n", (const char *)flavorStr)); // get the item with the right index nsCOMPtr genericItem; @@ -667,21 +667,21 @@ nsDragService::GetData(nsITransferable * aTransferable, nsCOMPtr data; uint32_t tmpDataLen = 0; - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("trying to get transfer data for %s\n", (const char *)flavorStr)); rv = item->GetTransferData(flavorStr, getter_AddRefs(data), &tmpDataLen); if (NS_FAILED(rv)) { - MOZ_LOG(sDragLm, LogLevel::Debug, ("failed.\n")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("failed.\n")); continue; } - MOZ_LOG(sDragLm, LogLevel::Debug, ("succeeded.\n")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("succeeded.\n")); rv = aTransferable->SetTransferData(flavorStr,data,tmpDataLen); if (NS_FAILED(rv)) { MOZ_LOG(sDragLm, - LogLevel::Debug, + PR_LOG_DEBUG, ("fail to set transfer data into transferable!\n")); continue; } @@ -705,7 +705,7 @@ nsDragService::GetData(nsITransferable * aTransferable, nsXPIDLCString flavorStr; currentFlavor->ToString(getter_Copies(flavorStr)); GdkAtom gdkFlavor = gdk_atom_intern(flavorStr, FALSE); - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("looking for data in type %s, gdk flavor %ld\n", static_cast(flavorStr), gdkFlavor)); bool dataFound = false; @@ -713,11 +713,11 @@ nsDragService::GetData(nsITransferable * aTransferable, GetTargetDragData(gdkFlavor); } if (mTargetDragData) { - MOZ_LOG(sDragLm, LogLevel::Debug, ("dataFound = true\n")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("dataFound = true\n")); dataFound = true; } else { - MOZ_LOG(sDragLm, LogLevel::Debug, ("dataFound = false\n")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("dataFound = false\n")); // Dragging and dropping from the file manager would cause us // to parse the source text as a nsIFile URL. @@ -769,13 +769,13 @@ nsDragService::GetData(nsITransferable * aTransferable, // on the clipboard first, try again with text/plain. If that // is present, convert it to unicode. if ( strcmp(flavorStr, kUnicodeMime) == 0 ) { - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("we were looking for text/unicode... \ trying with text/plain;charset=utf-8\n")); gdkFlavor = gdk_atom_intern(gTextPlainUTF8Type, FALSE); GetTargetDragData(gdkFlavor); if (mTargetDragData) { - MOZ_LOG(sDragLm, LogLevel::Debug, ("Got textplain data\n")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("Got textplain data\n")); const char* castedText = reinterpret_cast(mTargetDragData); char16_t* convertedText = nullptr; @@ -783,7 +783,7 @@ nsDragService::GetData(nsITransferable * aTransferable, mTargetDragDataLen); convertedText = ToNewUnicode(ucs2string); if ( convertedText ) { - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("successfully converted plain text \ to unicode.\n")); // out with the old, in with the new @@ -793,13 +793,13 @@ nsDragService::GetData(nsITransferable * aTransferable, dataFound = true; } // if plain text data on clipboard } else { - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("we were looking for text/unicode... \ trying again with text/plain\n")); gdkFlavor = gdk_atom_intern(kTextMime, FALSE); GetTargetDragData(gdkFlavor); if (mTargetDragData) { - MOZ_LOG(sDragLm, LogLevel::Debug, ("Got textplain data\n")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("Got textplain data\n")); const char* castedText = reinterpret_cast(mTargetDragData); char16_t* convertedText = nullptr; @@ -808,7 +808,7 @@ nsDragService::GetData(nsITransferable * aTransferable, castedText, mTargetDragDataLen, &convertedText, &convertedTextLen); if ( convertedText ) { - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("successfully converted plain text \ to unicode.\n")); // out with the old, in with the new @@ -825,13 +825,13 @@ nsDragService::GetData(nsITransferable * aTransferable, // it on the clipboard, try again with text/uri-list, and then // _NETSCAPE_URL if (strcmp(flavorStr, kURLMime) == 0) { - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("we were looking for text/x-moz-url...\ trying again with text/uri-list\n")); gdkFlavor = gdk_atom_intern(gTextUriListType, FALSE); GetTargetDragData(gdkFlavor); if (mTargetDragData) { - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("Got text/uri-list data\n")); const char *data = reinterpret_cast(mTargetDragData); @@ -842,7 +842,7 @@ nsDragService::GetData(nsITransferable * aTransferable, &convertedText, &convertedTextLen); if ( convertedText ) { - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("successfully converted \ _NETSCAPE_URL to unicode.\n")); // out with the old, in with the new @@ -853,17 +853,17 @@ nsDragService::GetData(nsITransferable * aTransferable, } } else { - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("failed to get text/uri-list data\n")); } if (!dataFound) { - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("we were looking for text/x-moz-url...\ trying again with _NETSCAP_URL\n")); gdkFlavor = gdk_atom_intern(gMozUrlType, FALSE); GetTargetDragData(gdkFlavor); if (mTargetDragData) { - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("Got _NETSCAPE_URL data\n")); const char* castedText = reinterpret_cast(mTargetDragData); @@ -872,7 +872,7 @@ nsDragService::GetData(nsITransferable * aTransferable, nsPrimitiveHelpers::ConvertPlatformPlainTextToUnicode(castedText, mTargetDragDataLen, &convertedText, &convertedTextLen); if ( convertedText ) { MOZ_LOG(sDragLm, - LogLevel::Debug, + PR_LOG_DEBUG, ("successfully converted _NETSCAPE_URL \ to unicode.\n")); // out with the old, in with the new @@ -883,7 +883,7 @@ nsDragService::GetData(nsITransferable * aTransferable, } } else { - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("failed to get _NETSCAPE_URL data\n")); } } @@ -908,7 +908,7 @@ nsDragService::GetData(nsITransferable * aTransferable, genericDataWrapper, mTargetDragDataLen); // we found one, get out of this loop! - MOZ_LOG(sDragLm, LogLevel::Debug, ("dataFound and converted!\n")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("dataFound and converted!\n")); break; } } // if (currentFlavor) @@ -922,7 +922,7 @@ NS_IMETHODIMP nsDragService::IsDataFlavorSupported(const char *aDataFlavor, bool *_retval) { - MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::IsDataFlavorSupported %s", + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::IsDataFlavorSupported %s", aDataFlavor)); if (!_retval) return NS_ERROR_INVALID_ARG; @@ -932,7 +932,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, // check to make sure that we have a drag object set, here if (!mTargetWidget) { - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("*** warning: IsDataFlavorSupported \ called without a valid target widget!\n")); return NS_OK; @@ -943,7 +943,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, // if it is, just look in the internal data since we are the source // for it. if (isList) { - MOZ_LOG(sDragLm, LogLevel::Debug, ("It's a list..")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("It's a list..")); uint32_t numDragItems = 0; // if we don't have mDataItems we didn't start this drag so it's // an external client trying to fool us. @@ -973,11 +973,11 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, if (currentFlavor) { nsXPIDLCString flavorStr; currentFlavor->ToString(getter_Copies(flavorStr)); - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("checking %s against %s\n", (const char *)flavorStr, aDataFlavor)); if (strcmp(flavorStr, aDataFlavor) == 0) { - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("boioioioiooioioioing!\n")); *_retval = true; } @@ -997,10 +997,10 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, GdkAtom atom = GDK_POINTER_TO_ATOM(tmp->data); gchar *name = nullptr; name = gdk_atom_name(atom); - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("checking %s against %s\n", name, aDataFlavor)); if (name && (strcmp(name, aDataFlavor) == 0)) { - MOZ_LOG(sDragLm, LogLevel::Debug, ("good!\n")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("good!\n")); *_retval = true; } // check for automatic text/uri-list -> text/x-moz-url mapping @@ -1009,7 +1009,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, (strcmp(name, gTextUriListType) == 0) && (strcmp(aDataFlavor, kURLMime) == 0 || strcmp(aDataFlavor, kFileMime) == 0)) { - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("good! ( it's text/uri-list and \ we're checking against text/x-moz-url )\n")); *_retval = true; @@ -1019,7 +1019,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, name && (strcmp(name, gMozUrlType) == 0) && (strcmp(aDataFlavor, kURLMime) == 0)) { - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("good! ( it's _NETSCAPE_URL and \ we're checking against text/x-moz-url )\n")); *_retval = true; @@ -1030,7 +1030,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, (strcmp(name, kTextMime) == 0) && ((strcmp(aDataFlavor, kUnicodeMime) == 0) || (strcmp(aDataFlavor, kFileMime) == 0))) { - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("good! ( it's text plain and we're checking \ against text/unicode or application/x-moz-file)\n")); *_retval = true; @@ -1043,7 +1043,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, void nsDragService::ReplyToDragMotion(GdkDragContext* aDragContext) { - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::ReplyToDragMotion %d", mCanDrop)); GdkDragAction action = (GdkDragAction)0; @@ -1077,7 +1077,7 @@ nsDragService::TargetDataReceived(GtkWidget *aWidget, guint aInfo, guint32 aTime) { - MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::TargetDataReceived")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::TargetDataReceived")); TargetResetData(); mTargetDragDataReceived = true; gint len = gtk_selection_data_get_length(aSelectionData); @@ -1088,7 +1088,7 @@ nsDragService::TargetDataReceived(GtkWidget *aWidget, memcpy(mTargetDragData, data, mTargetDragDataLen); } else { - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("Failed to get data. selection data len was %d\n", mTargetDragDataLen)); } @@ -1131,24 +1131,24 @@ nsDragService::IsTargetContextList(void) void nsDragService::GetTargetDragData(GdkAtom aFlavor) { - MOZ_LOG(sDragLm, LogLevel::Debug, ("getting data flavor %d\n", aFlavor)); - MOZ_LOG(sDragLm, LogLevel::Debug, ("mLastWidget is %p and mLastContext is %p\n", + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("getting data flavor %d\n", aFlavor)); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("mLastWidget is %p and mLastContext is %p\n", mTargetWidget.get(), mTargetDragContext.get())); // reset our target data areas TargetResetData(); gtk_drag_get_data(mTargetWidget, mTargetDragContext, aFlavor, mTargetTime); - MOZ_LOG(sDragLm, LogLevel::Debug, ("about to start inner iteration.")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("about to start inner iteration.")); PRTime entryTime = PR_Now(); while (!mTargetDragDataReceived && mDoingDrag) { // check the number of iterations - MOZ_LOG(sDragLm, LogLevel::Debug, ("doing iteration...\n")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("doing iteration...\n")); PR_Sleep(20*PR_TicksPerSecond()/1000); /* sleep for 20 ms/iteration */ if (PR_Now()-entryTime > NS_DND_TIMEOUT) break; gtk_main_iteration(); } - MOZ_LOG(sDragLm, LogLevel::Debug, ("finished inner iteration\n")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("finished inner iteration\n")); } void @@ -1186,7 +1186,7 @@ nsDragService::GetSourceList(void) (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry)); listTarget->target = g_strdup(gMimeListType); listTarget->flags = 0; - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("automatically adding target %s\n", listTarget->target)); targetArray.AppendElement(listTarget); @@ -1222,7 +1222,7 @@ nsDragService::GetSourceList(void) (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry)); listTarget->target = g_strdup(gTextUriListType); listTarget->flags = 0; - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("automatically adding target %s\n", listTarget->target)); targetArray.AppendElement(listTarget); @@ -1256,7 +1256,7 @@ nsDragService::GetSourceList(void) (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry)); target->target = g_strdup(flavorStr); target->flags = 0; - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("adding target %s\n", target->target)); targetArray.AppendElement(target); // Check to see if this is text/unicode. @@ -1268,7 +1268,7 @@ nsDragService::GetSourceList(void) (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry)); plainUTF8Target->target = g_strdup(gTextPlainUTF8Type); plainUTF8Target->flags = 0; - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("automatically adding target %s\n", plainUTF8Target->target)); targetArray.AppendElement(plainUTF8Target); @@ -1277,7 +1277,7 @@ nsDragService::GetSourceList(void) (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry)); plainTarget->target = g_strdup(kTextMime); plainTarget->flags = 0; - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("automatically adding target %s\n", plainTarget->target)); targetArray.AppendElement(plainTarget); @@ -1290,7 +1290,7 @@ nsDragService::GetSourceList(void) (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry)); urlTarget->target = g_strdup(gMozUrlType); urlTarget->flags = 0; - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("automatically adding target %s\n", urlTarget->target)); targetArray.AppendElement(urlTarget); @@ -1467,23 +1467,23 @@ nsDragService::SourceDataGet(GtkWidget *aWidget, GtkSelectionData *aSelectionData, guint32 aTime) { - MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::SourceDataGet")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::SourceDataGet")); GdkAtom target = gtk_selection_data_get_target(aSelectionData); nsXPIDLCString mimeFlavor; gchar *typeName = 0; typeName = gdk_atom_name(target); if (!typeName) { - MOZ_LOG(sDragLm, LogLevel::Debug, ("failed to get atom name.\n")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("failed to get atom name.\n")); return; } - MOZ_LOG(sDragLm, LogLevel::Debug, ("Type is %s\n", typeName)); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("Type is %s\n", typeName)); // make a copy since |nsXPIDLCString| won't use |g_free|... mimeFlavor.Adopt(strdup(typeName)); g_free(typeName); // check to make sure that we have data items to return. if (!mSourceDataItems) { - MOZ_LOG(sDragLm, LogLevel::Debug, ("Failed to get our data items\n")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("Failed to get our data items\n")); return; } @@ -1628,7 +1628,7 @@ invisibleSourceDragBegin(GtkWidget *aWidget, GdkDragContext *aContext, gpointer aData) { - MOZ_LOG(sDragLm, LogLevel::Debug, ("invisibleSourceDragBegin")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("invisibleSourceDragBegin")); nsDragService *dragService = (nsDragService *)aData; dragService->SetDragIcon(aContext); @@ -1642,7 +1642,7 @@ invisibleSourceDragDataGet(GtkWidget *aWidget, guint32 aTime, gpointer aData) { - MOZ_LOG(sDragLm, LogLevel::Debug, ("invisibleSourceDragDataGet")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("invisibleSourceDragDataGet")); nsDragService *dragService = (nsDragService *)aData; dragService->SourceDataGet(aWidget, aContext, aSelectionData, aTime); @@ -1654,7 +1654,7 @@ invisibleSourceDragFailed(GtkWidget *aWidget, gint aResult, gpointer aData) { - MOZ_LOG(sDragLm, LogLevel::Debug, ("invisibleSourceDragFailed %i", aResult)); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("invisibleSourceDragFailed %i", aResult)); nsDragService *dragService = (nsDragService *)aData; // End the drag session now (rather than waiting for the drag-end signal) // so that operations performed on dropEffect == none can start immediately @@ -1672,7 +1672,7 @@ invisibleSourceDragEnd(GtkWidget *aWidget, GdkDragContext *aContext, gpointer aData) { - MOZ_LOG(sDragLm, LogLevel::Debug, ("invisibleSourceDragEnd")); + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("invisibleSourceDragEnd")); nsDragService *dragService = (nsDragService *)aData; // The drag has ended. Release the hostages! @@ -1816,7 +1816,7 @@ gboolean nsDragService::RunScheduledTask() { if (mTargetWindow && mTargetWindow != mPendingWindow) { - MOZ_LOG(sDragLm, LogLevel::Debug, + MOZ_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService: dispatch drag leave (%p)\n", mTargetWindow.get())); mTargetWindow-> diff --git a/widget/gtk/nsGtkIMModule.cpp b/widget/gtk/nsGtkIMModule.cpp index 827e60a5f734..836cfee69f46 100644 --- a/widget/gtk/nsGtkIMModule.cpp +++ b/widget/gtk/nsGtkIMModule.cpp @@ -111,7 +111,7 @@ nsGtkIMModule::nsGtkIMModule(nsWindow* aOwnerWindow) void nsGtkIMModule::Init() { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): Init, mOwnerWindow=%p", this, mOwnerWindow)); @@ -178,14 +178,14 @@ nsGtkIMModule::~nsGtkIMModule() if (this == sLastFocusedModule) { sLastFocusedModule = nullptr; } - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p) was gone", this)); } void nsGtkIMModule::OnDestroyWindow(nsWindow* aWindow) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): OnDestroyWindow, aWindow=%p, mLastFocusedWindow=%p, mOwnerWindow=%p, mLastFocusedModule=%p", this, aWindow, mLastFocusedWindow, mOwnerWindow, sLastFocusedModule)); @@ -245,7 +245,7 @@ nsGtkIMModule::OnDestroyWindow(nsWindow* aWindow) mLastFocusedWindow = nullptr; mInputContext.mIMEState.mEnabled = IMEState::DISABLED; - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" SUCCEEDED, Completely destroyed")); } @@ -298,7 +298,7 @@ nsGtkIMModule::OnFocusWindow(nsWindow* aWindow) return; } - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): OnFocusWindow, aWindow=%p, mLastFocusedWindow=%p", this, aWindow, mLastFocusedWindow)); mLastFocusedWindow = aWindow; @@ -312,7 +312,7 @@ nsGtkIMModule::OnBlurWindow(nsWindow* aWindow) return; } - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): OnBlurWindow, aWindow=%p, mLastFocusedWindow=%p, " "mIsIMFocused=%s", this, aWindow, mLastFocusedWindow, GetBoolName(mIsIMFocused))); @@ -335,7 +335,7 @@ nsGtkIMModule::OnKeyEvent(nsWindow* aCaller, GdkEventKey* aEvent, return false; } - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): OnKeyEvent, aCaller=%p, aKeyDownEventWasSent=%s, " "mCompositionState=%s, current context=%p, active context=%p, " "aEvent(%p): { type=%s, keyval=%s, unicode=0x%X }", @@ -345,7 +345,7 @@ nsGtkIMModule::OnKeyEvent(nsWindow* aCaller, GdkEventKey* aEvent, gdk_keyval_to_unicode(aEvent->keyval))); if (aCaller != mLastFocusedWindow) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, the caller isn't focused window, mLastFocusedWindow=%p", mLastFocusedWindow)); return false; @@ -355,7 +355,7 @@ nsGtkIMModule::OnKeyEvent(nsWindow* aCaller, GdkEventKey* aEvent, // current context since the user expects so. GtkIMContext* currentContext = GetCurrentContext(); if (MOZ_UNLIKELY(!currentContext)) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, there are no context")); return false; } @@ -398,7 +398,7 @@ nsGtkIMModule::OnKeyEvent(nsWindow* aCaller, GdkEventKey* aEvent, } } - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" filterThisEvent=%s (isFiltered=%s, mFilterKeyEvent=%s), " "mCompositionState=%s", GetBoolName(filterThisEvent), GetBoolName(isFiltered), @@ -410,7 +410,7 @@ nsGtkIMModule::OnKeyEvent(nsWindow* aCaller, GdkEventKey* aEvent, void nsGtkIMModule::OnFocusChangeInGecko(bool aFocus) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): OnFocusChangeInGecko, aFocus=%s, " "mCompositionState=%s, mIsIMFocused=%s", this, GetBoolName(aFocus), GetCompositionStateName(), @@ -423,13 +423,13 @@ nsGtkIMModule::OnFocusChangeInGecko(bool aFocus) void nsGtkIMModule::ResetIME() { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): ResetIME, mCompositionState=%s, mIsIMFocused=%s", this, GetCompositionStateName(), GetBoolName(mIsIMFocused))); GtkIMContext* activeContext = GetActiveContext(); if (MOZ_UNLIKELY(!activeContext)) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, there are no context")); return; } @@ -450,7 +450,7 @@ nsGtkIMModule::ResetIME() nsAutoString compositionString; GetCompositionString(activeContext, compositionString); - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): ResetIME() called gtk_im_context_reset(), " "activeContext=%p, mCompositionState=%s, compositionString=%s, " "mIsIMFocused=%s", @@ -476,13 +476,13 @@ nsGtkIMModule::EndIMEComposition(nsWindow* aCaller) return NS_OK; } - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): EndIMEComposition, aCaller=%p, " "mCompositionState=%s", this, aCaller, GetCompositionStateName())); if (aCaller != mLastFocusedWindow) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" WARNING: the caller isn't focused window, mLastFocusedWindow=%p", mLastFocusedWindow)); return NS_OK; @@ -524,20 +524,20 @@ nsGtkIMModule::SetInputContext(nsWindow* aCaller, return; } - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): SetInputContext, aCaller=%p, aState=%s mHTMLInputType=%s", this, aCaller, GetEnabledStateName(aContext->mIMEState.mEnabled), NS_ConvertUTF16toUTF8(aContext->mHTMLInputType).get())); if (aCaller != mLastFocusedWindow) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, the caller isn't focused window, mLastFocusedWindow=%p", mLastFocusedWindow)); return; } if (!mContext) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, there are no context")); return; } @@ -545,7 +545,7 @@ nsGtkIMModule::SetInputContext(nsWindow* aCaller, if (sLastFocusedModule != this) { mInputContext = *aContext; - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" SUCCEEDED, but we're not active")); return; } @@ -658,7 +658,7 @@ nsGtkIMModule::IsEnabled() const void nsGtkIMModule::Focus() { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): Focus, sLastFocusedModule=%p", this, sLastFocusedModule)); @@ -670,7 +670,7 @@ nsGtkIMModule::Focus() GtkIMContext* currentContext = GetCurrentContext(); if (!currentContext) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, there are no context")); return; } @@ -694,7 +694,7 @@ nsGtkIMModule::Focus() void nsGtkIMModule::Blur() { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): Blur, mIsIMFocused=%s", this, GetBoolName(mIsIMFocused))); @@ -704,7 +704,7 @@ nsGtkIMModule::Blur() GtkIMContext* currentContext = GetCurrentContext(); if (!currentContext) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, there are no context")); return; } @@ -720,14 +720,14 @@ nsGtkIMModule::OnSelectionChange(nsWindow* aCaller) return; } - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): OnSelectionChange(aCaller=0x%p), " "mCompositionState=%s, mIsDeletingSurrounding=%s", this, aCaller, GetCompositionStateName(), mIsDeletingSurrounding ? "true" : "false")); if (aCaller != mLastFocusedWindow) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" WARNING: the caller isn't focused window, " "mLastFocusedWindow=%p", mLastFocusedWindow)); @@ -748,26 +748,26 @@ nsGtkIMModule::OnSelectionChange(nsWindow* aCaller) bool cannotContinueComposition = false; if (MOZ_UNLIKELY(IsDestroyed())) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" ERROR: nsGtkIMModule instance is destroyed during " "querying selection offset")); return; } else if (NS_WARN_IF(!selection.mSucceeded)) { cannotContinueComposition = true; - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" ERROR: failed to retrieve new caret offset")); } else if (selection.mReply.mOffset == UINT32_MAX) { cannotContinueComposition = true; - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" ERROR: new offset is too large, cannot keep composing")); } else if (!mLastFocusedWindow || focusedWindow != mLastFocusedWindow) { cannotContinueComposition = true; - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" ERROR: focus is changed during querying selection " "offset")); } else if (focusedWindow->Destroyed()) { cannotContinueComposition = true; - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" ERROR: focused window started to be being destroyed " "during querying selection offset")); } @@ -775,7 +775,7 @@ nsGtkIMModule::OnSelectionChange(nsWindow* aCaller) if (!cannotContinueComposition) { // Modify the selection start offset with new offset. mCompositionStart = selection.mReply.mOffset; - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" NOTE: mCompositionStart is updated to %u, " "the selection change doesn't cause resetting IM context", mCompositionStart)); @@ -805,14 +805,14 @@ nsGtkIMModule::OnStartCompositionCallback(GtkIMContext *aContext, void nsGtkIMModule::OnStartCompositionNative(GtkIMContext *aContext) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): OnStartCompositionNative, aContext=%p, " "current context=%p", this, aContext, GetCurrentContext())); // See bug 472635, we should do nothing if IM context doesn't match. if (GetCurrentContext() != aContext) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, given context doesn't match")); return; } @@ -836,7 +836,7 @@ nsGtkIMModule::OnEndCompositionCallback(GtkIMContext *aContext, void nsGtkIMModule::OnEndCompositionNative(GtkIMContext *aContext) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): OnEndCompositionNative, aContext=%p", this, aContext)); @@ -844,7 +844,7 @@ nsGtkIMModule::OnEndCompositionNative(GtkIMContext *aContext) // Note that if this is called after focus move, the context may different // from any our owning context. if (!IsValidContext(aContext)) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, given context doesn't match with any context")); return; } @@ -872,7 +872,7 @@ nsGtkIMModule::OnChangeCompositionCallback(GtkIMContext *aContext, void nsGtkIMModule::OnChangeCompositionNative(GtkIMContext *aContext) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): OnChangeCompositionNative, aContext=%p", this, aContext)); @@ -880,7 +880,7 @@ nsGtkIMModule::OnChangeCompositionNative(GtkIMContext *aContext) // Note that if this is called after focus move, the context may different // from any our owning context. if (!IsValidContext(aContext)) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, given context doesn't match with any context")); return; } @@ -907,14 +907,14 @@ nsGtkIMModule::OnRetrieveSurroundingCallback(GtkIMContext *aContext, gboolean nsGtkIMModule::OnRetrieveSurroundingNative(GtkIMContext *aContext) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): OnRetrieveSurroundingNative, aContext=%p, " "current context=%p", this, aContext, GetCurrentContext())); // See bug 472635, we should do nothing if IM context doesn't match. if (GetCurrentContext() != aContext) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, given context doesn't match")); return FALSE; } @@ -948,14 +948,14 @@ nsGtkIMModule::OnDeleteSurroundingNative(GtkIMContext *aContext, gint aOffset, gint aNChars) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): OnDeleteSurroundingNative, aContext=%p, " "current context=%p", this, aContext, GetCurrentContext())); // See bug 472635, we should do nothing if IM context doesn't match. if (GetCurrentContext() != aContext) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, given context doesn't match")); return FALSE; } @@ -967,7 +967,7 @@ nsGtkIMModule::OnDeleteSurroundingNative(GtkIMContext *aContext, } // failed - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, cannot delete text")); return FALSE; } @@ -988,7 +988,7 @@ nsGtkIMModule::OnCommitCompositionNative(GtkIMContext *aContext, const gchar emptyStr = 0; const gchar *commitString = aUTF8Char ? aUTF8Char : &emptyStr; - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): OnCommitCompositionNative, aContext=%p, " "current context=%p, active context=%p, commitString=\"%s\", " "mProcessingKeyEvent=%p, IsComposingOn(aContext)=%s", @@ -997,7 +997,7 @@ nsGtkIMModule::OnCommitCompositionNative(GtkIMContext *aContext, // See bug 472635, we should do nothing if IM context doesn't match. if (!IsValidContext(aContext)) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, given context doesn't match")); return; } @@ -1027,7 +1027,7 @@ nsGtkIMModule::OnCommitCompositionNative(GtkIMContext *aContext, keyval_utf8[keyval_utf8_len] = '\0'; if (!strcmp(commitString, keyval_utf8)) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): OnCommitCompositionNative, we'll send normal key event", this)); mFilterKeyEvent = false; @@ -1055,7 +1055,7 @@ nsGtkIMModule::GetCompositionString(GtkIMContext* aContext, aCompositionString.Truncate(); } - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): GetCompositionString, result=\"%s\"", this, preedit_string)); @@ -1066,18 +1066,18 @@ nsGtkIMModule::GetCompositionString(GtkIMContext* aContext, bool nsGtkIMModule::DispatchCompositionStart(GtkIMContext* aContext) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): DispatchCompositionStart, aContext=%p", this, aContext)); if (IsComposing()) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" WARNING, we're already in composition")); return true; } if (!mLastFocusedWindow) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, there are no focused window in this module")); return false; } @@ -1089,7 +1089,7 @@ nsGtkIMModule::DispatchCompositionStart(GtkIMContext* aContext) mLastFocusedWindow->DispatchEvent(&selection, status); if (!selection.mSucceeded || selection.mReply.mOffset == UINT32_MAX) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, cannot query the selection offset")); return false; } @@ -1109,17 +1109,17 @@ nsGtkIMModule::DispatchCompositionStart(GtkIMContext* aContext) bool isCancelled; mLastFocusedWindow->DispatchKeyDownEvent(mProcessingKeyEvent, &isCancelled); - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" keydown event is dispatched")); if (static_cast(kungFuDeathGrip.get())->IsDestroyed() || kungFuDeathGrip != mLastFocusedWindow) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" NOTE, the focused widget was destroyed/changed by keydown event")); return false; } } - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" mCompositionStart=%u", mCompositionStart)); mCompositionState = eCompositionState_CompositionStartDispatched; WidgetCompositionEvent compEvent(true, NS_COMPOSITION_START, @@ -1129,7 +1129,7 @@ nsGtkIMModule::DispatchCompositionStart(GtkIMContext* aContext) mLastFocusedWindow->DispatchEvent(&compEvent, status); if (static_cast(kungFuDeathGrip.get())->IsDestroyed() || kungFuDeathGrip != mLastFocusedWindow) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" NOTE, the focused widget was destroyed/changed by compositionstart event")); return false; } @@ -1142,18 +1142,18 @@ nsGtkIMModule::DispatchCompositionChangeEvent( GtkIMContext* aContext, const nsAString& aCompositionString) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): DispatchCompositionChangeEvent, aContext=%p", this, aContext)); if (!mLastFocusedWindow) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, there are no focused window in this module")); return false; } if (!IsComposing()) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" The composition wasn't started, force starting...")); nsCOMPtr kungFuDeathGrip = mLastFocusedWindow; if (!DispatchCompositionStart(aContext)) { @@ -1197,7 +1197,7 @@ nsGtkIMModule::DispatchCompositionChangeEvent( mLastFocusedWindow->DispatchEvent(&compositionChangeEvent, status); if (lastFocusedWindow->IsDestroyed() || lastFocusedWindow != mLastFocusedWindow) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" NOTE, the focused widget was destroyed/changed by " "compositionchange event")); return false; @@ -1216,26 +1216,26 @@ nsGtkIMModule::DispatchCompositionCommitEvent( GtkIMContext* aContext, const nsAString* aCommitString) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): DispatchCompositionCommitEvent, aContext=%p, " "aCommitString=%p, (\"%s\")", this, aContext, aCommitString, aCommitString ? NS_ConvertUTF16toUTF8(*aCommitString).get() : "")); if (!mLastFocusedWindow) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, there are no focused window in this module")); return false; } if (!IsComposing()) { if (!aCommitString || aCommitString->IsEmpty()) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, there is no composition and empty commit " "string")); return true; } - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" The composition wasn't started, force starting...")); nsCOMPtr kungFuDeathGrip(mLastFocusedWindow); if (!DispatchCompositionStart(aContext)) { @@ -1264,7 +1264,7 @@ nsGtkIMModule::DispatchCompositionCommitEvent( if (lastFocusedWindow->IsDestroyed() || lastFocusedWindow != mLastFocusedWindow) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" NOTE, the focused widget was destroyed/changed by " "compositioncommit event")); return false; @@ -1277,7 +1277,7 @@ already_AddRefed nsGtkIMModule::CreateTextRangeArray(GtkIMContext* aContext, const nsAString& aLastDispatchedData) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): CreateTextRangeArray, aContext=%p, " "aLastDispatchedData=\"%s\" (length=%u)", this, aContext, NS_ConvertUTF16toUTF8(aLastDispatchedData).get(), @@ -1291,7 +1291,7 @@ nsGtkIMModule::CreateTextRangeArray(GtkIMContext* aContext, gtk_im_context_get_preedit_string(aContext, &preedit_string, &feedback_list, &cursor_pos); if (!preedit_string || !*preedit_string) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" preedit_string is null")); pango_attr_list_unref(feedback_list); g_free(preedit_string); @@ -1301,7 +1301,7 @@ nsGtkIMModule::CreateTextRangeArray(GtkIMContext* aContext, PangoAttrIterator* iter; iter = pango_attr_list_get_iterator(feedback_list); if (!iter) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, iterator couldn't be allocated")); pango_attr_list_unref(feedback_list); g_free(preedit_string); @@ -1373,7 +1373,7 @@ nsGtkIMModule::CreateTextRangeArray(GtkIMContext* aContext, textRangeArray->AppendElement(range); - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" mStartOffset=%u, mEndOffset=%u, mRangeType=%s", range.mStartOffset, range.mEndOffset, GetRangeTypeName(range.mRangeType))); @@ -1391,7 +1391,7 @@ nsGtkIMModule::CreateTextRangeArray(GtkIMContext* aContext, range.mRangeType = NS_TEXTRANGE_CARETPOSITION; textRangeArray->AppendElement(range); - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" mStartOffset=%u, mEndOffset=%u, mRangeType=%s", range.mStartOffset, range.mEndOffset, GetRangeTypeName(range.mRangeType))); @@ -1407,24 +1407,24 @@ void nsGtkIMModule::SetCursorPosition(GtkIMContext* aContext, uint32_t aTargetOffset) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): SetCursorPosition, aContext=%p, aTargetOffset=%u", this, aContext, aTargetOffset)); if (aTargetOffset == UINT32_MAX) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, aTargetOffset is wrong offset")); return; } if (!mLastFocusedWindow) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, there are no focused window")); return; } if (MOZ_UNLIKELY(!aContext)) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, there are no context")); return; } @@ -1436,7 +1436,7 @@ nsGtkIMModule::SetCursorPosition(GtkIMContext* aContext, nsEventStatus status; mLastFocusedWindow->DispatchEvent(&charRect, status); if (!charRect.mSucceeded) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, NS_QUERY_TEXT_RECT was failed")); return; } @@ -1464,12 +1464,12 @@ nsGtkIMModule::SetCursorPosition(GtkIMContext* aContext, nsresult nsGtkIMModule::GetCurrentParagraph(nsAString& aText, uint32_t& aCursorPos) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): GetCurrentParagraph, mCompositionState=%s", this, GetCompositionStateName())); if (!mLastFocusedWindow) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, there are no focused window in this module")); return NS_ERROR_NULL_POINTER; } @@ -1493,7 +1493,7 @@ nsGtkIMModule::GetCurrentParagraph(nsAString& aText, uint32_t& aCursorPos) selLength = querySelectedTextEvent.mReply.mString.Length(); } - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" selOffset=%u, selLength=%u", selOffset, selLength)); @@ -1502,7 +1502,7 @@ nsGtkIMModule::GetCurrentParagraph(nsAString& aText, uint32_t& aCursorPos) // than INT32_MAX. if (selOffset > INT32_MAX || selLength > INT32_MAX || selOffset + selLength > INT32_MAX) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, The selection is out of range")); return NS_ERROR_FAILURE; } @@ -1517,7 +1517,7 @@ nsGtkIMModule::GetCurrentParagraph(nsAString& aText, uint32_t& aCursorPos) nsAutoString textContent(queryTextContentEvent.mReply.mString); if (selOffset + selLength > textContent.Length()) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, The selection is invalid, textContent.Length()=%u", textContent.Length())); return NS_ERROR_FAILURE; @@ -1542,7 +1542,7 @@ nsGtkIMModule::GetCurrentParagraph(nsAString& aText, uint32_t& aCursorPos) aText = nsDependentSubstring(textContent, parStart, parEnd - parStart); aCursorPos = selOffset - uint32_t(parStart); - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" aText=%s, aText.Length()=%u, aCursorPos=%u", NS_ConvertUTF16toUTF8(aText).get(), aText.Length(), aCursorPos)); @@ -1555,19 +1555,19 @@ nsGtkIMModule::DeleteText(GtkIMContext* aContext, int32_t aOffset, uint32_t aNChars) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): DeleteText, aContext=%p, aOffset=%d, aNChars=%d, " "mCompositionState=%s", this, aContext, aOffset, aNChars, GetCompositionStateName())); if (!mLastFocusedWindow) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, there are no focused window in this module")); return NS_ERROR_NULL_POINTER; } if (!aNChars) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, aNChars must not be zero")); return NS_ERROR_INVALID_ARG; } @@ -1583,7 +1583,7 @@ nsGtkIMModule::DeleteText(GtkIMContext* aContext, if (wasComposing) { selOffset = mCompositionStart; if (!DispatchCompositionCommitEvent(aContext, &mSelectedString)) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, quitting from DeletText")); return NS_ERROR_FAILURE; } @@ -1606,7 +1606,7 @@ nsGtkIMModule::DeleteText(GtkIMContext* aContext, mLastFocusedWindow->DispatchEvent(&queryTextContentEvent, status); NS_ENSURE_TRUE(queryTextContentEvent.mSucceeded, NS_ERROR_FAILURE); if (queryTextContentEvent.mReply.mString.IsEmpty()) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, there is no contents")); return NS_ERROR_FAILURE; } @@ -1617,7 +1617,7 @@ nsGtkIMModule::DeleteText(GtkIMContext* aContext, glong offsetInUTF8Characters = g_utf8_strlen(utf8Str.get(), utf8Str.Length()) + aOffset; if (offsetInUTF8Characters < 0) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, aOffset is too small for current cursor pos " "(computed offset: %d)", offsetInUTF8Characters)); @@ -1632,7 +1632,7 @@ nsGtkIMModule::DeleteText(GtkIMContext* aContext, glong endInUTF8Characters = offsetInUTF8Characters + aNChars; if (countOfCharactersInUTF8 < endInUTF8Characters) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, aNChars is too large for current contents " "(content length: %d, computed end offset: %d)", countOfCharactersInUTF8, endInUTF8Characters)); @@ -1666,7 +1666,7 @@ nsGtkIMModule::DeleteText(GtkIMContext* aContext, if (!selectionEvent.mSucceeded || lastFocusedWindow != mLastFocusedWindow || lastFocusedWindow->Destroyed()) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, setting selection caused focus change " "or window destroyed")); return NS_ERROR_FAILURE; @@ -1681,7 +1681,7 @@ nsGtkIMModule::DeleteText(GtkIMContext* aContext, if (!contentCommandEvent.mSucceeded || lastFocusedWindow != mLastFocusedWindow || lastFocusedWindow->Destroyed()) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, deleting the selection caused focus change " "or window destroyed")); return NS_ERROR_FAILURE; @@ -1693,7 +1693,7 @@ nsGtkIMModule::DeleteText(GtkIMContext* aContext, // Restore the composition at new caret position. if (!DispatchCompositionStart(aContext)) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, resterting composition start")); return NS_ERROR_FAILURE; } @@ -1705,7 +1705,7 @@ nsGtkIMModule::DeleteText(GtkIMContext* aContext, nsAutoString compositionString; GetCompositionString(aContext, compositionString); if (!DispatchCompositionChangeEvent(aContext, compositionString)) { - MOZ_LOG(gGtkIMLog, LogLevel::Info, + MOZ_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, restoring composition string")); return NS_ERROR_FAILURE; } diff --git a/widget/gtk/nsGtkKeyUtils.cpp b/widget/gtk/nsGtkKeyUtils.cpp index 62de89f19818..9b7be1d95e91 100644 --- a/widget/gtk/nsGtkKeyUtils.cpp +++ b/widget/gtk/nsGtkKeyUtils.cpp @@ -156,7 +156,7 @@ KeymapWrapper::KeymapWrapper() : if (!gKeymapWrapperLog) { gKeymapWrapperLog = PR_NewLogModule("KeymapWrapperWidgets"); } - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): Constructor, mGdkKeymap=%p", this, mGdkKeymap)); @@ -181,7 +181,7 @@ KeymapWrapper::Init() } mInitialized = true; - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): Init, mGdkKeymap=%p", this, mGdkKeymap)); @@ -193,7 +193,7 @@ KeymapWrapper::Init() gdk_window_add_filter(nullptr, FilterEvents, this); - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): Init, CapsLock=0x%X, NumLock=0x%X, " "ScrollLock=0x%X, Level3=0x%X, Level5=0x%X, " "Shift=0x%X, Ctrl=0x%X, Alt=0x%X, Meta=0x%X, Super=0x%X, Hyper=0x%X", @@ -214,7 +214,7 @@ KeymapWrapper::InitXKBExtension() int xkbMajorVer = XkbMajorVersion; int xkbMinorVer = XkbMinorVersion; if (!XkbLibraryVersion(&xkbMajorVer, &xkbMinorVer)) { - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): InitXKBExtension failed due to failure of " "XkbLibraryVersion()", this)); return; @@ -232,7 +232,7 @@ KeymapWrapper::InitXKBExtension() int opcode, baseErrorCode; if (!XkbQueryExtension(display, &opcode, &mXKBBaseEventCode, &baseErrorCode, &xkbMajorVer, &xkbMinorVer)) { - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): InitXKBExtension failed due to failure of " "XkbQueryExtension(), display=0x%p", this, display)); return; @@ -240,7 +240,7 @@ KeymapWrapper::InitXKBExtension() if (!XkbSelectEventDetails(display, XkbUseCoreKbd, XkbStateNotify, XkbModifierStateMask, XkbModifierStateMask)) { - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): InitXKBExtension failed due to failure of " "XkbSelectEventDetails() for XModifierStateMask, display=0x%p", this, display)); @@ -249,7 +249,7 @@ KeymapWrapper::InitXKBExtension() if (!XkbSelectEventDetails(display, XkbUseCoreKbd, XkbControlsNotify, XkbPerKeyRepeatMask, XkbPerKeyRepeatMask)) { - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): InitXKBExtension failed due to failure of " "XkbSelectEventDetails() for XkbControlsNotify, display=0x%p", this, display)); @@ -257,21 +257,21 @@ KeymapWrapper::InitXKBExtension() } if (!XGetKeyboardControl(display, &mKeyboardState)) { - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): InitXKBExtension failed due to failure of " "XGetKeyboardControl(), display=0x%p", this, display)); return; } - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): InitXKBExtension, Succeeded", this)); } void KeymapWrapper::InitBySystemSettings() { - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): InitBySystemSettings, mGdkKeymap=%p", this, mGdkKeymap)); @@ -287,7 +287,7 @@ KeymapWrapper::InitBySystemSettings() max_keycode - min_keycode + 1, &keysyms_per_keycode); if (!xkeymap) { - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): InitBySystemSettings, " "Failed due to null xkeymap", this)); return; @@ -295,13 +295,13 @@ KeymapWrapper::InitBySystemSettings() XModifierKeymap* xmodmap = XGetModifierMapping(display); if (!xmodmap) { - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): InitBySystemSettings, " "Failed due to null xmodmap", this)); XFree(xkeymap); return; } - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): InitBySystemSettings, min_keycode=%d, " "max_keycode=%d, keysyms_per_keycode=%d, max_keypermod=%d", this, min_keycode, max_keycode, keysyms_per_keycode, @@ -328,7 +328,7 @@ KeymapWrapper::InitBySystemSettings() const uint32_t map_size = 8 * xmodmap->max_keypermod; for (uint32_t i = 0; i < map_size; i++) { KeyCode keycode = xmodmap->modifiermap[i]; - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): InitBySystemSettings, " " i=%d, keycode=0x%08X", this, i, keycode)); @@ -355,7 +355,7 @@ KeymapWrapper::InitBySystemSettings() const int32_t modIndex = bit - 3; for (int32_t j = 0; j < keysyms_per_keycode; j++) { Modifier modifier = GetModifierForGDKKeyval(syms[j]); - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): InitBySystemSettings, " " Mod%d, j=%d, syms[j]=%s(0x%X), modifier=%s", this, modIndex + 1, j, gdk_keyval_name(syms[j]), syms[j], @@ -437,7 +437,7 @@ KeymapWrapper::~KeymapWrapper() { gdk_window_remove_filter(nullptr, FilterEvents, this); NS_IF_RELEASE(sBidiKeyboard); - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): Destructor", this)); } @@ -500,7 +500,7 @@ KeymapWrapper::FilterEvents(GdkXEvent* aXEvent, } if (!XGetKeyboardControl(xkbEvent->any.display, &self->mKeyboardState)) { - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): FilterEvents failed due to failure " "of XGetKeyboardControl(), display=0x%p", self, xkbEvent->any.display)); @@ -516,7 +516,7 @@ KeymapWrapper::FilterEvents(GdkXEvent* aXEvent, KeymapWrapper::OnDestroyKeymap(KeymapWrapper* aKeymapWrapper, GdkKeymap *aGdkKeymap) { - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper: OnDestroyKeymap, aGdkKeymap=%p, aKeymapWrapper=%p", aGdkKeymap, aKeymapWrapper)); MOZ_ASSERT(aKeymapWrapper == sInstance, @@ -529,7 +529,7 @@ KeymapWrapper::OnDestroyKeymap(KeymapWrapper* aKeymapWrapper, KeymapWrapper::OnKeysChanged(GdkKeymap *aGdkKeymap, KeymapWrapper* aKeymapWrapper) { - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper: OnKeysChanged, aGdkKeymap=%p, aKeymapWrapper=%p", aGdkKeymap, aKeymapWrapper)); @@ -624,7 +624,7 @@ KeymapWrapper::InitInputEvent(WidgetInputEvent& aInputEvent, aInputEvent.modifiers |= MODIFIER_SCROLLLOCK; } - MOZ_LOG(gKeymapWrapperLog, LogLevel::Debug, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_DEBUG, ("KeymapWrapper(%p): InitInputEvent, aModifierState=0x%08X, " "aInputEvent.modifiers=0x%04X (Shift: %s, Control: %s, Alt: %s, " "Meta: %s, OS: %s, AltGr: %s, " @@ -663,7 +663,7 @@ KeymapWrapper::InitInputEvent(WidgetInputEvent& aInputEvent, mouseEvent.buttons |= WidgetMouseEvent::eMiddleButtonFlag; } - MOZ_LOG(gKeymapWrapperLog, LogLevel::Debug, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_DEBUG, ("KeymapWrapper(%p): InitInputEvent, aInputEvent has buttons, " "aInputEvent.buttons=0x%04X (Left: %s, Right: %s, Middle: %s, " "4th (BACK): %s, 5th (FORWARD): %s)", @@ -973,7 +973,7 @@ KeymapWrapper::InitKeyEvent(WidgetKeyboardEvent& aKeyEvent, break; } - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): InitKeyEvent, modifierState=0x%08X " "aGdkKeyEvent={ type=%s, keyval=%s(0x%X), state=0x%08X, " "hardware_keycode=0x%08X, is_modifier=%s } " @@ -1330,7 +1330,7 @@ KeymapWrapper::InitKeypressEvent(WidgetKeyboardEvent& aKeyEvent, aKeyEvent.charCode = GetCharCodeFor(aGdkKeyEvent); if (!aKeyEvent.charCode) { - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): InitKeypressEvent, " "keyCode=0x%02X, charCode=0x%08X", this, aKeyEvent.keyCode, aKeyEvent.charCode)); @@ -1345,7 +1345,7 @@ KeymapWrapper::InitKeypressEvent(WidgetKeyboardEvent& aKeyEvent, // work. if (!aKeyEvent.IsControl() && !aKeyEvent.IsAlt() && !aKeyEvent.IsMeta() && !aKeyEvent.IsOS()) { - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): InitKeypressEvent, " "keyCode=0x%02X, charCode=0x%08X", this, aKeyEvent.keyCode, aKeyEvent.charCode)); @@ -1354,7 +1354,7 @@ KeymapWrapper::InitKeypressEvent(WidgetKeyboardEvent& aKeyEvent, gint level = GetKeyLevel(aGdkKeyEvent); if (level != 0 && level != 1) { - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): InitKeypressEvent, " "keyCode=0x%02X, charCode=0x%08X, level=%d", this, aKeyEvent.keyCode, aKeyEvent.charCode, level)); @@ -1394,7 +1394,7 @@ KeymapWrapper::InitKeypressEvent(WidgetKeyboardEvent& aKeyEvent, // If current keyboard layout can input Latin characters, we don't need // more information. if (!needLatinKeyCodes) { - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): InitKeypressEvent, keyCode=0x%02X, " "charCode=0x%08X, level=%d, altCharCodes={ " "mUnshiftedCharCode=0x%08X, mShiftedCharCode=0x%08X }", @@ -1406,7 +1406,7 @@ KeymapWrapper::InitKeypressEvent(WidgetKeyboardEvent& aKeyEvent, // Next, find Latin inputtable keyboard layout. gint minGroup = GetFirstLatinGroup(); if (minGroup < 0) { - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): InitKeypressEvent, " "Latin keyboard layout isn't found: " "keyCode=0x%02X, charCode=0x%08X, level=%d, " @@ -1447,7 +1447,7 @@ KeymapWrapper::InitKeypressEvent(WidgetKeyboardEvent& aKeyEvent, aKeyEvent.charCode = ch; } - MOZ_LOG(gKeymapWrapperLog, LogLevel::Info, + MOZ_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): InitKeypressEvent, " "keyCode=0x%02X, charCode=0x%08X, level=%d, minGroup=%d, " "altCharCodes={ mUnshiftedCharCode=0x%08X, " diff --git a/widget/gtk/nsIdleServiceGTK.cpp b/widget/gtk/nsIdleServiceGTK.cpp index 1c42a2f6ed48..98b23f3a33bc 100644 --- a/widget/gtk/nsIdleServiceGTK.cpp +++ b/widget/gtk/nsIdleServiceGTK.cpp @@ -39,7 +39,7 @@ static void Initialize() PRLibrary* xsslib = PR_LoadLibrary("libXss.so.1"); if (!xsslib) // ouch. { - MOZ_LOG(sIdleLog, LogLevel::Warning, ("Failed to find libXss.so!\n")); + MOZ_LOG(sIdleLog, PR_LOG_WARNING, ("Failed to find libXss.so!\n")); return; } @@ -51,11 +51,11 @@ static void Initialize() PR_FindFunctionSymbol(xsslib, "XScreenSaverQueryInfo"); if (!_XSSQueryExtension) - MOZ_LOG(sIdleLog, LogLevel::Warning, ("Failed to get XSSQueryExtension!\n")); + MOZ_LOG(sIdleLog, PR_LOG_WARNING, ("Failed to get XSSQueryExtension!\n")); if (!_XSSAllocInfo) - MOZ_LOG(sIdleLog, LogLevel::Warning, ("Failed to get XSSAllocInfo!\n")); + MOZ_LOG(sIdleLog, PR_LOG_WARNING, ("Failed to get XSSAllocInfo!\n")); if (!_XSSQueryInfo) - MOZ_LOG(sIdleLog, LogLevel::Warning, ("Failed to get XSSQueryInfo!\n")); + MOZ_LOG(sIdleLog, PR_LOG_WARNING, ("Failed to get XSSQueryInfo!\n")); sInitialized = true; } @@ -99,7 +99,7 @@ nsIdleServiceGTK::PollIdleTime(uint32_t *aIdleTime) // We might not have a display (cf. in xpcshell) Display *dplay = GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); if (!dplay) { - MOZ_LOG(sIdleLog, LogLevel::Warning, ("No display found!\n")); + MOZ_LOG(sIdleLog, PR_LOG_WARNING, ("No display found!\n")); return false; } @@ -119,7 +119,7 @@ nsIdleServiceGTK::PollIdleTime(uint32_t *aIdleTime) return true; } // If we get here, we couldn't get to XScreenSaver: - MOZ_LOG(sIdleLog, LogLevel::Warning, ("XSSQueryExtension returned false!\n")); + MOZ_LOG(sIdleLog, PR_LOG_WARNING, ("XSSQueryExtension returned false!\n")); return false; } diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h index 8f89777e63b6..179cdbeaaea2 100644 --- a/widget/gtk/nsWindow.h +++ b/widget/gtk/nsWindow.h @@ -45,10 +45,10 @@ extern PRLogModuleInfo *gWidgetFocusLog; extern PRLogModuleInfo *gWidgetDragLog; extern PRLogModuleInfo *gWidgetDrawLog; -#define LOG(args) MOZ_LOG(gWidgetLog, mozilla::LogLevel::Debug, args) -#define LOGFOCUS(args) MOZ_LOG(gWidgetFocusLog, mozilla::LogLevel::Debug, args) -#define LOGDRAG(args) MOZ_LOG(gWidgetDragLog, mozilla::LogLevel::Debug, args) -#define LOGDRAW(args) MOZ_LOG(gWidgetDrawLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gWidgetLog, 4, args) +#define LOGFOCUS(args) MOZ_LOG(gWidgetFocusLog, 4, args) +#define LOGDRAG(args) MOZ_LOG(gWidgetDragLog, 4, args) +#define LOGDRAW(args) MOZ_LOG(gWidgetDrawLog, 4, args) #else diff --git a/widget/nsIdleService.cpp b/widget/nsIdleService.cpp index 9f97f5c75f00..97dd5cc9b4f8 100644 --- a/widget/nsIdleService.cpp +++ b/widget/nsIdleService.cpp @@ -72,7 +72,7 @@ nsIdleServiceDaily::Observe(nsISupports *, const char *aTopic, const char16_t *) { - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("nsIdleServiceDaily: Observe '%s' (%d)", aTopic, mShutdownInProgress)); @@ -92,7 +92,7 @@ nsIdleServiceDaily::Observe(nsISupports *, } MOZ_ASSERT(strcmp(aTopic, OBSERVER_TOPIC_IDLE) == 0); - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("nsIdleServiceDaily: Notifying idle-daily observers")); #ifdef MOZ_WIDGET_ANDROID __android_log_print(LOG_LEVEL, LOG_TAG, @@ -128,7 +128,7 @@ nsIdleServiceDaily::Observe(nsISupports *, prefs->SavePrefFile(nullptr); } - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("nsIdleServiceDaily: Storing last idle time as %d sec.", nowSec)); #ifdef MOZ_WIDGET_ANDROID __android_log_print(LOG_LEVEL, LOG_TAG, @@ -139,7 +139,7 @@ nsIdleServiceDaily::Observe(nsISupports *, mExpectedTriggerTime = PR_Now() + ((PRTime)SECONDS_PER_DAY * (PRTime)PR_USEC_PER_SEC); - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("nsIdleServiceDaily: Restarting daily timer")); // Start timer for the next check in one day. @@ -177,7 +177,7 @@ nsIdleServiceDaily::Init() } int32_t secondsSinceLastDaily = nowSec - lastDaily; - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("nsIdleServiceDaily: Init: seconds since last daily: %d", secondsSinceLastDaily)); @@ -188,7 +188,7 @@ nsIdleServiceDaily::Init() bool hasBeenLongWait = (lastDaily && (secondsSinceLastDaily > (SECONDS_PER_DAY * 2))); - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("nsIdleServiceDaily: has been long wait? %d", hasBeenLongWait)); @@ -196,7 +196,7 @@ nsIdleServiceDaily::Init() // sends the idle-daily event. StageIdleDaily(hasBeenLongWait); } else { - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("nsIdleServiceDaily: Setting timer a day from now")); #ifdef MOZ_WIDGET_ANDROID __android_log_print(LOG_LEVEL, LOG_TAG, @@ -208,7 +208,7 @@ nsIdleServiceDaily::Init() int32_t milliSecLeftUntilDaily = (SECONDS_PER_DAY - secondsSinceLastDaily) * PR_MSEC_PER_SEC; - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("nsIdleServiceDaily: Seconds till next timeout: %d", (SECONDS_PER_DAY - secondsSinceLastDaily))); @@ -227,7 +227,7 @@ nsIdleServiceDaily::Init() // Register for when we should terminate/pause nsCOMPtr obs = mozilla::services::GetObserverService(); if (obs) { - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("nsIdleServiceDaily: Registering for system event observers.")); obs->AddObserver(this, "xpcom-will-shutdown", true); obs->AddObserver(this, "profile-change-teardown", true); @@ -248,7 +248,7 @@ void nsIdleServiceDaily::StageIdleDaily(bool aHasBeenLongWait) { NS_ASSERTION(mIdleService, "No idle service available?"); - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("nsIdleServiceDaily: Registering Idle observer callback " "(short wait requested? %d)", aHasBeenLongWait)); #ifdef MOZ_WIDGET_ANDROID @@ -265,7 +265,7 @@ nsIdleServiceDaily::StageIdleDaily(bool aHasBeenLongWait) void nsIdleServiceDaily::DailyCallback(nsITimer* aTimer, void* aClosure) { - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("nsIdleServiceDaily: DailyCallback running")); #ifdef MOZ_WIDGET_ANDROID __android_log_print(LOG_LEVEL, LOG_TAG, @@ -284,7 +284,7 @@ nsIdleServiceDaily::DailyCallback(nsITimer* aTimer, void* aClosure) // Add 10 ms to ensure we don't undershoot, and never get a "0" timer. delayTime += 10 * PR_USEC_PER_MSEC; - MOZ_LOG(sLog, LogLevel::Debug, ("nsIdleServiceDaily: DailyCallback resetting timer to %lld msec", + MOZ_LOG(sLog, PR_LOG_DEBUG, ("nsIdleServiceDaily: DailyCallback resetting timer to %lld msec", delayTime / PR_USEC_PER_MSEC)); #ifdef MOZ_WIDGET_ANDROID __android_log_print(LOG_LEVEL, LOG_TAG, @@ -431,7 +431,7 @@ nsIdleService::AddIdleObserver(nsIObserver* aObserver, uint32_t aIdleTimeInS) return NS_OK; } - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("idleService: Register idle observer %p for %d seconds", aObserver, aIdleTimeInS)); #ifdef MOZ_WIDGET_ANDROID @@ -459,7 +459,7 @@ nsIdleService::AddIdleObserver(nsIObserver* aObserver, uint32_t aIdleTimeInS) if (mDeltaToNextIdleSwitchInS > aIdleTimeInS) { // If it is, then this is the next to move to idle (at this point we // don't care if it should have switched already). - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("idleService: Register: adjusting next switch from %d to %d seconds", mDeltaToNextIdleSwitchInS, aIdleTimeInS)); #ifdef MOZ_WIDGET_ANDROID @@ -501,7 +501,7 @@ nsIdleService::RemoveIdleObserver(nsIObserver* aObserver, uint32_t aTimeInS) if (mArrayListeners.ElementAt(listenerIndex).isIdle) mIdleObserverCount--; mArrayListeners.RemoveElementAt(listenerIndex); - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("idleService: Remove observer %p (%d seconds), %d remain idle", aObserver, aTimeInS, mIdleObserverCount)); #ifdef MOZ_WIDGET_ANDROID @@ -513,7 +513,7 @@ nsIdleService::RemoveIdleObserver(nsIObserver* aObserver, uint32_t aTimeInS) } // If we get here, we haven't removed anything: - MOZ_LOG(sLog, LogLevel::Warning, + MOZ_LOG(sLog, PR_LOG_WARNING, ("idleService: Failed to remove idle observer %p (%d seconds)", aObserver, aTimeInS)); #ifdef MOZ_WIDGET_ANDROID @@ -527,7 +527,7 @@ nsIdleService::RemoveIdleObserver(nsIObserver* aObserver, uint32_t aTimeInS) NS_IMETHODIMP nsIdleService::ResetIdleTimeOut(uint32_t idleDeltaInMS) { - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("idleService: Reset idle timeout (last interaction %u msec)", idleDeltaInMS)); @@ -537,7 +537,7 @@ nsIdleService::ResetIdleTimeOut(uint32_t idleDeltaInMS) // If no one is idle, then we are done, any existing timers can keep running. if (mIdleObserverCount == 0) { - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("idleService: Reset idle timeout: no idle observers")); return NS_OK; } @@ -587,7 +587,7 @@ nsIdleService::ResetIdleTimeOut(uint32_t idleDeltaInMS) // Send the "non-idle" events. while (numberOfPendingNotifications--) { - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("idleService: Reset idle timeout: tell observer %p user is back", notifyList[numberOfPendingNotifications])); #ifdef MOZ_WIDGET_ANDROID @@ -615,7 +615,7 @@ nsIdleService::GetIdleTime(uint32_t* idleTime) bool polledIdleTimeIsValid = PollIdleTime(&polledIdleTimeMS); - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("idleService: Get idle time: polled %u msec, valid = %d", polledIdleTimeMS, polledIdleTimeIsValid)); @@ -623,7 +623,7 @@ nsIdleService::GetIdleTime(uint32_t* idleTime) TimeDuration timeSinceReset = TimeStamp::Now() - mLastUserInteraction; uint32_t timeSinceResetInMS = timeSinceReset.ToMilliseconds(); - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("idleService: Get idle time: time since reset %u msec", timeSinceResetInMS)); #ifdef MOZ_WIDGET_ANDROID @@ -679,7 +679,7 @@ nsIdleService::IdleTimerCallback(void) uint32_t currentIdleTimeInMS; if (NS_FAILED(GetIdleTime(¤tIdleTimeInMS))) { - MOZ_LOG(sLog, LogLevel::Info, + MOZ_LOG(sLog, PR_LOG_ALWAYS, ("idleService: Idle timer callback: failed to get idle time")); #ifdef MOZ_WIDGET_ANDROID __android_log_print(LOG_LEVEL, LOG_TAG, @@ -688,7 +688,7 @@ nsIdleService::IdleTimerCallback(void) return; } - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("idleService: Idle timer callback: current idle time %u msec", currentIdleTimeInMS)); #ifdef MOZ_WIDGET_ANDROID @@ -760,7 +760,7 @@ nsIdleService::IdleTimerCallback(void) // Bail if nothing to do. if (!numberOfPendingNotifications) { - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("idleService: **** Idle timer callback: no observers to message.")); return; } @@ -771,7 +771,7 @@ nsIdleService::IdleTimerCallback(void) // Notify all listeners that just timed out. while (numberOfPendingNotifications--) { - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("idleService: **** Idle timer callback: tell observer %p user is idle", notifyList[numberOfPendingNotifications])); #ifdef MOZ_WIDGET_ANDROID @@ -790,7 +790,7 @@ nsIdleService::SetTimerExpiryIfBefore(TimeStamp aNextTimeout) { TimeDuration nextTimeoutDuration = aNextTimeout - TimeStamp::Now(); - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("idleService: SetTimerExpiryIfBefore: next timeout %0.f msec from now", nextTimeoutDuration.ToMilliseconds())); @@ -825,7 +825,7 @@ nsIdleService::SetTimerExpiryIfBefore(TimeStamp aNextTimeout) mCurrentlySetToTimeoutAt += TimeDuration::FromMilliseconds(10); TimeDuration deltaTime = mCurrentlySetToTimeoutAt - currentTime; - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("idleService: IdleService reset timer expiry to %0.f msec from now", deltaTime.ToMilliseconds())); #ifdef MOZ_WIDGET_ANDROID @@ -850,7 +850,7 @@ nsIdleService::ReconfigureTimer(void) if ((mIdleObserverCount == 0) && UINT32_MAX == mDeltaToNextIdleSwitchInS) { // If not, just let any existing timers run to completion // And bail out. - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("idleService: ReconfigureTimer: no idle or waiting observers")); #ifdef MOZ_WIDGET_ANDROID __android_log_print(LOG_LEVEL, LOG_TAG, @@ -870,7 +870,7 @@ nsIdleService::ReconfigureTimer(void) TimeDuration nextTimeoutDuration = nextTimeoutAt - curTime; - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("idleService: next timeout %0.f msec from now", nextTimeoutDuration.ToMilliseconds())); @@ -886,7 +886,7 @@ nsIdleService::ReconfigureTimer(void) curTime + TimeDuration::FromMilliseconds(MIN_IDLE_POLL_INTERVAL_MSEC); if (nextTimeoutAt > pollTimeout) { - MOZ_LOG(sLog, LogLevel::Debug, + MOZ_LOG(sLog, PR_LOG_DEBUG, ("idleService: idle observers, reducing timeout to %lu msec from now", MIN_IDLE_POLL_INTERVAL_MSEC)); #ifdef MOZ_WIDGET_ANDROID diff --git a/widget/qt/nsDeviceContextSpecQt.cpp b/widget/qt/nsDeviceContextSpecQt.cpp index 7d3f5bccaf8e..3cc8dc78045a 100644 --- a/widget/qt/nsDeviceContextSpecQt.cpp +++ b/widget/qt/nsDeviceContextSpecQt.cpp @@ -35,7 +35,7 @@ static PRLogModuleInfo* DeviceContextSpecQtLM = PR_NewLogModule("DeviceContextSpecQt"); /* Macro to make lines shorter */ -#define DO_PR_DEBUG_LOG(x) MOZ_LOG(DeviceContextSpecQtLM, mozilla::LogLevel::Debug, x) +#define DO_PR_DEBUG_LOG(x) MOZ_LOG(DeviceContextSpecQtLM, PR_LOG_DEBUG, x) nsDeviceContextSpecQt::nsDeviceContextSpecQt() { diff --git a/widget/qt/nsWindow.h b/widget/qt/nsWindow.h index d38ddd5a2801..bbc59655023f 100644 --- a/widget/qt/nsWindow.h +++ b/widget/qt/nsWindow.h @@ -29,10 +29,10 @@ extern PRLogModuleInfo *gWidgetFocusLog; extern PRLogModuleInfo *gWidgetIMLog; extern PRLogModuleInfo *gWidgetDrawLog; -#define LOG(args) MOZ_LOG(gWidgetLog, mozilla::LogLevel::Debug, args) -#define LOGFOCUS(args) MOZ_LOG(gWidgetFocusLog, mozilla::LogLevel::Debug, args) -#define LOGIM(args) MOZ_LOG(gWidgetIMLog, mozilla::LogLevel::Debug, args) -#define LOGDRAW(args) MOZ_LOG(gWidgetDrawLog, mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(gWidgetLog, 4, args) +#define LOGFOCUS(args) MOZ_LOG(gWidgetFocusLog, 4, args) +#define LOGIM(args) MOZ_LOG(gWidgetIMLog, 4, args) +#define LOGDRAW(args) MOZ_LOG(gWidgetDrawLog, 4, args) #else diff --git a/widget/windows/KeyboardLayout.cpp b/widget/windows/KeyboardLayout.cpp index 244c7d9ef7e0..77f7e468d31a 100644 --- a/widget/windows/KeyboardLayout.cpp +++ b/widget/windows/KeyboardLayout.cpp @@ -2540,11 +2540,11 @@ KeyboardLayout::LoadLayout(HKL aLayout) ::SetKeyboardState(originalKbdState); - if (MOZ_LOG_TEST(sKeyboardLayoutLogger, LogLevel::Debug)) { + if (PR_LOG_TEST(sKeyboardLayoutLogger, PR_LOG_DEBUG)) { static const UINT kExtendedScanCode[] = { 0x0000, 0xE000 }; static const UINT kMapType = IsVistaOrLater() ? MAPVK_VSC_TO_VK_EX : MAPVK_VSC_TO_VK; - MOZ_LOG(sKeyboardLayoutLogger, LogLevel::Debug, + MOZ_LOG(sKeyboardLayoutLogger, PR_LOG_DEBUG, ("Logging virtual keycode values for scancode (0x%p)...", mKeyboardLayout)); for (uint32_t i = 0; i < ArrayLength(kExtendedScanCode); i++) { @@ -2552,7 +2552,7 @@ KeyboardLayout::LoadLayout(HKL aLayout) UINT scanCode = kExtendedScanCode[i] + j; UINT virtualKeyCode = ::MapVirtualKeyEx(scanCode, kMapType, mKeyboardLayout); - MOZ_LOG(sKeyboardLayoutLogger, LogLevel::Debug, + MOZ_LOG(sKeyboardLayoutLogger, PR_LOG_DEBUG, ("0x%04X, %s", scanCode, kVirtualKeyName[virtualKeyCode])); } // XP and Server 2003 don't support 0xE0 prefix of the scancode. diff --git a/widget/windows/WinMouseScrollHandler.cpp b/widget/windows/WinMouseScrollHandler.cpp index d777313ed0cb..3ac09fee5f1c 100644 --- a/widget/windows/WinMouseScrollHandler.cpp +++ b/widget/windows/WinMouseScrollHandler.cpp @@ -36,14 +36,14 @@ static const char* GetBoolName(bool aBool) static void LogKeyStateImpl() { - if (!MOZ_LOG_TEST(gMouseScrollLog, LogLevel::Debug)) { + if (!PR_LOG_TEST(gMouseScrollLog, PR_LOG_DEBUG)) { return; } BYTE keyboardState[256]; if (::GetKeyboardState(keyboardState)) { for (size_t i = 0; i < ArrayLength(keyboardState); i++) { if (keyboardState[i]) { - MOZ_LOG(gMouseScrollLog, LogLevel::Debug, + MOZ_LOG(gMouseScrollLog, PR_LOG_DEBUG, (" Current key state: keyboardState[0x%02X]=0x%02X (%s)", i, keyboardState[i], ((keyboardState[i] & 0x81) == 0x81) ? "Pressed and Toggled" : @@ -52,7 +52,7 @@ static void LogKeyStateImpl() } } } else { - MOZ_LOG(gMouseScrollLog, LogLevel::Debug, + MOZ_LOG(gMouseScrollLog, PR_LOG_DEBUG, ("MouseScroll::Device::Elantech::HandleKeyMessage(): Failed to print " "current keyboard state")); } @@ -127,14 +127,14 @@ MouseScrollHandler::MouseScrollHandler() : mIsWaitingInternalMessage(false), mSynthesizingEvent(nullptr) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll: Creating an instance, this=%p, sInstance=%p", this, sInstance)); } MouseScrollHandler::~MouseScrollHandler() { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll: Destroying an instance, this=%p, sInstance=%p", this, sInstance)); @@ -221,7 +221,7 @@ MouseScrollHandler::ProcessMessage(nsWindowBase* aWidget, UINT msg, case WM_KEYDOWN: case WM_KEYUP: - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::ProcessMessage(): aWidget=%p, " "msg=%s(0x%04X), wParam=0x%02X, ::GetMessageTime()=%d", aWidget, msg == WM_KEYDOWN ? "WM_KEYDOWN" : @@ -360,7 +360,7 @@ MouseScrollHandler::ComputeMessagePos(UINT aMessage, POINT point; if (Device::SetPoint::IsGetMessagePosResponseValid(aMessage, aWParam, aLParam)) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::ComputeMessagePos: Using ::GetCursorPos()")); ::GetCursorPos(&point); } else { @@ -384,7 +384,7 @@ MouseScrollHandler::ProcessNativeMouseWheelMessage(nsWindowBase* aWidget, POINT point = ComputeMessagePos(aMessage, aWParam, aLParam); - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::ProcessNativeMouseWheelMessage: aWidget=%p, " "aMessage=%s, wParam=0x%08X, lParam=0x%08X, point: { x=%d, y=%d }", aWidget, aMessage == WM_MOUSEWHEEL ? "WM_MOUSEWHEEL" : @@ -395,7 +395,7 @@ MouseScrollHandler::ProcessNativeMouseWheelMessage(nsWindowBase* aWidget, HWND underCursorWnd = ::WindowFromPoint(point); if (!underCursorWnd) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::ProcessNativeMouseWheelMessage: " "No window is not found under the cursor")); return; @@ -409,7 +409,7 @@ MouseScrollHandler::ProcessNativeMouseWheelMessage(nsWindowBase* aWidget, // be beneath the cursor if that window wasn't there. underCursorWnd = WinUtils::FindOurWindowAtPoint(point); if (!underCursorWnd) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::ProcessNativeMouseWheelMessage: " "Our window is not found under the Elantech helper window")); return; @@ -422,7 +422,7 @@ MouseScrollHandler::ProcessNativeMouseWheelMessage(nsWindowBase* aWidget, if (WinUtils::IsOurProcessWindow(underCursorWnd)) { nsWindowBase* destWindow = WinUtils::GetNSWindowBasePtr(underCursorWnd); if (!destWindow) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::ProcessNativeMouseWheelMessage: " "Found window under the cursor isn't managed by nsWindow...")); HWND wnd = ::GetParent(underCursorWnd); @@ -433,7 +433,7 @@ MouseScrollHandler::ProcessNativeMouseWheelMessage(nsWindowBase* aWidget, } } if (!wnd) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::ProcessNativeMouseWheelMessage: Our window which is " "managed by nsWindow is not found under the cursor")); return; @@ -450,13 +450,13 @@ MouseScrollHandler::ProcessNativeMouseWheelMessage(nsWindowBase* aWidget, if (destWindow->IsPlugin()) { destWindow = destWindow->GetParentWindowBase(false); if (!destWindow) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::ProcessNativeMouseWheelMessage: " "Our window which is a parent of a plugin window is not found")); return; } } - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::ProcessNativeMouseWheelMessage: Succeeded, " "Posting internal message to an nsWindow (%p)...", destWindow)); @@ -475,7 +475,7 @@ MouseScrollHandler::ProcessNativeMouseWheelMessage(nsWindowBase* aWidget, // If there is no plugin window in ancestors of the window under cursor, // the window is for another applications (case 2). // We don't need to handle this message. - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::ProcessNativeMouseWheelMessage: " "Our window is not found under the cursor")); return; @@ -490,12 +490,12 @@ MouseScrollHandler::ProcessNativeMouseWheelMessage(nsWindowBase* aWidget, aWidget->GetWindowHandle() == pluginWnd) { nsWindowBase* destWindow = aWidget->GetParentWindowBase(false); if (!destWindow) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::ProcessNativeMouseWheelMessage: Our normal window which " "is a parent of this plugin window is not found")); return; } - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::ProcessNativeMouseWheelMessage: Succeeded, " "Posting internal message to an nsWindow (%p) which is parent of this " "plugin window...", @@ -508,7 +508,7 @@ MouseScrollHandler::ProcessNativeMouseWheelMessage(nsWindowBase* aWidget, } // If the window is a part of plugin, we should post the message to it. - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::ProcessNativeMouseWheelMessage: Succeeded, " "Redirecting the message to a window which is a plugin child window")); ::PostMessage(underCursorWnd, aMessage, aWParam, aLParam); @@ -534,7 +534,7 @@ MouseScrollHandler::ProcessNativeScrollMessage(nsWindowBase* aWidget, aWParam, aLParam); } - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::ProcessNativeScrollMessage: aWidget=%p, " "aMessage=%s, wParam=0x%08X, lParam=0x%08X", aWidget, aMessage == WM_VSCROLL ? "WM_VSCROLL" : "WM_HSCROLL", @@ -597,7 +597,7 @@ MouseScrollHandler::HandleMouseWheelMessage(nsWindowBase* aWidget, "HandleMouseWheelMessage must be called with " "MOZ_WM_MOUSEVWHEEL or MOZ_WM_MOUSEHWHEEL"); - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::HandleMouseWheelMessage: aWidget=%p, " "aMessage=MOZ_WM_MOUSE%sWHEEL, aWParam=0x%08X, aLParam=0x%08X", aWidget, aMessage == MOZ_WM_MOUSEVWHEEL ? "V" : "H", @@ -608,7 +608,7 @@ MouseScrollHandler::HandleMouseWheelMessage(nsWindowBase* aWidget, EventInfo eventInfo(aWidget, WinUtils::GetNativeMessage(aMessage), aWParam, aLParam); if (!eventInfo.CanDispatchWheelEvent()) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::HandleMouseWheelMessage: Cannot dispatch the events")); mLastEventInfo.ResetTransaction(); return; @@ -630,12 +630,12 @@ MouseScrollHandler::HandleMouseWheelMessage(nsWindowBase* aWidget, WidgetWheelEvent wheelEvent(true, NS_WHEEL_WHEEL, aWidget); if (mLastEventInfo.InitWheelEvent(aWidget, wheelEvent, modKeyState)) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::HandleMouseWheelMessage: dispatching " "NS_WHEEL_WHEEL event")); aWidget->DispatchWheelEvent(&wheelEvent); if (aWidget->Destroyed()) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::HandleMouseWheelMessage: The window was destroyed " "by NS_WHEEL_WHEEL event")); mLastEventInfo.ResetTransaction(); @@ -643,7 +643,7 @@ MouseScrollHandler::HandleMouseWheelMessage(nsWindowBase* aWidget, } } else { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::HandleMouseWheelMessage: NS_WHEEL_WHEEL event is not " "dispatched")); } @@ -698,7 +698,7 @@ MouseScrollHandler::HandleScrollMessageAsMouseWheelMessage(nsWindowBase* aWidget // the original message was received. InitEvent(aWidget, wheelEvent); - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::HandleScrollMessageAsMouseWheelMessage: aWidget=%p, " "aMessage=MOZ_WM_%sSCROLL, aWParam=0x%08X, aLParam=0x%08X, " "wheelEvent { refPoint: { x: %d, y: %d }, deltaX: %f, deltaY: %f, " @@ -791,7 +791,7 @@ MouseScrollHandler::LastEventInfo::ResetTransaction() return; } - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::LastEventInfo::ResetTransaction()")); mWnd = nullptr; @@ -853,7 +853,7 @@ MouseScrollHandler::LastEventInfo::InitWheelEvent( mAccumulatedDelta -= lineOrPageDelta * orienter * RoundDelta(nativeDeltaPerUnit); - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::LastEventInfo::InitWheelEvent: aWidget=%p, " "aWheelEvent { refPoint: { x: %d, y: %d }, deltaX: %f, deltaY: %f, " "lineOrPageDeltaX: %d, lineOrPageDeltaY: %d, " @@ -891,20 +891,20 @@ MouseScrollHandler::SystemSettings::Init() mScrollLines = userPrefs.GetOverriddenVerticalScrollAmout(); if (mScrollLines >= 0) { // overridden by the pref. - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::SystemSettings::Init(): mScrollLines is overridden by " "the pref: %d", mScrollLines)); } else if (!::SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &mScrollLines, 0)) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::SystemSettings::Init(): ::SystemParametersInfo(" "SPI_GETWHEELSCROLLLINES) failed")); mScrollLines = 3; } if (mScrollLines > WHEEL_DELTA) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::SystemSettings::Init(): the result of " "::SystemParametersInfo(SPI_GETWHEELSCROLLLINES) is too large: %d", mScrollLines)); @@ -920,13 +920,13 @@ MouseScrollHandler::SystemSettings::Init() mScrollChars = userPrefs.GetOverriddenHorizontalScrollAmout(); if (mScrollChars >= 0) { // overridden by the pref. - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::SystemSettings::Init(): mScrollChars is overridden by " "the pref: %d", mScrollChars)); } else if (!::SystemParametersInfo(SPI_GETWHEELSCROLLCHARS, 0, &mScrollChars, 0)) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::SystemSettings::Init(): ::SystemParametersInfo(" "SPI_GETWHEELSCROLLCHARS) failed, %s", IsVistaOrLater() ? @@ -936,7 +936,7 @@ MouseScrollHandler::SystemSettings::Init() } if (mScrollChars > WHEEL_DELTA) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::SystemSettings::Init(): the result of " "::SystemParametersInfo(SPI_GETWHEELSCROLLCHARS) is too large: %d", mScrollChars)); @@ -944,7 +944,7 @@ MouseScrollHandler::SystemSettings::Init() mScrollChars = WHEEL_PAGESCROLL; } - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::SystemSettings::Init(): initialized, " "mScrollLines=%d, mScrollChars=%d", mScrollLines, mScrollChars)); @@ -953,7 +953,7 @@ MouseScrollHandler::SystemSettings::Init() void MouseScrollHandler::SystemSettings::MarkDirty() { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScrollHandler::SystemSettings::MarkDirty(): " "Marking SystemSettings dirty")); mInitialized = false; @@ -1007,7 +1007,7 @@ MouseScrollHandler::UserPrefs::Init() Preferences::GetInt("mousewheel.windows.transaction.timeout", DEFAULT_TIMEOUT_DURATION); - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::UserPrefs::Init(): initialized, " "mScrollMessageHandledAsWheelMessage=%s, " "mOverriddenVerticalScrollAmount=%d, " @@ -1021,7 +1021,7 @@ MouseScrollHandler::UserPrefs::Init() void MouseScrollHandler::UserPrefs::MarkDirty() { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScrollHandler::UserPrefs::MarkDirty(): Marking UserPrefs dirty")); mInitialized = false; // Some prefs might override system settings, so, we should mark them dirty. @@ -1045,21 +1045,21 @@ MouseScrollHandler::Device::GetWorkaroundPref(const char* aPrefName, bool aValueIfAutomatic) { if (!aPrefName) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::Device::GetWorkaroundPref(): Failed, aPrefName is NULL")); return aValueIfAutomatic; } int32_t lHackValue = 0; if (NS_FAILED(Preferences::GetInt(aPrefName, &lHackValue))) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::Device::GetWorkaroundPref(): Preferences::GetInt() failed," " aPrefName=\"%s\", aValueIfAutomatic=%s", aPrefName, GetBoolName(aValueIfAutomatic))); return aValueIfAutomatic; } - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::Device::GetWorkaroundPref(): Succeeded, " "aPrefName=\"%s\", aValueIfAutomatic=%s, lHackValue=%d", aPrefName, GetBoolName(aValueIfAutomatic), lHackValue)); @@ -1083,7 +1083,7 @@ MouseScrollHandler::Device::Init() (TrackPoint::IsDriverInstalled() || UltraNav::IsObsoleteDriverInstalled())); - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::Device::Init(): sFakeScrollableWindowNeeded=%s", GetBoolName(sFakeScrollableWindowNeeded))); @@ -1107,7 +1107,7 @@ MouseScrollHandler::Device::Elantech::Init() sUseSwipeHack = needsHack && version <= 7; sUsePinchHack = needsHack && version <= 8; - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::Device::Elantech::Init(): version=%d, sUseSwipeHack=%s, " "sUsePinchHack=%s", version, GetBoolName(sUseSwipeHack), GetBoolName(sUsePinchHack))); @@ -1211,7 +1211,7 @@ MouseScrollHandler::Device::Elantech::HandleKeyMessage(nsWindowBase* aWidget, (aWParam == VK_NEXT || aWParam == VK_PRIOR) && (IS_VK_DOWN(0xFF) || IS_VK_DOWN(0xCC))) { if (aMsg == WM_KEYDOWN) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::Device::Elantech::HandleKeyMessage(): Dispatching " "%s command event", aWParam == VK_NEXT ? "Forward" : "Back")); @@ -1222,7 +1222,7 @@ MouseScrollHandler::Device::Elantech::HandleKeyMessage(nsWindowBase* aWidget, aWidget->DispatchWindowEvent(&commandEvent); } else { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::Device::Elantech::HandleKeyMessage(): Consumed")); } return true; // consume the message (doesn't need to dispatch key events) @@ -1250,7 +1250,7 @@ MouseScrollHandler::Device::Elantech::HandleKeyMessage(nsWindowBase* aWidget, // that are more easily comparable. sZoomUntil = ::GetTickCount() & 0x7FFFFFFF; - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::Device::Elantech::HandleKeyMessage(): sZoomUntil=%d", sZoomUntil)); } @@ -1281,7 +1281,7 @@ MouseScrollHandler::Device::Elantech::UpdateZoomUntil() (sZoomUntil < DWORD(msgTime))) { sZoomUntil = 0; - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::Device::Elantech::UpdateZoomUntil(): " "sZoomUntil was reset")); } @@ -1309,7 +1309,7 @@ MouseScrollHandler::Device::TrackPoint::IsDriverInstalled() { if (WinUtils::HasRegistryKey(HKEY_CURRENT_USER, L"Software\\Lenovo\\TrackPoint")) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::Device::TrackPoint::IsDriverInstalled(): " "Lenovo's TrackPoint driver is found")); return true; @@ -1317,7 +1317,7 @@ MouseScrollHandler::Device::TrackPoint::IsDriverInstalled() if (WinUtils::HasRegistryKey(HKEY_CURRENT_USER, L"Software\\Alps\\Apoint\\TrackPoint")) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::Device::TrackPoint::IsDriverInstalled(): " "Alps's TrackPoint driver is found")); } @@ -1337,7 +1337,7 @@ MouseScrollHandler::Device::UltraNav::IsObsoleteDriverInstalled() { if (WinUtils::HasRegistryKey(HKEY_CURRENT_USER, L"Software\\Lenovo\\UltraNav")) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::Device::UltraNav::IsObsoleteDriverInstalled(): " "Lenovo's UltraNav driver is found")); return true; @@ -1346,13 +1346,13 @@ MouseScrollHandler::Device::UltraNav::IsObsoleteDriverInstalled() bool installed = false; if (WinUtils::HasRegistryKey(HKEY_CURRENT_USER, L"Software\\Synaptics\\SynTPEnh\\UltraNavUSB")) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::Device::UltraNav::IsObsoleteDriverInstalled(): " "Synaptics's UltraNav (USB) driver is found")); installed = true; } else if (WinUtils::HasRegistryKey(HKEY_CURRENT_USER, L"Software\\Synaptics\\SynTPEnh\\UltraNavPS2")) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::Device::UltraNav::IsObsoleteDriverInstalled(): " "Synaptics's UltraNav (PS/2) driver is found")); installed = true; @@ -1369,7 +1369,7 @@ MouseScrollHandler::Device::UltraNav::IsObsoleteDriverInstalled() L"DriverVersion", buf, sizeof buf); if (!foundKey) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::Device::UltraNav::IsObsoleteDriverInstalled(): " "Failed to get UltraNav driver version")); return false; @@ -1381,7 +1381,7 @@ MouseScrollHandler::Device::UltraNav::IsObsoleteDriverInstalled() if (p) { minorVersion = wcstol(p + 1, nullptr, 10); } - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::Device::UltraNav::IsObsoleteDriverInstalled(): " "found driver version = %d.%d", majorVersion, minorVersion)); @@ -1421,14 +1421,14 @@ MouseScrollHandler::Device::SetPoint::IsGetMessagePosResponseValid( if (!sMightBeUsing && !aLParam && aLParam != messagePos && ::InSendMessage()) { sMightBeUsing = true; - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::Device::SetPoint::IsGetMessagePosResponseValid(): " "Might using SetPoint")); } else if (sMightBeUsing && aLParam != 0 && ::InSendMessage()) { // The user has changed the mouse from Logitech's to another one (e.g., // the user has changed to the touchpad of the notebook. sMightBeUsing = false; - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::Device::SetPoint::IsGetMessagePosResponseValid(): " "Might stop using SetPoint")); } @@ -1459,7 +1459,7 @@ MouseScrollHandler::SynthesizingEvent::Synthesize(const POINTS& aCursorPoint, LPARAM aLParam, const BYTE (&aKeyStates)[256]) { - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScrollHandler::SynthesizingEvent::Synthesize(): aCursorPoint: { " "x: %d, y: %d }, aWnd=0x%X, aMessage=0x%04X, aWParam=0x%08X, " "aLParam=0x%08X, IsSynthesized()=%s, mStatus=%s", @@ -1515,7 +1515,7 @@ MouseScrollHandler::SynthesizingEvent::NativeMessageReceived(nsWindowBase* aWidg // Otherwise, the message may not be sent by us. } - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScrollHandler::SynthesizingEvent::NativeMessageReceived(): " "aWidget=%p, aWidget->GetWindowHandle()=0x%X, mWnd=0x%X, " "aMessage=0x%04X, aWParam=0x%08X, aLParam=0x%08X, mStatus=%s", @@ -1535,7 +1535,7 @@ MouseScrollHandler::SynthesizingEvent::NotifyNativeMessageHandlingFinished() return; } - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScrollHandler::SynthesizingEvent::" "NotifyNativeMessageHandlingFinished(): IsWaitingInternalMessage=%s", GetBoolName(MouseScrollHandler::IsWaitingInternalMessage()))); @@ -1558,7 +1558,7 @@ MouseScrollHandler::SynthesizingEvent::NotifyInternalMessageHandlingFinished() return; } - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScrollHandler::SynthesizingEvent::" "NotifyInternalMessageHandlingFinished()")); @@ -1572,7 +1572,7 @@ MouseScrollHandler::SynthesizingEvent::Finish() return; } - MOZ_LOG(gMouseScrollLog, LogLevel::Info, + MOZ_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScrollHandler::SynthesizingEvent::Finish()")); // Restore the original key state. diff --git a/widget/windows/WinUtils.cpp b/widget/windows/WinUtils.cpp index 4bd2ecfe4326..37f198da15d0 100644 --- a/widget/windows/WinUtils.cpp +++ b/widget/windows/WinUtils.cpp @@ -484,7 +484,7 @@ WinUtils::LogW(const wchar_t *fmt, ...) printf("%s\n", utf8); NS_ASSERTION(gWindowsLog, "Called WinUtils Log() but Widget " "log module doesn't exist!"); - MOZ_LOG(gWindowsLog, LogLevel::Error, (utf8)); + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, (utf8)); } delete[] utf8; } @@ -518,7 +518,7 @@ WinUtils::Log(const char *fmt, ...) NS_ASSERTION(gWindowsLog, "Called WinUtils Log() but Widget " "log module doesn't exist!"); - MOZ_LOG(gWindowsLog, LogLevel::Error, (buffer)); + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, (buffer)); delete[] buffer; } diff --git a/widget/windows/nsClipboard.cpp b/widget/windows/nsClipboard.cpp index 2561bf1348f4..8bd434765b12 100644 --- a/widget/windows/nsClipboard.cpp +++ b/widget/windows/nsClipboard.cpp @@ -34,8 +34,6 @@ #include "nsEscape.h" #include "nsIObserverService.h" -using mozilla::LogLevel; - PRLogModuleInfo* gWin32ClipboardLog = nullptr; // oddly, this isn't in the MSVC headers anywhere. @@ -338,39 +336,39 @@ static void DisplayErrCode(HRESULT hres) { #if defined(DEBUG_rods) || defined(DEBUG_pinkerton) if (hres == E_INVALIDARG) { - MOZ_LOG(gWin32ClipboardLog, LogLevel::Info, ("E_INVALIDARG\n")); + MOZ_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("E_INVALIDARG\n")); } else if (hres == E_UNEXPECTED) { - MOZ_LOG(gWin32ClipboardLog, LogLevel::Info, ("E_UNEXPECTED\n")); + MOZ_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("E_UNEXPECTED\n")); } else if (hres == E_OUTOFMEMORY) { - MOZ_LOG(gWin32ClipboardLog, LogLevel::Info, ("E_OUTOFMEMORY\n")); + MOZ_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("E_OUTOFMEMORY\n")); } else if (hres == DV_E_LINDEX ) { - MOZ_LOG(gWin32ClipboardLog, LogLevel::Info, ("DV_E_LINDEX\n")); + MOZ_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("DV_E_LINDEX\n")); } else if (hres == DV_E_FORMATETC) { - MOZ_LOG(gWin32ClipboardLog, LogLevel::Info, ("DV_E_FORMATETC\n")); + MOZ_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("DV_E_FORMATETC\n")); } else if (hres == DV_E_TYMED) { - MOZ_LOG(gWin32ClipboardLog, LogLevel::Info, ("DV_E_TYMED\n")); + MOZ_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("DV_E_TYMED\n")); } else if (hres == DV_E_DVASPECT) { - MOZ_LOG(gWin32ClipboardLog, LogLevel::Info, ("DV_E_DVASPECT\n")); + MOZ_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("DV_E_DVASPECT\n")); } else if (hres == OLE_E_NOTRUNNING) { - MOZ_LOG(gWin32ClipboardLog, LogLevel::Info, ("OLE_E_NOTRUNNING\n")); + MOZ_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("OLE_E_NOTRUNNING\n")); } else if (hres == STG_E_MEDIUMFULL) { - MOZ_LOG(gWin32ClipboardLog, LogLevel::Info, ("STG_E_MEDIUMFULL\n")); + MOZ_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("STG_E_MEDIUMFULL\n")); } else if (hres == DV_E_CLIPFORMAT) { - MOZ_LOG(gWin32ClipboardLog, LogLevel::Info, ("DV_E_CLIPFORMAT\n")); + MOZ_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("DV_E_CLIPFORMAT\n")); } else if (hres == S_OK) { - MOZ_LOG(gWin32ClipboardLog, LogLevel::Info, ("S_OK\n")); + MOZ_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("S_OK\n")); } else { - MOZ_LOG(gWin32ClipboardLog, LogLevel::Info, + MOZ_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("****** DisplayErrCode 0x%X\n", hres)); } #endif @@ -548,7 +546,7 @@ nsresult nsClipboard::GetNativeDataOffClipboard(IDataObject * aDataObject, UINT case TYMED_GDI: { #ifdef DEBUG - MOZ_LOG(gWin32ClipboardLog, LogLevel::Info, + MOZ_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("*********************** TYMED_GDI\n")); #endif } break; diff --git a/widget/windows/nsDataObj.cpp b/widget/windows/nsDataObj.cpp index 0dedaac15985..07d652492f13 100644 --- a/widget/windows/nsDataObj.cpp +++ b/widget/windows/nsDataObj.cpp @@ -546,7 +546,7 @@ STDMETHODIMP nsDataObj::GetData(LPFORMATETC aFormat, LPSTGMEDIUM pSTM) return GetFileContents ( *aFormat, *pSTM ); if ( format == PreferredDropEffect ) return GetPreferredDropEffect( *aFormat, *pSTM ); - //MOZ_LOG(gWindowsLog, LogLevel::Info, + //MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, // ("***** nsDataObj::GetData - Unknown format %u\n", format)); return GetText(df, *aFormat, *pSTM); } //switch diff --git a/widget/windows/nsDeviceContextSpecWin.cpp b/widget/windows/nsDeviceContextSpecWin.cpp index 2489efba3e03..d4dcd387c3df 100644 --- a/widget/windows/nsDeviceContextSpecWin.cpp +++ b/widget/windows/nsDeviceContextSpecWin.cpp @@ -43,7 +43,7 @@ #include "mozilla/Logging.h" PRLogModuleInfo * kWidgetPrintingLogMod = PR_NewLogModule("printing-widget"); -#define PR_PL(_p1) MOZ_LOG(kWidgetPrintingLogMod, mozilla::LogLevel::Debug, _p1) +#define PR_PL(_p1) MOZ_LOG(kWidgetPrintingLogMod, PR_LOG_DEBUG, _p1) using namespace mozilla; diff --git a/widget/windows/nsIMM32Handler.cpp b/widget/windows/nsIMM32Handler.cpp index f214e72b1520..d3f0cd5679a0 100644 --- a/widget/windows/nsIMM32Handler.cpp +++ b/widget/windows/nsIMM32Handler.cpp @@ -279,7 +279,7 @@ nsIMM32Handler::InitKeyboardLayout(nsWindow* aWindow, MaybeAdjustCompositionFont(aWindow, sWritingModeOfCompositionFont, true); } - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: InitKeyboardLayout, aKeyboardLayout=%08x (\"%s\"), sCodePage=%lu, " "sIMEProperty=%s, sIMEUIProperty=%s", aKeyboardLayout, NS_ConvertUTF16toUTF8(sIMEName).get(), @@ -316,16 +316,16 @@ nsIMM32Handler::nsIMM32Handler() : mIsComposing(false), mIsComposingOnPlugin(false), mNativeCaretIsCreated(false) { - MOZ_LOG(gIMM32Log, LogLevel::Info, ("IMM32: nsIMM32Handler is created\n")); + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: nsIMM32Handler is created\n")); } nsIMM32Handler::~nsIMM32Handler() { if (mIsComposing) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: ~nsIMM32Handler, ERROR, the instance is still composing\n")); } - MOZ_LOG(gIMM32Log, LogLevel::Info, ("IMM32: nsIMM32Handler is destroyed\n")); + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: nsIMM32Handler is destroyed\n")); } nsresult @@ -347,7 +347,7 @@ nsIMM32Handler::EnsureAttributeArray(int32_t aCount) /* static */ void nsIMM32Handler::CommitComposition(nsWindow* aWindow, bool aForce) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: CommitComposition, aForce=%s, aWindow=%p, hWnd=%08x, mComposingWindow=%p%s\n", aForce ? "TRUE" : "FALSE", aWindow, aWindow->GetWindowHandle(), @@ -361,7 +361,7 @@ nsIMM32Handler::CommitComposition(nsWindow* aWindow, bool aForce) nsIMEContext IMEContext(aWindow->GetWindowHandle()); bool associated = IMEContext.AssociateDefaultContext(); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: CommitComposition, associated=%s\n", associated ? "YES" : "NO")); @@ -378,7 +378,7 @@ nsIMM32Handler::CommitComposition(nsWindow* aWindow, bool aForce) /* static */ void nsIMM32Handler::CancelComposition(nsWindow* aWindow, bool aForce) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: CancelComposition, aForce=%s, aWindow=%p, hWnd=%08x, mComposingWindow=%p%s\n", aForce ? "TRUE" : "FALSE", aWindow, aWindow->GetWindowHandle(), @@ -392,7 +392,7 @@ nsIMM32Handler::CancelComposition(nsWindow* aWindow, bool aForce) nsIMEContext IMEContext(aWindow->GetWindowHandle()); bool associated = IMEContext.AssociateDefaultContext(); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: CancelComposition, associated=%s\n", associated ? "YES" : "NO")); @@ -589,7 +589,7 @@ nsIMM32Handler::OnInputLangChange(nsWindow* aWindow, LPARAM lParam, MSGResult& aResult) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnInputLangChange, hWnd=%08x, wParam=%08x, lParam=%08x\n", aWindow->GetWindowHandle(), wParam, lParam)); @@ -607,7 +607,7 @@ bool nsIMM32Handler::OnIMEStartComposition(nsWindow* aWindow, MSGResult& aResult) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMEStartComposition, hWnd=%08x, mIsComposing=%s\n", aWindow->GetWindowHandle(), mIsComposing ? "TRUE" : "FALSE")); aResult.mConsumed = ShouldDrawCompositionStringOurselves(); @@ -627,10 +627,10 @@ nsIMM32Handler::OnIMEComposition(nsWindow* aWindow, LPARAM lParam, MSGResult& aResult) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMEComposition, hWnd=%08x, lParam=%08x, mIsComposing=%s\n", aWindow->GetWindowHandle(), lParam, mIsComposing ? "TRUE" : "FALSE")); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMEComposition, GCS_RESULTSTR=%s, GCS_COMPSTR=%s, GCS_COMPATTR=%s, GCS_COMPCLAUSE=%s, GCS_CURSORPOS=%s\n", lParam & GCS_RESULTSTR ? "YES" : "no", lParam & GCS_COMPSTR ? "YES" : "no", @@ -650,7 +650,7 @@ bool nsIMM32Handler::OnIMEEndComposition(nsWindow* aWindow, MSGResult& aResult) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMEEndComposition, hWnd=%08x, mIsComposing=%s\n", aWindow->GetWindowHandle(), mIsComposing ? "TRUE" : "FALSE")); @@ -668,7 +668,7 @@ nsIMM32Handler::OnIMEEndComposition(nsWindow* aWindow, PM_NOREMOVE) && compositionMsg.message == WM_IME_COMPOSITION && IS_COMMITTING_LPARAM(compositionMsg.lParam)) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMEEndComposition, WM_IME_ENDCOMPOSITION is followed by " "WM_IME_COMPOSITION, ignoring the message...")); return true; @@ -680,7 +680,7 @@ nsIMM32Handler::OnIMEEndComposition(nsWindow* aWindow, // event and a compositionend event. // XXX Shouldn't we dispatch the compositionchange event with actual or // latest composition string? - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMEEndComposition, mCompositionString=\"%s\"%s", NS_ConvertUTF16toUTF8(mCompositionString).get(), mCompositionString.IsEmpty() ? "" : ", but canceling it...")); @@ -696,7 +696,7 @@ nsIMM32Handler::OnIMEChar(nsWindow* aWindow, LPARAM lParam, MSGResult& aResult) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMEChar, hWnd=%08x, char=%08x\n", aWindow->GetWindowHandle(), wParam)); @@ -714,7 +714,7 @@ nsIMM32Handler::OnIMEChar(nsWindow* aWindow, nsIMM32Handler::OnIMECompositionFull(nsWindow* aWindow, MSGResult& aResult) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMECompositionFull, hWnd=%08x\n", aWindow->GetWindowHandle())); @@ -731,72 +731,72 @@ nsIMM32Handler::OnIMENotify(nsWindow* aWindow, { switch (wParam) { case IMN_CHANGECANDIDATE: - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMENotify, hWnd=%08x, IMN_CHANGECANDIDATE, lParam=%08x\n", aWindow->GetWindowHandle(), lParam)); break; case IMN_CLOSECANDIDATE: - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMENotify, hWnd=%08x, IMN_CLOSECANDIDATE, lParam=%08x\n", aWindow->GetWindowHandle(), lParam)); break; case IMN_CLOSESTATUSWINDOW: - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMENotify, hWnd=%08x, IMN_CLOSESTATUSWINDOW\n", aWindow->GetWindowHandle())); break; case IMN_GUIDELINE: - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMENotify, hWnd=%08x, IMN_GUIDELINE\n", aWindow->GetWindowHandle())); break; case IMN_OPENCANDIDATE: - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMENotify, hWnd=%08x, IMN_OPENCANDIDATE, lParam=%08x\n", aWindow->GetWindowHandle(), lParam)); break; case IMN_OPENSTATUSWINDOW: - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMENotify, hWnd=%08x, IMN_OPENSTATUSWINDOW\n", aWindow->GetWindowHandle())); break; case IMN_SETCANDIDATEPOS: - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMENotify, hWnd=%08x, IMN_SETCANDIDATEPOS, lParam=%08x\n", aWindow->GetWindowHandle(), lParam)); break; case IMN_SETCOMPOSITIONFONT: - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMENotify, hWnd=%08x, IMN_SETCOMPOSITIONFONT\n", aWindow->GetWindowHandle())); break; case IMN_SETCOMPOSITIONWINDOW: - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMENotify, hWnd=%08x, IMN_SETCOMPOSITIONWINDOW\n", aWindow->GetWindowHandle())); break; case IMN_SETCONVERSIONMODE: - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMENotify, hWnd=%08x, IMN_SETCONVERSIONMODE\n", aWindow->GetWindowHandle())); break; case IMN_SETOPENSTATUS: - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMENotify, hWnd=%08x, IMN_SETOPENSTATUS\n", aWindow->GetWindowHandle())); break; case IMN_SETSENTENCEMODE: - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMENotify, hWnd=%08x, IMN_SETSENTENCEMODE\n", aWindow->GetWindowHandle())); break; case IMN_SETSTATUSWINDOWPOS: - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMENotify, hWnd=%08x, IMN_SETSTATUSWINDOWPOS\n", aWindow->GetWindowHandle())); break; case IMN_PRIVATE: - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMENotify, hWnd=%08x, IMN_PRIVATE\n", aWindow->GetWindowHandle())); break; @@ -815,26 +815,26 @@ nsIMM32Handler::OnIMERequest(nsWindow* aWindow, { switch (wParam) { case IMR_RECONVERTSTRING: - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMERequest, hWnd=%08x, IMR_RECONVERTSTRING\n", aWindow->GetWindowHandle())); aResult.mConsumed = HandleReconvert(aWindow, lParam, &aResult.mResult); return true; case IMR_QUERYCHARPOSITION: - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMERequest, hWnd=%08x, IMR_QUERYCHARPOSITION\n", aWindow->GetWindowHandle())); aResult.mConsumed = HandleQueryCharPosition(aWindow, lParam, &aResult.mResult); return true; case IMR_DOCUMENTFEED: - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMERequest, hWnd=%08x, IMR_DOCUMENTFEED\n", aWindow->GetWindowHandle())); aResult.mConsumed = HandleDocumentFeed(aWindow, lParam, &aResult.mResult); return true; default: - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMERequest, hWnd=%08x, wParam=%08x\n", aWindow->GetWindowHandle(), wParam)); aResult.mConsumed = false; @@ -848,7 +848,7 @@ nsIMM32Handler::OnIMESelect(nsWindow* aWindow, LPARAM lParam, MSGResult& aResult) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMESelect, hWnd=%08x, wParam=%08x, lParam=%08x\n", aWindow->GetWindowHandle(), wParam, lParam)); @@ -863,7 +863,7 @@ nsIMM32Handler::OnIMESetContext(nsWindow* aWindow, LPARAM lParam, MSGResult& aResult) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMESetContext, hWnd=%08x, %s, lParam=%08x\n", aWindow->GetWindowHandle(), wParam ? "Active" : "Deactive", lParam)); @@ -877,7 +877,7 @@ nsIMM32Handler::OnIMESetContext(nsWindow* aWindow, // The top level window never becomes composing window, so, we can ignore // the WM_IME_SETCONTEXT on the top level window. if (IsTopLevelWindowOfComposition(aWindow)) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMESetContext, hWnd=%08x is top level window\n")); return true; } @@ -892,7 +892,7 @@ nsIMM32Handler::OnIMESetContext(nsWindow* aWindow, if (wParam && (lParam & ISC_SHOWUICOMPOSITIONWINDOW) && ShouldDrawCompositionStringOurselves()) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMESetContext, ISC_SHOWUICOMPOSITIONWINDOW is removed\n")); lParam &= ~ISC_SHOWUICOMPOSITIONWINDOW; } @@ -929,10 +929,10 @@ nsIMM32Handler::OnChar(nsWindow* aWindow, WPARAM recWParam; LPARAM recLParam; DequeueIMECharRecords(recWParam, recLParam); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnChar, aWindow=%p, wParam=%08x, lParam=%08x,\n", aWindow->GetWindowHandle(), wParam, lParam)); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, (" recorded: wParam=%08x, lParam=%08x\n", recWParam, recLParam)); // If an unexpected char message comes, we should reset the records, @@ -958,7 +958,7 @@ nsIMM32Handler::OnIMEStartCompositionOnPlugin(nsWindow* aWindow, LPARAM lParam, MSGResult& aResult) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMEStartCompositionOnPlugin, hWnd=%08x, mIsComposingOnPlugin=%s\n", aWindow->GetWindowHandle(), mIsComposingOnPlugin ? "TRUE" : "FALSE")); mIsComposingOnPlugin = true; @@ -980,11 +980,11 @@ nsIMM32Handler::OnIMECompositionOnPlugin(nsWindow* aWindow, LPARAM lParam, MSGResult& aResult) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMECompositionOnPlugin, hWnd=%08x, lParam=%08x, mIsComposingOnPlugin=%s\n", aWindow->GetWindowHandle(), lParam, mIsComposingOnPlugin ? "TRUE" : "FALSE")); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMECompositionOnPlugin, GCS_RESULTSTR=%s, GCS_COMPSTR=%s, GCS_COMPATTR=%s, GCS_COMPCLAUSE=%s, GCS_CURSORPOS=%s\n", lParam & GCS_RESULTSTR ? "YES" : "no", lParam & GCS_COMPSTR ? "YES" : "no", @@ -1014,7 +1014,7 @@ nsIMM32Handler::OnIMEEndCompositionOnPlugin(nsWindow* aWindow, LPARAM lParam, MSGResult& aResult) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMEEndCompositionOnPlugin, hWnd=%08x, mIsComposingOnPlugin=%s\n", aWindow->GetWindowHandle(), mIsComposingOnPlugin ? "TRUE" : "FALSE")); @@ -1038,7 +1038,7 @@ nsIMM32Handler::OnIMECharOnPlugin(nsWindow* aWindow, LPARAM lParam, MSGResult& aResult) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMECharOnPlugin, hWnd=%08x, char=%08x, scancode=%08x\n", aWindow->GetWindowHandle(), wParam, lParam)); @@ -1059,7 +1059,7 @@ nsIMM32Handler::OnIMESetContextOnPlugin(nsWindow* aWindow, LPARAM lParam, MSGResult& aResult) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMESetContextOnPlugin, hWnd=%08x, %s, lParam=%08x\n", aWindow->GetWindowHandle(), wParam ? "Active" : "Deactive", lParam)); @@ -1106,10 +1106,10 @@ nsIMM32Handler::OnCharOnPlugin(nsWindow* aWindow, WPARAM recWParam; LPARAM recLParam; DequeueIMECharRecords(recWParam, recLParam); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnCharOnPlugin, aWindow=%p, wParam=%08x, lParam=%08x,\n", aWindow->GetWindowHandle(), wParam, lParam)); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, (" recorded: wParam=%08x, lParam=%08x\n", recWParam, recLParam)); // If an unexpected char message comes, we should reset the records, @@ -1139,7 +1139,7 @@ nsIMM32Handler::HandleStartComposition(nsWindow* aWindow, aWindow->InitEvent(selection, &point); aWindow->DispatchWindowEvent(&selection); if (!selection.mSucceeded) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleStartComposition, FAILED (NS_QUERY_SELECTED_TEXT)\n")); return; } @@ -1155,7 +1155,7 @@ nsIMM32Handler::HandleStartComposition(nsWindow* aWindow, mIsComposing = true; mComposingWindow = aWindow; - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleStartComposition, START composition, mCompositionStart=%ld\n", mCompositionStart)); } @@ -1189,7 +1189,7 @@ nsIMM32Handler::HandleComposition(nsWindow* aWindow, WinUtils::PeekMessage(&msg2, wnd, WM_IME_ENDCOMPOSITION, WM_IME_COMPOSITION, PM_NOREMOVE) && msg2.message == WM_IME_COMPOSITION) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleComposition, Ignores due to find a WM_IME_STARTCOMPOSITION\n")); return ShouldDrawCompositionStringOurselves(); } @@ -1207,7 +1207,7 @@ nsIMM32Handler::HandleComposition(nsWindow* aWindow, GetCompositionString(aIMEContext, GCS_RESULTSTR, mCompositionString); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleComposition, GCS_RESULTSTR\n")); HandleEndComposition(aWindow, &mCompositionString); @@ -1228,14 +1228,14 @@ nsIMM32Handler::HandleComposition(nsWindow* aWindow, //-------------------------------------------------------- // 1. Get GCS_COMPSTR //-------------------------------------------------------- - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleComposition, GCS_COMPSTR\n")); nsAutoString previousCompositionString(mCompositionString); GetCompositionString(aIMEContext, GCS_COMPSTR, mCompositionString); if (!IS_COMPOSING_LPARAM(lParam)) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleComposition, lParam doesn't indicate composing, " "mCompositionString=\"%s\", previousCompositionString=\"%s\"", NS_ConvertUTF16toUTF8(mCompositionString).get(), @@ -1274,7 +1274,7 @@ nsIMM32Handler::HandleComposition(nsWindow* aWindow, // string is null (it indicates the composition transaction ended), // WM_IME_ENDCOMPOSITION may not be sent. If so, we cannot run // HandleEndComposition() in other place. - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleComposition, Aborting GCS_COMPSTR\n")); HandleEndComposition(aWindow); return IS_COMMITTING_LPARAM(lParam); @@ -1297,7 +1297,7 @@ nsIMM32Handler::HandleComposition(nsWindow* aWindow, // API for it, however, we should not kill Unicode support on all IMEs. bool useA_API = !(sIMEProperty & IME_PROP_UNICODE); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleComposition, GCS_COMPCLAUSE, useA_API=%s\n", useA_API ? "TRUE" : "FALSE")); @@ -1312,7 +1312,7 @@ nsIMM32Handler::HandleComposition(nsWindow* aWindow, clauseArrayLength2 /= sizeof(uint32_t); if (clauseArrayLength != clauseArrayLength2) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleComposition, GCS_COMPCLAUSE, clauseArrayLength=%ld but clauseArrayLength2=%ld\n", clauseArrayLength, clauseArrayLength2)); if (clauseArrayLength > clauseArrayLength2) @@ -1341,7 +1341,7 @@ nsIMM32Handler::HandleComposition(nsWindow* aWindow, // may return an error code. mClauseArray.SetLength(std::max(0, clauseArrayLength)); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleComposition, GCS_COMPCLAUSE, mClauseLength=%ld\n", mClauseArray.Length())); @@ -1367,7 +1367,7 @@ nsIMM32Handler::HandleComposition(nsWindow* aWindow, // error code. mAttributeArray.SetLength(std::max(0, attrArrayLength)); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleComposition, GCS_COMPATTR, mAttributeLength=%ld\n", mAttributeArray.Length())); @@ -1388,7 +1388,7 @@ nsIMM32Handler::HandleComposition(nsWindow* aWindow, NS_ASSERTION(mCursorPosition <= (long)mCompositionString.Length(), "illegal pos"); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleComposition, GCS_CURSORPOS, mCursorPosition=%d\n", mCursorPosition)); @@ -1409,7 +1409,7 @@ nsIMM32Handler::HandleEndComposition(nsWindow* aWindow, NS_PRECONDITION(!aWindow->PluginHasFocus(), "HandleComposition should not be called when a plug-in has focus"); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleEndComposition(aWindow=0x%p, aCommitString=0x%p (\"%s\"))", aWindow, aCommitString, aCommitString ? NS_ConvertUTF16toUTF8(*aCommitString).get() : "")); @@ -1435,15 +1435,15 @@ nsIMM32Handler::HandleEndComposition(nsWindow* aWindow, static void DumpReconvertString(RECONVERTSTRING* aReconv) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, (" dwSize=%ld, dwVersion=%ld, dwStrLen=%ld, dwStrOffset=%ld\n", aReconv->dwSize, aReconv->dwVersion, aReconv->dwStrLen, aReconv->dwStrOffset)); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, (" dwCompStrLen=%ld, dwCompStrOffset=%ld, dwTargetStrLen=%ld, dwTargetStrOffset=%ld\n", aReconv->dwCompStrLen, aReconv->dwCompStrOffset, aReconv->dwTargetStrLen, aReconv->dwTargetStrOffset)); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, (" result str=\"%s\"\n", NS_ConvertUTF16toUTF8( nsAutoString((char16_t*)((char*)(aReconv) + aReconv->dwStrOffset), @@ -1463,7 +1463,7 @@ nsIMM32Handler::HandleReconvert(nsWindow* aWindow, aWindow->InitEvent(selection, &point); aWindow->DispatchWindowEvent(&selection); if (!selection.mSucceeded) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleReconvert, FAILED (NS_QUERY_SELECTED_TEXT)\n")); return false; } @@ -1474,19 +1474,19 @@ nsIMM32Handler::HandleReconvert(nsWindow* aWindow, if (!pReconv) { // Return need size to reconvert. if (len == 0) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleReconvert, There are not selected text\n")); return false; } *oResult = needSize; - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleReconvert, SUCCEEDED result=%ld\n", *oResult)); return true; } if (pReconv->dwSize < needSize) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleReconvert, FAILED pReconv->dwSize=%ld, needSize=%ld\n", pReconv->dwSize, needSize)); return false; @@ -1506,7 +1506,7 @@ nsIMM32Handler::HandleReconvert(nsWindow* aWindow, ::CopyMemory(reinterpret_cast(lParam + sizeof(RECONVERTSTRING)), selection.mReply.mString.get(), len * sizeof(WCHAR)); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleReconvert, SUCCEEDED result=%ld\n", *oResult)); DumpReconvertString(pReconv); @@ -1523,24 +1523,24 @@ nsIMM32Handler::HandleQueryCharPosition(nsWindow* aWindow, *oResult = false; IMECHARPOSITION* pCharPosition = reinterpret_cast(lParam); if (!pCharPosition) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleQueryCharPosition, FAILED (pCharPosition is null)\n")); return false; } if (pCharPosition->dwSize < sizeof(IMECHARPOSITION)) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleReconvert, FAILED, pCharPosition->dwSize=%ld, sizeof(IMECHARPOSITION)=%ld\n", pCharPosition->dwSize, sizeof(IMECHARPOSITION))); return false; } if (::GetFocus() != aWindow->GetWindowHandle()) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleReconvert, FAILED, ::GetFocus()=%08x, OurWindowHandle=%08x\n", ::GetFocus(), aWindow->GetWindowHandle())); return false; } if (pCharPosition->dwCharPos > len) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleQueryCharPosition, FAILED, pCharPosition->dwCharPos=%ld, len=%ld\n", pCharPosition->dwCharPos, len)); return false; @@ -1572,7 +1572,7 @@ nsIMM32Handler::HandleQueryCharPosition(nsWindow* aWindow, aWindow->InitEvent(editorRect); aWindow->DispatchWindowEvent(&editorRect); if (NS_WARN_IF(!editorRect.mSucceeded)) { - MOZ_LOG(gIMM32Log, LogLevel::Error, + MOZ_LOG(gIMM32Log, PR_LOG_ERROR, ("IMM32: HandleQueryCharPosition, NS_QUERY_EDITOR_RECT failed")); ::GetWindowRect(aWindow->GetWindowHandle(), &pCharPosition->rcDocument); } else { @@ -1589,7 +1589,7 @@ nsIMM32Handler::HandleQueryCharPosition(nsWindow* aWindow, *oResult = TRUE; - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleQueryCharPosition, SUCCEEDED, pCharPosition={ pt={ x=%d, " "y=%d }, cLineHeight=%d, rcDocument={ left=%d, top=%d, right=%d, " "bottom=%d } }", @@ -1618,7 +1618,7 @@ nsIMM32Handler::HandleDocumentFeed(nsWindow* aWindow, aWindow->InitEvent(selection, &point); aWindow->DispatchWindowEvent(&selection); if (!selection.mSucceeded) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleDocumentFeed, FAILED (NS_QUERY_SELECTED_TEXT)\n")); return false; } @@ -1634,7 +1634,7 @@ nsIMM32Handler::HandleDocumentFeed(nsWindow* aWindow, // INT32_MAX. if (targetOffset < 0 || targetLength < 0 || targetOffset + targetLength < 0) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleDocumentFeed, FAILED (The selection is out of range)\n")); return false; } @@ -1645,14 +1645,14 @@ nsIMM32Handler::HandleDocumentFeed(nsWindow* aWindow, aWindow->InitEvent(textContent, &point); aWindow->DispatchWindowEvent(&textContent); if (!textContent.mSucceeded) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleDocumentFeed, FAILED (NS_QUERY_TEXT_CONTENT)\n")); return false; } nsAutoString str(textContent.mReply.mString); if (targetOffset > int32_t(str.Length())) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleDocumentFeed, FAILED (The caret offset is invalid)\n")); return false; } @@ -1673,14 +1673,14 @@ nsIMM32Handler::HandleDocumentFeed(nsWindow* aWindow, if (!pReconv) { *oResult = needSize; - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleDocumentFeed, SUCCEEDED result=%ld\n", *oResult)); return true; } if (pReconv->dwSize < needSize) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleDocumentFeed, FAILED pReconv->dwSize=%ld, needSize=%ld\n", pReconv->dwSize, needSize)); return false; @@ -1697,7 +1697,7 @@ nsIMM32Handler::HandleDocumentFeed(nsWindow* aWindow, // Set composition target clause information uint32_t offset, length; if (!GetTargetClauseRange(&offset, &length)) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleDocumentFeed, FAILED, by GetTargetClauseRange\n")); return false; } @@ -1717,7 +1717,7 @@ nsIMM32Handler::HandleDocumentFeed(nsWindow* aWindow, ::CopyMemory(reinterpret_cast(lParam + sizeof(RECONVERTSTRING)), paragraph.BeginReading(), len * sizeof(WCHAR)); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleDocumentFeed, SUCCEEDED result=%ld\n", *oResult)); DumpReconvertString(pReconv); @@ -1732,7 +1732,7 @@ nsIMM32Handler::CommitCompositionOnPreviousWindow(nsWindow* aWindow) return false; } - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: CommitCompositionOnPreviousWindow, mIsComposing=%s, mIsComposingOnPlugin=%s\n", mIsComposing ? "TRUE" : "FALSE", mIsComposingOnPlugin ? "TRUE" : "FALSE")); @@ -1795,7 +1795,7 @@ nsIMM32Handler::DispatchCompositionChangeEvent(nsWindow* aWindow, const nsIMEContext& aIMEContext) { NS_ASSERTION(mIsComposing, "conflict state"); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: DispatchCompositionChangeEvent")); // If we don't need to draw composition string ourselves, we don't need to @@ -1848,7 +1848,7 @@ nsIMM32Handler::CreateTextRangeArray() range.mRangeType = NS_TEXTRANGE_RAWINPUT; textRangeArray->AppendElement(range); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: CreateTextRangeArray, mClauseLength=0\n")); } else { // iterate over the attributes @@ -1856,7 +1856,7 @@ nsIMM32Handler::CreateTextRangeArray() for (uint32_t i = 0; i < mClauseArray.Length() - 1; i++) { uint32_t current = mClauseArray[i + 1]; if (current > mCompositionString.Length()) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: CreateTextRangeArray, mClauseArray[%ld]=%lu. " "This is larger than mCompositionString.Length()=%lu\n", i + 1, current, mCompositionString.Length())); @@ -1870,7 +1870,7 @@ nsIMM32Handler::CreateTextRangeArray() lastOffset = current; - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: CreateTextRangeArray, index=%ld, rangeType=%s, range=[%lu-%lu]\n", i, GetRangeTypeName(range.mRangeType), range.mStartOffset, range.mEndOffset)); @@ -1878,14 +1878,14 @@ nsIMM32Handler::CreateTextRangeArray() } if (mCursorPosition == NO_IME_CARET) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: CreateTextRangeArray, no caret\n")); return textRangeArray.forget(); } int32_t cursor = mCursorPosition; if (uint32_t(cursor) > mCompositionString.Length()) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: CreateTextRangeArray, mCursorPosition=%ld. " "This is larger than mCompositionString.Length()=%lu\n", mCursorPosition, mCompositionString.Length())); @@ -1896,7 +1896,7 @@ nsIMM32Handler::CreateTextRangeArray() range.mRangeType = NS_TEXTRANGE_CARETPOSITION; textRangeArray->AppendElement(range); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: CreateTextRangeArray, caret position=%ld\n", range.mStartOffset)); @@ -1915,7 +1915,7 @@ nsIMM32Handler::GetCompositionString(const nsIMEContext &aIMEContext, if (lRtn < 0 || !aCompositionString.SetLength((lRtn / sizeof(WCHAR)) + 1, mozilla::fallible)) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: GetCompositionString, FAILED by OOM\n")); return; // Error or out of memory. } @@ -1926,7 +1926,7 @@ nsIMM32Handler::GetCompositionString(const nsIMEContext &aIMEContext, lRtn + sizeof(WCHAR)); aCompositionString.SetLength(lRtn / sizeof(WCHAR)); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: GetCompositionString, SUCCEEDED aCompositionString=\"%s\"\n", NS_ConvertUTF16toUTF8(aCompositionString).get())); } @@ -1982,7 +1982,7 @@ nsIMM32Handler::ConvertToANSIString(const nsAFlatString& aStr, UINT aCodePage, NS_ENSURE_TRUE(len >= 0, false); if (!aANSIStr.SetLength(len, mozilla::fallible)) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: ConvertToANSIString, FAILED by OOM\n")); return false; } @@ -2003,7 +2003,7 @@ nsIMM32Handler::GetCharacterRectOfSelectedTextAt(nsWindow* aWindow, aWindow->InitEvent(selection, &point); aWindow->DispatchWindowEvent(&selection); if (!selection.mSucceeded) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: GetCharacterRectOfSelectedTextAt, aOffset=%lu, FAILED (NS_QUERY_SELECTED_TEXT)\n", aOffset)); return false; @@ -2035,10 +2035,10 @@ nsIMM32Handler::GetCharacterRectOfSelectedTextAt(nsWindow* aWindow, if (aWritingMode) { *aWritingMode = charRect.GetWritingMode(); } - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: GetCharacterRectOfSelectedTextAt, aOffset=%lu, SUCCEEDED\n", aOffset)); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: GetCharacterRectOfSelectedTextAt, " "aCharRect={ x: %ld, y: %ld, width: %ld, height: %ld }, " "charRect.GetWritingMode()=%s", @@ -2062,7 +2062,7 @@ nsIMM32Handler::GetCaretRect(nsWindow* aWindow, aWindow->InitEvent(selection, &point); aWindow->DispatchWindowEvent(&selection); if (!selection.mSucceeded) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: GetCaretRect, FAILED (NS_QUERY_SELECTED_TEXT)\n")); return false; } @@ -2074,7 +2074,7 @@ nsIMM32Handler::GetCaretRect(nsWindow* aWindow, aWindow->InitEvent(caretRect, &point); aWindow->DispatchWindowEvent(&caretRect); if (!caretRect.mSucceeded) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: GetCaretRect, FAILED (NS_QUERY_CARET_RECT)\n")); return false; } @@ -2082,7 +2082,7 @@ nsIMM32Handler::GetCaretRect(nsWindow* aWindow, if (aWritingMode) { *aWritingMode = caretRect.GetWritingMode(); } - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: GetCaretRect, SUCCEEDED, " "aCaretRect={ x: %ld, y: %ld, width: %ld, height: %ld }, " "caretRect.GetWritingMode()=%s", @@ -2118,7 +2118,7 @@ nsIMM32Handler::SetIMERelatedWindowsPos(nsWindow* aWindow, if (!mNativeCaretIsCreated) { mNativeCaretIsCreated = ::CreateCaret(aWindow->GetWindowHandle(), nullptr, caretRect.width, caretRect.height); - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: SetIMERelatedWindowsPos, mNativeCaretIsCreated=%s, width=%ld height=%ld\n", mNativeCaretIsCreated ? "TRUE" : "FALSE", caretRect.width, caretRect.height)); @@ -2126,7 +2126,7 @@ nsIMM32Handler::SetIMERelatedWindowsPos(nsWindow* aWindow, ::SetCaretPos(caretRect.x, caretRect.y); if (ShouldDrawCompositionStringOurselves()) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: SetIMERelatedWindowsPos, Set candidate window\n")); // Get a rect of first character in current target in composition string. @@ -2136,7 +2136,7 @@ nsIMM32Handler::SetIMERelatedWindowsPos(nsWindow* aWindow, // rect instead. uint32_t offset, length; if (!GetTargetClauseRange(&offset, &length)) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: SetIMERelatedWindowsPos, FAILED, by GetTargetClauseRange\n")); return false; } @@ -2208,7 +2208,7 @@ nsIMM32Handler::SetIMERelatedWindowsPos(nsWindow* aWindow, candForm.ptCurrentPos.x = targetClauseRect.x; candForm.ptCurrentPos.y = targetClauseRect.YMost(); } - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: SetIMERelatedWindowsPos, Calling ImmSetCandidateWindow()... " "ptCurrentPos={ x=%d, y=%d }, " "rcArea={ left=%d, top=%d, right=%d, bottom=%d }, " @@ -2219,7 +2219,7 @@ nsIMM32Handler::SetIMERelatedWindowsPos(nsWindow* aWindow, GetWritingModeName(writingMode).get())); ::ImmSetCandidateWindow(aIMEContext.get(), &candForm); } else { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: SetIMERelatedWindowsPos, Set composition window\n")); // Move the composition window to caret position (if selected some @@ -2246,7 +2246,7 @@ nsIMM32Handler::SetIMERelatedWindowsPosOnPlugin(nsWindow* aWindow, aWindow->InitEvent(editorRectEvent); aWindow->DispatchWindowEvent(&editorRectEvent); if (!editorRectEvent.mSucceeded) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: SetIMERelatedWindowsPosOnPlugin, " "FAILED (NS_QUERY_EDITOR_RECT)")); return; @@ -2293,7 +2293,7 @@ nsIMM32Handler::SetIMERelatedWindowsPosOnPlugin(nsWindow* aWindow, compForm.ptCurrentPos.x = clippedPluginRect.BottomLeft().x; compForm.ptCurrentPos.y = clippedPluginRect.BottomLeft().y; if (!::ImmSetCompositionWindow(aIMEContext.get(), &compForm)) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: SetIMERelatedWindowsPosOnPlugin, " "FAILED to set composition window")); return; @@ -2388,7 +2388,7 @@ nsIMM32Handler::AdjustCompositionFont(const nsIMEContext& aIMEContext, LOGFONTW defaultLogFont; if (NS_WARN_IF(!::ImmGetCompositionFont(aIMEContext.get(), &defaultLogFont))) { - MOZ_LOG(gIMM32Log, LogLevel::Error, + MOZ_LOG(gIMM32Log, PR_LOG_ERROR, ("IMM32: AdjustCompositionFont, ::ImmGetCompositionFont() failed")); sCompositionFont.AssignLiteral("System"); } else { @@ -2397,7 +2397,7 @@ nsIMM32Handler::AdjustCompositionFont(const nsIMEContext& aIMEContext, } } - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: AdjustCompositionFont, sCompositionFont=\"%s\" is initialized", NS_ConvertUTF16toUTF8(sCompositionFont).get())); } @@ -2423,7 +2423,7 @@ nsIMM32Handler::AdjustCompositionFont(const nsIMEContext& aIMEContext, LOGFONTW logFont; memset(&logFont, 0, sizeof(logFont)); if (!::ImmGetCompositionFont(aIMEContext.get(), &logFont)) { - MOZ_LOG(gIMM32Log, LogLevel::Error, + MOZ_LOG(gIMM32Log, PR_LOG_ERROR, ("IMM32: AdjustCompositionFont, ::ImmGetCompositionFont() failed")); logFont.lfFaceName[0] = 0; } @@ -2444,7 +2444,7 @@ nsIMM32Handler::AdjustCompositionFont(const nsIMEContext& aIMEContext, IsJapanist2003Active() ? sCompositionFontForJapanist2003 : sCompositionFont, logFont); } - MOZ_LOG(gIMM32Log, LogLevel::Warning, + MOZ_LOG(gIMM32Log, PR_LOG_WARNING, ("IMM32: AdjustCompositionFont, calling ::ImmSetCompositionFont(\"%s\")", NS_ConvertUTF16toUTF8(nsDependentString(logFont.lfFaceName)).get())); ::ImmSetCompositionFontW(aIMEContext.get(), &logFont); @@ -2523,7 +2523,7 @@ nsIMM32Handler::OnMouseButtonEvent(nsWindow* aWindow, offset++; } - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnMouseButtonEvent, x,y=%ld,%ld, offset=%ld, positioning=%ld\n", cursorPos.x, cursorPos.y, offset, positioning)); @@ -2542,7 +2542,7 @@ nsIMM32Handler::OnMouseButtonEvent(nsWindow* aWindow, nsIMM32Handler::OnKeyDownEvent(nsWindow* aWindow, WPARAM wParam, LPARAM lParam, MSGResult& aResult) { - MOZ_LOG(gIMM32Log, LogLevel::Info, + MOZ_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnKeyDownEvent, hWnd=%08x, wParam=%08x, lParam=%08x\n", aWindow->GetWindowHandle(), wParam, lParam)); aResult.mConsumed = false; diff --git a/widget/windows/nsNativeThemeWin.cpp b/widget/windows/nsNativeThemeWin.cpp index b400b7e6199b..08c3e1911b56 100644 --- a/widget/windows/nsNativeThemeWin.cpp +++ b/widget/windows/nsNativeThemeWin.cpp @@ -1623,10 +1623,10 @@ RENDER_AGAIN: #if 0 { - MOZ_LOG(gWindowsLog, LogLevel::Error, + MOZ_LOG(gWindowsLog, PR_LOG_ERROR, (stderr, "xform: %f %f %f %f [%f %f]\n", m._11, m._21, m._12, m._22, m._31, m._32)); - MOZ_LOG(gWindowsLog, LogLevel::Error, + MOZ_LOG(gWindowsLog, PR_LOG_ERROR, (stderr, "tr: [%d %d %d %d]\ndr: [%d %d %d %d]\noff: [%f %f]\n", tr.x, tr.y, tr.width, tr.height, dr.x, dr.y, dr.width, dr.height, offset.x, offset.y)); diff --git a/widget/windows/nsSound.cpp b/widget/windows/nsSound.cpp index cce91d23a7ce..f6be789c9946 100644 --- a/widget/windows/nsSound.cpp +++ b/widget/windows/nsSound.cpp @@ -27,8 +27,6 @@ #include "nsNativeCharsetUtils.h" #include "nsThreadUtils.h" -using mozilla::LogLevel; - PRLogModuleInfo* gWin32SoundLog = nullptr; class nsSoundPlayer: public nsRunnable { @@ -169,7 +167,7 @@ NS_IMETHODIMP nsSound::OnStreamComplete(nsIStreamLoader *aLoader, if (uri) { nsAutoCString uriSpec; uri->GetSpec(uriSpec); - MOZ_LOG(gWin32SoundLog, LogLevel::Info, + MOZ_LOG(gWin32SoundLog, PR_LOG_ALWAYS, ("Failed to load %s\n", uriSpec.get())); } } @@ -203,7 +201,7 @@ NS_IMETHODIMP nsSound::Play(nsIURL *aURL) #ifdef DEBUG_SOUND char *url; aURL->GetSpec(&url); - MOZ_LOG(gWin32SoundLog, LogLevel::Info, + MOZ_LOG(gWin32SoundLog, PR_LOG_ALWAYS, ("%s\n", url)); #endif diff --git a/widget/windows/nsTextStore.cpp b/widget/windows/nsTextStore.cpp index 89c4de37d55b..14a4f4e6d926 100644 --- a/widget/windows/nsTextStore.cpp +++ b/widget/windows/nsTextStore.cpp @@ -31,9 +31,9 @@ static const char* kPrefNameForceEnableTSF = "intl.tsf.force_enable"; * TSF related code should log its behavior even on release build especially * in the interface methods. * - * In interface methods, use LogLevel::Info. - * In internal methods, use LogLevel::Debug for logging normal behavior. - * For logging error, use LogLevel::Error. + * In interface methods, use PR_LOG_ALWAYS. + * In internal methods, use PR_LOG_DEBUG for logging normal behavior. + * For logging error, use PR_LOG_ERROR. * * When an instance method is called, start with following text: * "TSF: 0x%p nsFoo::Bar(", the 0x%p should be the "this" of the nsFoo. @@ -669,7 +669,7 @@ public: InputScopeImpl(const nsTArray& aList) : mInputScopes(aList) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p InputScopeImpl()", this)); } @@ -880,7 +880,7 @@ TSFStaticSink::Init(ITfThreadMgr* aThreadMgr, HRESULT hr = mThreadMgr->QueryInterface(IID_ITfSource, getter_AddRefs(source)); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p TSFStaticSink::Init() FAILED to get ITfSource " "instance (0x%08X)", this, hr)); return false; @@ -895,7 +895,7 @@ TSFStaticSink::Init(ITfThreadMgr* aThreadMgr, static_cast(this), &mIPProfileCookie); if (FAILED(hr) || mIPProfileCookie == TF_INVALID_COOKIE) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p TSFStaticSink::Init() FAILED to install " "ITfInputProcessorProfileActivationSink (0x%08X)", this, hr)); return false; @@ -905,14 +905,14 @@ TSFStaticSink::Init(ITfThreadMgr* aThreadMgr, static_cast(this), &mLangProfileCookie); if (FAILED(hr) || mLangProfileCookie == TF_INVALID_COOKIE) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p TSFStaticSink::Init() FAILED to install " "ITfActiveLanguageProfileNotifySink (0x%08X)", this, hr)); return false; } } - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p TSFStaticSink::Init(), " "mIPProfileCookie=0x%08X, mLangProfileCookie=0x%08X", this, mIPProfileCookie, mLangProfileCookie)); @@ -922,7 +922,7 @@ TSFStaticSink::Init(ITfThreadMgr* aThreadMgr, void TSFStaticSink::Destroy() { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p TSFStaticSink::Shutdown() " "mIPProfileCookie=0x%08X, mLangProfileCookie=0x%08X", this, mIPProfileCookie, mLangProfileCookie)); @@ -932,13 +932,13 @@ TSFStaticSink::Destroy() HRESULT hr = mThreadMgr->QueryInterface(IID_ITfSource, getter_AddRefs(source)); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p TSFStaticSink::Shutdown() FAILED to get " "ITfSource instance (0x%08X)", this, hr)); } else { hr = source->UnadviseSink(mIPProfileCookie); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::Shutdown() FAILED to uninstall " "ITfInputProcessorProfileActivationSink (0x%08X)", this, hr)); @@ -951,13 +951,13 @@ TSFStaticSink::Destroy() HRESULT hr = mThreadMgr->QueryInterface(IID_ITfSource, getter_AddRefs(source)); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p TSFStaticSink::Shutdown() FAILED to get " "ITfSource instance (0x%08X)", this, hr)); } else { hr = source->UnadviseSink(mLangProfileCookie); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p TSFStaticSink::Shutdown() FAILED to uninstall " "ITfActiveLanguageProfileNotifySink (0x%08X)", this, hr)); @@ -982,7 +982,7 @@ TSFStaticSink::OnActivated(REFCLSID clsid, REFGUID guidProfile, LANGID langID; HRESULT hr = mInputProcessorProfiles->GetCurrentLanguage(&langID); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: TSFStaticSink::OnActivated() FAILED due to " "GetCurrentLanguage() failure, hr=0x%08X", hr)); } else if (IsTIPCategoryKeyboard(clsid, langID, guidProfile)) { @@ -994,7 +994,7 @@ TSFStaticSink::OnActivated(REFCLSID clsid, REFGUID guidProfile, } } - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p TSFStaticSink::OnActivated(rclsid=%s, guidProfile=%s, " "fActivated=%s), mIsIMM_IME=%s, mActiveTIPDescription=\"%s\"", this, GetCLSIDNameStr(clsid).get(), @@ -1024,7 +1024,7 @@ TSFStaticSink::OnActivated(DWORD dwProfileType, GetTIPDescription(rclsid, langid, guidProfile, mActiveTIPKeyboardDescription); } - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p TSFStaticSink::OnActivated(dwProfileType=%s (0x%08X), " "langid=0x%08X, rclsid=%s, catid=%s, guidProfile=%s, hkl=0x%08X, " "dwFlags=0x%08X (TF_IPSINK_FLAG_ACTIVE: %s)), mIsIMM_IME=%s, " @@ -1054,7 +1054,7 @@ TSFStaticSink::EnsureInitActiveTIPKeyboard() mInputProcessorProfiles->QueryInterface(IID_ITfInputProcessorProfileMgr, getter_AddRefs(profileMgr)); if (FAILED(hr) || !profileMgr) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p TSFStaticSink::EnsureInitActiveLanguageProfile(), FAILED " "to get input processor profile manager, hr=0x%08X", this, hr)); return false; @@ -1063,7 +1063,7 @@ TSFStaticSink::EnsureInitActiveTIPKeyboard() TF_INPUTPROCESSORPROFILE profile; hr = profileMgr->GetActiveProfile(GUID_TFCAT_TIP_KEYBOARD, &profile); if (hr == S_FALSE) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p TSFStaticSink::EnsureInitActiveLanguageProfile(), FAILED " "to get active keyboard layout profile due to no active profile, " "hr=0x%08X", this, hr)); @@ -1072,13 +1072,13 @@ TSFStaticSink::EnsureInitActiveTIPKeyboard() return false; } if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p TSFStaticSink::EnsureInitActiveLanguageProfile(), FAILED " "to get active TIP keyboard, hr=0x%08X", this, hr)); return false; } - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p TSFStaticSink::EnsureInitActiveLanguageProfile(), " "calling OnActivated() manually...", this)); OnActivated(profile.dwProfileType, profile.langid, profile.clsid, @@ -1090,7 +1090,7 @@ TSFStaticSink::EnsureInitActiveTIPKeyboard() LANGID langID; HRESULT hr = mInputProcessorProfiles->GetCurrentLanguage(&langID); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p TSFStaticSink::EnsureInitActiveLanguageProfile(), FAILED " "to get current language ID, hr=0x%08X", this, hr)); return false; @@ -1100,7 +1100,7 @@ TSFStaticSink::EnsureInitActiveTIPKeyboard() hr = mInputProcessorProfiles->EnumLanguageProfiles(langID, getter_AddRefs(enumLangProfiles)); if (FAILED(hr) || !enumLangProfiles) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p TSFStaticSink::EnsureInitActiveLanguageProfile(), FAILED " "to get language profiles enumerator, hr=0x%08X", this, hr)); return false; @@ -1112,7 +1112,7 @@ TSFStaticSink::EnsureInitActiveTIPKeyboard() if (!profile.fActive || profile.catid != GUID_TFCAT_TIP_KEYBOARD) { continue; } - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p TSFStaticSink::EnsureInitActiveLanguageProfile(), " "calling OnActivated() manually...", this)); bool isTIP = profile.guidProfile != GUID_NULL; @@ -1124,7 +1124,7 @@ TSFStaticSink::EnsureInitActiveTIPKeyboard() return true; } - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p TSFStaticSink::EnsureInitActiveLanguageProfile(), " "calling OnActivated() without active TIP manually...", this)); OnActivated(TF_PROFILETYPE_KEYBOARDLAYOUT, @@ -1151,7 +1151,7 @@ TSFStaticSink::GetTIPDescription(REFCLSID aTextService, LANGID aLangID, aProfile, &description); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p TSFStaticSink::InitActiveTIPDescription() FAILED " "due to GetLanguageProfileDescription() failure, hr=0x%08X", this, hr)); @@ -1177,7 +1177,7 @@ TSFStaticSink::IsTIPCategoryKeyboard(REFCLSID aTextService, LANGID aLangID, mInputProcessorProfiles->EnumLanguageProfiles(aLangID, getter_AddRefs(enumLangProfiles)); if (FAILED(hr) || !enumLangProfiles) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p TSFStaticSink::IsTIPCategoryKeyboard(), FAILED " "to get language profiles enumerator, hr=0x%08X", this, hr)); return false; @@ -1239,27 +1239,27 @@ nsTextStore::nsTextStore() // We hope that 5 or more actions don't occur at once. mPendingActions.SetCapacity(5); - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::nsTestStore() SUCCEEDED", this)); } nsTextStore::~nsTextStore() { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore instance is destroyed", this)); } bool nsTextStore::Init(nsWindowBase* aWidget) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::Init(aWidget=0x%p)", this, aWidget)); TSFStaticSink::GetInstance()->EnsureInitActiveTIPKeyboard(); if (mDocumentMgr) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::Init() FAILED due to already initialized", this)); return false; @@ -1268,7 +1268,7 @@ nsTextStore::Init(nsWindowBase* aWidget) // Create document manager HRESULT hr = sThreadMgr->CreateDocumentMgr(getter_AddRefs(mDocumentMgr)); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::Init() FAILED to create DocumentMgr " "(0x%08X)", this, hr)); return false; @@ -1280,7 +1280,7 @@ nsTextStore::Init(nsWindowBase* aWidget) static_cast(this), getter_AddRefs(mContext), &mEditCookie); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::Init() FAILED to create the context " "(0x%08X)", this, hr)); mDocumentMgr = nullptr; @@ -1289,7 +1289,7 @@ nsTextStore::Init(nsWindowBase* aWidget) hr = mDocumentMgr->Push(mContext); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::Init() FAILED to push the context (0x%08X)", this, hr)); // XXX Why don't we use NS_IF_RELEASE() here?? @@ -1298,7 +1298,7 @@ nsTextStore::Init(nsWindowBase* aWidget) return false; } - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::Init() succeeded: " "mDocumentMgr=0x%p, mContext=0x%p, mEditCookie=0x%08X", this, mDocumentMgr.get(), mContext.get(), mEditCookie)); @@ -1309,7 +1309,7 @@ nsTextStore::Init(nsWindowBase* aWidget) bool nsTextStore::Destroy() { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::Destroy(), mLock=%s, " "mComposition.IsComposing()=%s", this, GetLockFlagNameStr(mLock).get(), @@ -1339,13 +1339,13 @@ nsTextStore::Destroy() mWidget = nullptr; if (!mMouseTrackers.IsEmpty()) { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::Destroy(), removing a mouse tracker...", this)); mMouseTrackers.Clear(); } - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::Destroy() succeeded", this)); return true; } @@ -1367,7 +1367,7 @@ nsTextStore::QueryInterface(REFIID riid, return S_OK; } - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::QueryInterface() FAILED, riid=%s", this, GetRIIDNameStr(riid).get())); return E_NOINTERFACE; @@ -1378,21 +1378,21 @@ nsTextStore::AdviseSink(REFIID riid, IUnknown *punk, DWORD dwMask) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::AdviseSink(riid=%s, punk=0x%p, dwMask=%s), " "mSink=0x%p, mSinkMask=%s", this, GetRIIDNameStr(riid).get(), punk, GetSinkMaskNameStr(dwMask).get(), mSink.get(), GetSinkMaskNameStr(mSinkMask).get())); if (!punk) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::AdviseSink() FAILED due to the null punk", this)); return E_UNEXPECTED; } if (IID_ITextStoreACPSink != riid) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::AdviseSink() FAILED due to " "unsupported interface", this)); return E_INVALIDARG; // means unsupported interface. @@ -1402,7 +1402,7 @@ nsTextStore::AdviseSink(REFIID riid, // Install sink punk->QueryInterface(IID_ITextStoreACPSink, getter_AddRefs(mSink)); if (!mSink) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::AdviseSink() FAILED due to " "punk not having the interface", this)); return E_UNEXPECTED; @@ -1414,7 +1414,7 @@ nsTextStore::AdviseSink(REFIID riid, punk->QueryInterface(IID_IUnknown, getter_AddRefs(comparison1)); mSink->QueryInterface(IID_IUnknown, getter_AddRefs(comparison2)); if (comparison1 != comparison2) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::AdviseSink() FAILED due to " "the sink being different from the stored sink", this)); return CONNECT_E_ADVISELIMIT; @@ -1428,18 +1428,18 @@ nsTextStore::AdviseSink(REFIID riid, STDMETHODIMP nsTextStore::UnadviseSink(IUnknown *punk) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::UnadviseSink(punk=0x%p), mSink=0x%p", this, punk, mSink.get())); if (!punk) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::UnadviseSink() FAILED due to the null punk", this)); return E_INVALIDARG; } if (!mSink) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::UnadviseSink() FAILED due to " "any sink not stored", this)); return CONNECT_E_NOCONNECTION; @@ -1450,7 +1450,7 @@ nsTextStore::UnadviseSink(IUnknown *punk) mSink->QueryInterface(IID_IUnknown, getter_AddRefs(comparison2)); // Unadvise only if sinks are the same if (comparison1 != comparison2) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::UnadviseSink() FAILED due to " "the sink being different from the stored sink", this)); return CONNECT_E_NOCONNECTION; @@ -1464,19 +1464,19 @@ STDMETHODIMP nsTextStore::RequestLock(DWORD dwLockFlags, HRESULT *phrSession) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::RequestLock(dwLockFlags=%s, phrSession=0x%p), " "mLock=%s", this, GetLockFlagNameStr(dwLockFlags).get(), phrSession, GetLockFlagNameStr(mLock).get())); if (!mSink) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::RequestLock() FAILED due to " "any sink not stored", this)); return E_FAIL; } if (!phrSession) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::RequestLock() FAILED due to " "null phrSession", this)); return E_INVALIDARG; @@ -1485,7 +1485,7 @@ nsTextStore::RequestLock(DWORD dwLockFlags, if (!mLock) { // put on lock mLock = dwLockFlags & (~TS_LF_SYNC); - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p Locking (%s) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", this, GetLockFlagNameStr(mLock).get())); @@ -1493,7 +1493,7 @@ nsTextStore::RequestLock(DWORD dwLockFlags, // TSF but they don't grab us during this call. nsRefPtr kungFuDeathGrip(this); *phrSession = mSink->OnLockGranted(mLock); - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p Unlocked (%s) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<", this, GetLockFlagNameStr(mLock).get())); @@ -1501,12 +1501,12 @@ nsTextStore::RequestLock(DWORD dwLockFlags, while (mLockQueued) { mLock = mLockQueued; mLockQueued = 0; - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p Locking for the request in the queue (%s) >>>>>>>>>>>>>>" ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", this, GetLockFlagNameStr(mLock).get())); mSink->OnLockGranted(mLock); - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p Unlocked (%s) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<", this, GetLockFlagNameStr(mLock).get())); @@ -1519,7 +1519,7 @@ nsTextStore::RequestLock(DWORD dwLockFlags, if (!mPendingDestroy && mPendingOnLayoutChange) { mPendingOnLayoutChange = false; if (mSink) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::RequestLock(), " "calling ITextStoreACPSink::OnLayoutChange()...", this)); mSink->OnLayoutChange(TS_LC_CHANGE, TEXTSTORE_DEFAULT_VIEW); @@ -1531,7 +1531,7 @@ nsTextStore::RequestLock(DWORD dwLockFlags, mContext->QueryInterface(IID_ITfContextOwnerServices, getter_AddRefs(service)); if (service) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::RequestLock(), " "calling ITfContextOwnerServices::OnLayoutChange()...", this)); @@ -1543,7 +1543,7 @@ nsTextStore::RequestLock(DWORD dwLockFlags, if (!mPendingDestroy && mPendingOnSelectionChange) { mPendingOnSelectionChange = false; if (mSink) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::RequestLock(), " "calling ITextStoreACPSink::OnSelectionChange()...", this)); mSink->OnSelectionChange(); @@ -1554,7 +1554,7 @@ nsTextStore::RequestLock(DWORD dwLockFlags, Destroy(); } - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::RequestLock() succeeded: *phrSession=%s", this, GetTextStoreReturnValueName(*phrSession))); return S_OK; @@ -1567,14 +1567,14 @@ nsTextStore::RequestLock(DWORD dwLockFlags, *phrSession = TS_S_ASYNC; mLockQueued = dwLockFlags & (~TS_LF_SYNC); - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::RequestLock() stores the request in the " "queue, *phrSession=TS_S_ASYNC", this)); return S_OK; } // no more locks allowed - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::RequestLock() didn't allow to lock, " "*phrSession=TS_E_SYNCHRONOUS", this)); *phrSession = TS_E_SYNCHRONOUS; @@ -1624,7 +1624,7 @@ nsTextStore::FlushPendingActions() PendingAction& action = mPendingActions[i]; switch (action.mType) { case PendingAction::COMPOSITION_START: { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::FlushPendingActions() " "flushing COMPOSITION_START={ mSelectionStart=%d, " "mSelectionLength=%d }", @@ -1639,13 +1639,13 @@ nsTextStore::FlushPendingActions() selectionSet.mReversed = false; mWidget->DispatchWindowEvent(&selectionSet); if (!selectionSet.mSucceeded) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::FlushPendingActions() " "FAILED due to NS_SELECTION_SET failure", this)); break; } } - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::FlushPendingActions() " "dispatching compositionstart event...", this)); WidgetCompositionEvent compositionStart(true, NS_COMPOSITION_START, @@ -1658,7 +1658,7 @@ nsTextStore::FlushPendingActions() break; } case PendingAction::COMPOSITION_UPDATE: { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::FlushPendingActions() " "flushing COMPOSITION_UPDATE={ mData=\"%s\", " "mRanges=0x%p, mRanges->Length()=%d }", @@ -1699,7 +1699,7 @@ nsTextStore::FlushPendingActions() action.mData.ReplaceSubstring(NS_LITERAL_STRING("\r\n"), NS_LITERAL_STRING("\n")); - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::FlushPendingActions(), " "dispatching compositionchange event...", this)); WidgetCompositionEvent compositionChange(true, NS_COMPOSITION_CHANGE, @@ -1719,7 +1719,7 @@ nsTextStore::FlushPendingActions() break; } case PendingAction::COMPOSITION_END: { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::FlushPendingActions() " "flushing COMPOSITION_END={ mData=\"%s\" }", this, NS_ConvertUTF16toUTF8(action.mData).get())); @@ -1727,7 +1727,7 @@ nsTextStore::FlushPendingActions() action.mData.ReplaceSubstring(NS_LITERAL_STRING("\r\n"), NS_LITERAL_STRING("\n")); - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::FlushPendingActions(), " "dispatching compositioncommit event...", this)); WidgetCompositionEvent compositionCommit(true, NS_COMPOSITION_COMMIT, @@ -1741,7 +1741,7 @@ nsTextStore::FlushPendingActions() break; } case PendingAction::SELECTION_SET: { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::FlushPendingActions() " "flushing SELECTION_SET={ mSelectionStart=%d, " "mSelectionLength=%d, mSelectionReversed=%s }", @@ -1764,7 +1764,7 @@ nsTextStore::FlushPendingActions() continue; } - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::FlushPendingActions(), " "qutting since the mWidget has gone", this)); break; @@ -1775,11 +1775,11 @@ nsTextStore::FlushPendingActions() STDMETHODIMP nsTextStore::GetStatus(TS_STATUS *pdcs) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::GetStatus(pdcs=0x%p)", this, pdcs)); if (!pdcs) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetStatus() FAILED due to null pdcs", this)); return E_INVALIDARG; } @@ -1796,20 +1796,20 @@ nsTextStore::QueryInsert(LONG acpTestStart, LONG *pacpResultStart, LONG *pacpResultEnd) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::QueryInsert(acpTestStart=%ld, " "acpTestEnd=%ld, cch=%lu, pacpResultStart=0x%p, pacpResultEnd=0x%p)", this, acpTestStart, acpTestEnd, cch, acpTestStart, acpTestEnd)); if (!pacpResultStart || !pacpResultEnd) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::QueryInsert() FAILED due to " "the null argument", this)); return E_INVALIDARG; } if (acpTestStart < 0 || acpTestStart > acpTestEnd) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::QueryInsert() FAILED due to " "wrong argument", this)); return E_INVALIDARG; @@ -1820,7 +1820,7 @@ nsTextStore::QueryInsert(LONG acpTestStart, *pacpResultStart = acpTestStart; *pacpResultEnd = acpTestStart + cch; - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::QueryInsert() succeeded: " "*pacpResultStart=%ld, *pacpResultEnd=%ld)", this, *pacpResultStart, *pacpResultEnd)); @@ -1833,19 +1833,19 @@ nsTextStore::GetSelection(ULONG ulIndex, TS_SELECTION_ACP *pSelection, ULONG *pcFetched) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::GetSelection(ulIndex=%lu, ulCount=%lu, " "pSelection=0x%p, pcFetched=0x%p)", this, ulIndex, ulCount, pSelection, pcFetched)); if (!IsReadLocked()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetSelection() FAILED due to not locked", this)); return TS_E_NOLOCK; } if (!ulCount || !pSelection || !pcFetched) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetSelection() FAILED due to " "null argument", this)); return E_INVALIDARG; @@ -1855,7 +1855,7 @@ nsTextStore::GetSelection(ULONG ulIndex, if (ulIndex != static_cast(TS_DEFAULT_SELECTION) && ulIndex != 0) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetSelection() FAILED due to " "unsupported selection", this)); return TS_E_NOSELECTION; @@ -1863,14 +1863,14 @@ nsTextStore::GetSelection(ULONG ulIndex, Selection& currentSel = CurrentSelection(); if (currentSel.IsDirty()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetSelection() FAILED due to " "CurrentSelection() failure", this)); return E_FAIL; } *pSelection = currentSel.ACP(); *pcFetched = 1; - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::GetSelection() succeeded", this)); return S_OK; } @@ -1901,7 +1901,7 @@ nsTextStore::LockedContent() mLockedContent.Init(text); } - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::LockedContent(): " "mLockedContent={ mText.Length()=%d }", this, mLockedContent.Text().Length())); @@ -1954,7 +1954,7 @@ nsTextStore::CurrentSelection() querySelection.GetWritingMode()); } - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::CurrentSelection(): " "acpStart=%d, acpEnd=%d (length=%d), reverted=%s", this, mSelection.StartOffset(), mSelection.EndOffset(), @@ -2005,10 +2005,10 @@ nsTextStore::GetDisplayAttribute(ITfProperty* aAttrProperty, HRESULT hr; - if (MOZ_LOG_TEST(sTextStoreLog, LogLevel::Debug)) { + if (PR_LOG_TEST(sTextStoreLog, PR_LOG_DEBUG)) { LONG start = 0, length = 0; hr = GetRangeExtent(aRange, &start, &length); - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::GetDisplayAttribute(): " "GetDisplayAttribute range=%ld-%ld (hr=%s)", this, start - mComposition.mStart, @@ -2020,13 +2020,13 @@ nsTextStore::GetDisplayAttribute(ITfProperty* aAttrProperty, ::VariantInit(&propValue); hr = aAttrProperty->GetValue(TfEditCookie(mEditCookie), aRange, &propValue); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetDisplayAttribute() FAILED due to " "ITfProperty::GetValue() failed", this)); return hr; } if (VT_I4 != propValue.vt) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetDisplayAttribute() FAILED due to " "ITfProperty::GetValue() returns non-VT_I4 value", this)); ::VariantClear(&propValue); @@ -2038,7 +2038,7 @@ nsTextStore::GetDisplayAttribute(ITfProperty* aAttrProperty, hr = sCategoryMgr->GetGUID(DWORD(propValue.lVal), &guid); ::VariantClear(&propValue); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetDisplayAttribute() FAILED due to " "ITfCategoryMgr::GetGUID() failed", this)); return hr; @@ -2049,7 +2049,7 @@ nsTextStore::GetDisplayAttribute(ITfProperty* aAttrProperty, hr = sDisplayAttrMgr->GetDisplayAttributeInfo(guid, getter_AddRefs(info), nullptr); if (FAILED(hr) || !info) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetDisplayAttribute() FAILED due to " "ITfDisplayAttributeMgr::GetDisplayAttributeInfo() failed", this)); return hr; @@ -2057,13 +2057,13 @@ nsTextStore::GetDisplayAttribute(ITfProperty* aAttrProperty, hr = info->GetAttributeInfo(aResult); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetDisplayAttribute() FAILED due to " "ITfDisplayAttributeInfo::GetAttributeInfo() failed", this)); return hr; } - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::GetDisplayAttribute() succeeded: " "Result={ %s }", this, GetDisplayAttrStr(*aResult).get())); return S_OK; @@ -2072,13 +2072,13 @@ nsTextStore::GetDisplayAttribute(ITfProperty* aAttrProperty, HRESULT nsTextStore::RestartCompositionIfNecessary(ITfRange* aRangeNew) { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::RestartCompositionIfNecessary(" "aRangeNew=0x%p), mComposition.mView=0x%p", this, aRangeNew, mComposition.mView.get())); if (!mComposition.IsComposing()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::RestartCompositionIfNecessary() FAILED " "due to no composition view", this)); return E_FAIL; @@ -2090,7 +2090,7 @@ nsTextStore::RestartCompositionIfNecessary(ITfRange* aRangeNew) if (!composingRange) { hr = pComposition->GetRange(getter_AddRefs(composingRange)); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::RestartCompositionIfNecessary() FAILED " "due to pComposition->GetRange() failure", this)); return hr; @@ -2101,13 +2101,13 @@ nsTextStore::RestartCompositionIfNecessary(ITfRange* aRangeNew) LONG compStart = 0, compLength = 0; hr = GetRangeExtent(composingRange, &compStart, &compLength); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::RestartCompositionIfNecessary() FAILED " "due to GetRangeExtent() failure", this)); return hr; } - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::RestartCompositionIfNecessary(), " "range=%ld-%ld, mComposition={ mStart=%ld, mString.Length()=%lu }", this, compStart, compStart + compLength, mComposition.mStart, @@ -2120,14 +2120,14 @@ nsTextStore::RestartCompositionIfNecessary(ITfRange* aRangeNew) // because a part of the original composition was committed. hr = RestartComposition(pComposition, composingRange); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::RestartCompositionIfNecessary() FAILED " "due to RestartComposition() failure", this)); return hr; } } - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::RestartCompositionIfNecessary() succeeded", this)); return S_OK; @@ -2143,7 +2143,7 @@ nsTextStore::RestartComposition(ITfCompositionView* aCompositionView, HRESULT hr = GetRangeExtent(aNewRange, &newStart, &newLength); LONG newEnd = newStart + newLength; - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::RestartComposition(aCompositionView=0x%p, " "aNewRange=0x%p { newStart=%d, newLength=%d }), " "mComposition={ mStart=%d, mCompositionString.Length()=%d }, " @@ -2154,14 +2154,14 @@ nsTextStore::RestartComposition(ITfCompositionView* aCompositionView, currentSelection.StartOffset(), currentSelection.Length())); if (currentSelection.IsDirty()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::RestartComposition() FAILED " "due to CurrentSelection() failure", this)); return E_FAIL; } if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::RestartComposition() FAILED " "due to GetRangeExtent() failure", this)); return hr; @@ -2198,7 +2198,7 @@ nsTextStore::RestartComposition(ITfCompositionView* aCompositionView, // Update the composition string. Content& lockedContent = LockedContent(); if (!lockedContent.IsInitialized()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::RestartComposition() FAILED " "due to LockedContent() failure", this)); return E_FAIL; @@ -2231,7 +2231,7 @@ nsTextStore::RestartComposition(ITfCompositionView* aCompositionView, keepComposingLength)); currentSelection = oldSelection; - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::RestartComposition() succeeded, " "mComposition={ mStart=%d, mCompositionString.Length()=%d }, " "currentSelection={ IsDirty()=%s, StartOffset()=%d, Length()=%d }", @@ -2289,7 +2289,7 @@ GetLineStyle(TF_DA_LINESTYLE aTSFLineStyle, uint8_t &aTextRangeLineStyle) HRESULT nsTextStore::RecordCompositionUpdateAction() { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::RecordCompositionUpdateAction(), " "mComposition={ mView=0x%p, mStart=%d, mString=\"%s\" " "(Length()=%d) }", @@ -2298,7 +2298,7 @@ nsTextStore::RecordCompositionUpdateAction() mComposition.mString.Length())); if (!mComposition.IsComposing()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::RecordCompositionUpdateAction() FAILED " "due to no composition view", this)); return E_FAIL; @@ -2316,7 +2316,7 @@ nsTextStore::RecordCompositionUpdateAction() HRESULT hr = mContext->GetProperty(GUID_PROP_ATTRIBUTE, getter_AddRefs(attrPropetry)); if (FAILED(hr) || !attrPropetry) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::RecordCompositionUpdateAction() FAILED " "due to mContext->GetProperty() failure", this)); return FAILED(hr) ? hr : E_FAIL; @@ -2325,7 +2325,7 @@ nsTextStore::RecordCompositionUpdateAction() nsRefPtr composingRange; hr = mComposition.mView->GetRange(getter_AddRefs(composingRange)); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::RecordCompositionUpdateAction() " "FAILED due to mComposition.mView->GetRange() failure", this)); return hr; @@ -2335,7 +2335,7 @@ nsTextStore::RecordCompositionUpdateAction() hr = attrPropetry->EnumRanges(TfEditCookie(mEditCookie), getter_AddRefs(enumRanges), composingRange); if (FAILED(hr) || !enumRanges) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::RecordCompositionUpdateAction() FAILED " "due to attrPropetry->EnumRanges() failure", this)); return FAILED(hr) ? hr : E_FAIL; @@ -2344,7 +2344,7 @@ nsTextStore::RecordCompositionUpdateAction() // First, put the log of content and selection here. Selection& currentSel = CurrentSelection(); if (currentSel.IsDirty()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::RecordCompositionUpdateAction() FAILED " "due to CurrentSelection() failure", this)); return E_FAIL; @@ -2381,7 +2381,7 @@ nsTextStore::RecordCompositionUpdateAction() mComposition.mStart); LONG length = end - start; if (length < 0) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::RecordCompositionUpdateAction() " "ignores invalid range (%d-%d)", this, rangeStart - mComposition.mStart, @@ -2389,7 +2389,7 @@ nsTextStore::RecordCompositionUpdateAction() continue; } if (!length) { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::RecordCompositionUpdateAction() " "ignores a range due to outside of the composition or empty " "(%d-%d)", @@ -2471,7 +2471,7 @@ nsTextStore::RecordCompositionUpdateAction() action->mIncomplete = false; - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::RecordCompositionUpdateAction() " "succeeded", this)); @@ -2482,7 +2482,7 @@ HRESULT nsTextStore::SetSelectionInternal(const TS_SELECTION_ACP* pSelection, bool aDispatchCompositionChangeEvent) { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::SetSelectionInternal(pSelection={ " "acpStart=%ld, acpEnd=%ld, style={ ase=%s, fInterimChar=%s} }, " "aDispatchCompositionChangeEvent=%s), mComposition.IsComposing()=%s", @@ -2496,7 +2496,7 @@ nsTextStore::SetSelectionInternal(const TS_SELECTION_ACP* pSelection, Selection& currentSel = CurrentSelection(); if (currentSel.IsDirty()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::SetSelectionInternal() FAILED due to " "CurrentSelection() failure", this)); return E_FAIL; @@ -2506,7 +2506,7 @@ nsTextStore::SetSelectionInternal(const TS_SELECTION_ACP* pSelection, if (aDispatchCompositionChangeEvent) { HRESULT hr = RestartCompositionIfNecessary(); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::SetSelectionInternal() FAILED due to " "RestartCompositionIfNecessary() failure", this)); return hr; @@ -2514,7 +2514,7 @@ nsTextStore::SetSelectionInternal(const TS_SELECTION_ACP* pSelection, } if (pSelection->acpStart < mComposition.mStart || pSelection->acpEnd > mComposition.EndOffset()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::SetSelectionInternal() FAILED due to " "the selection being out of the composition string", this)); return TS_E_INVALIDPOS; @@ -2524,7 +2524,7 @@ nsTextStore::SetSelectionInternal(const TS_SELECTION_ACP* pSelection, if (aDispatchCompositionChangeEvent) { HRESULT hr = RecordCompositionUpdateAction(); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::SetSelectionInternal() FAILED due to " "RecordCompositionUpdateAction() failure", this)); return hr; @@ -2549,7 +2549,7 @@ STDMETHODIMP nsTextStore::SetSelection(ULONG ulCount, const TS_SELECTION_ACP *pSelection) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::SetSelection(ulCount=%lu, pSelection=%p { " "acpStart=%ld, acpEnd=%ld, style={ ase=%s, fInterimChar=%s } }), " "mComposition.IsComposing()=%s", @@ -2561,19 +2561,19 @@ nsTextStore::SetSelection(ULONG ulCount, GetBoolName(mComposition.IsComposing()))); if (!IsReadWriteLocked()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::SetSelection() FAILED due to " "not locked (read-write)", this)); return TS_E_NOLOCK; } if (ulCount != 1) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::SetSelection() FAILED due to " "trying setting multiple selection", this)); return E_INVALIDARG; } if (!pSelection) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::SetSelection() FAILED due to " "null argument", this)); return E_INVALIDARG; @@ -2581,11 +2581,11 @@ nsTextStore::SetSelection(ULONG ulCount, HRESULT hr = SetSelectionInternal(pSelection, true); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::SetSelection() FAILED due to " "SetSelectionInternal() failure", this)); } else { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::SetSelection() succeeded", this)); } return hr; @@ -2602,7 +2602,7 @@ nsTextStore::GetText(LONG acpStart, ULONG *pulRunInfoOut, LONG *pacpNext) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::GetText(acpStart=%ld, acpEnd=%ld, pchPlain=0x%p, " "cchPlainReq=%lu, pcchPlainOut=0x%p, prgRunInfo=0x%p, ulRunInfoReq=%lu, " "pulRunInfoOut=0x%p, pacpNext=0x%p), mComposition={ mStart=%ld, " @@ -2613,7 +2613,7 @@ nsTextStore::GetText(LONG acpStart, GetBoolName(mComposition.IsComposing()))); if (!IsReadLocked()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetText() FAILED due to " "not locked (read)", this)); return TS_E_NOLOCK; @@ -2621,14 +2621,14 @@ nsTextStore::GetText(LONG acpStart, if (!pcchPlainOut || (!pchPlain && !prgRunInfo) || !cchPlainReq != !pchPlain || !ulRunInfoReq != !prgRunInfo) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetText() FAILED due to " "invalid argument", this)); return E_INVALIDARG; } if (acpStart < 0 || acpEnd < -1 || (acpEnd != -1 && acpStart > acpEnd)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetText() FAILED due to " "invalid position", this)); return TS_E_INVALIDPOS; @@ -2646,20 +2646,20 @@ nsTextStore::GetText(LONG acpStart, Content& lockedContent = LockedContent(); if (!lockedContent.IsInitialized()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetText() FAILED due to " "LockedContent() failure", this)); return E_FAIL; } if (lockedContent.Text().Length() < static_cast(acpStart)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetText() FAILED due to " "acpStart is larger offset than the actual text length", this)); return TS_E_INVALIDPOS; } if (acpEnd != -1 && lockedContent.Text().Length() < static_cast(acpEnd)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetText() FAILED due to " "acpEnd is larger offset than the actual text length", this)); return TS_E_INVALIDPOS; @@ -2686,7 +2686,7 @@ nsTextStore::GetText(LONG acpStart, if (pacpNext) *pacpNext = acpStart + length; } - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::GetText() succeeded: pcchPlainOut=0x%p, " "*prgRunInfo={ uCount=%lu, type=%s }, *pulRunInfoOut=%lu, " "*pacpNext=%ld)", @@ -2704,7 +2704,7 @@ nsTextStore::SetText(DWORD dwFlags, ULONG cch, TS_TEXTCHANGE *pChange) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::SetText(dwFlags=%s, acpStart=%ld, " "acpEnd=%ld, pchText=0x%p \"%s\", cch=%lu, pChange=0x%p), " "mComposition.IsComposing()=%s", @@ -2719,7 +2719,7 @@ nsTextStore::SetText(DWORD dwFlags, // ways to do this, this method acts as a helper to // call SetSelection followed by InsertTextAtSelection if (!IsReadWriteLocked()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::SetText() FAILED due to " "not locked (read)", this)); return TS_E_NOLOCK; @@ -2733,7 +2733,7 @@ nsTextStore::SetText(DWORD dwFlags, // Set selection to desired range HRESULT hr = SetSelectionInternal(&selection); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::SetText() FAILED due to " "SetSelectionInternal() failure", this)); return hr; @@ -2741,13 +2741,13 @@ nsTextStore::SetText(DWORD dwFlags, // Replace just selected text if (!InsertTextAtSelectionInternal(nsDependentSubstring(pchText, cch), pChange)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::SetText() FAILED due to " "InsertTextAtSelectionInternal() failure", this)); return E_FAIL; } - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::SetText() succeeded: pChange={ " "acpStart=%ld, acpOldEnd=%ld, acpNewEnd=%ld }", this, pChange ? pChange->acpStart : 0, @@ -2760,7 +2760,7 @@ nsTextStore::GetFormattedText(LONG acpStart, LONG acpEnd, IDataObject **ppDataObject) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::GetFormattedText() called " "but not supported (E_NOTIMPL)", this)); @@ -2774,7 +2774,7 @@ nsTextStore::GetEmbedded(LONG acpPos, REFIID riid, IUnknown **ppunk) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::GetEmbedded() called " "but not supported (E_NOTIMPL)", this)); @@ -2787,7 +2787,7 @@ nsTextStore::QueryInsertEmbedded(const GUID *pguidService, const FORMATETC *pFormatEtc, BOOL *pfInsertable) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::QueryInsertEmbedded() called " "but not supported, *pfInsertable=FALSE (S_OK)", this)); @@ -2803,7 +2803,7 @@ nsTextStore::InsertEmbedded(DWORD dwFlags, IDataObject *pDataObject, TS_TEXTCHANGE *pChange) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::InsertEmbedded() called " "but not supported (E_NOTIMPL)", this)); @@ -2882,7 +2882,7 @@ nsTextStore::HandleRequestAttrs(DWORD aFlags, ULONG aFilterCount, const TS_ATTRID* aFilterAttrs) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::HandleRequestAttrs(aFlags=%s, " "aFilterCount=%u)", this, GetFindFlagName(aFlags).get(), aFilterCount)); @@ -2899,7 +2899,7 @@ nsTextStore::HandleRequestAttrs(DWORD aFlags, mRequestedAttrValues = !!(aFlags & TS_ATTR_FIND_WANT_VALUE); for (uint32_t i = 0; i < aFilterCount; i++) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::HandleRequestAttrs(), " "requested attr=%s", this, GetGUIDNameStrWithTable(aFilterAttrs[i]).get())); @@ -2916,7 +2916,7 @@ nsTextStore::RequestSupportedAttrs(DWORD dwFlags, ULONG cFilterAttrs, const TS_ATTRID *paFilterAttrs) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::RequestSupportedAttrs(dwFlags=%s, " "cFilterAttrs=%lu)", this, GetFindFlagName(dwFlags).get(), cFilterAttrs)); @@ -2930,7 +2930,7 @@ nsTextStore::RequestAttrsAtPosition(LONG acpPos, const TS_ATTRID *paFilterAttrs, DWORD dwFlags) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::RequestAttrsAtPosition(acpPos=%ld, " "cFilterAttrs=%lu, dwFlags=%s)", this, acpPos, cFilterAttrs, GetFindFlagName(dwFlags).get())); @@ -2945,7 +2945,7 @@ nsTextStore::RequestAttrsTransitioningAtPosition(LONG acpPos, const TS_ATTRID *paFilterAttr, DWORD dwFlags) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::RequestAttrsTransitioningAtPosition(" "acpPos=%ld, cFilterAttrs=%lu, dwFlags=%s) called but not supported " "(S_OK)", @@ -2966,13 +2966,13 @@ nsTextStore::FindNextAttrTransition(LONG acpStart, LONG *plFoundOffset) { if (!pacpNext || !pfFound || !plFoundOffset) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::FindNextAttrTransition() FAILED due to " "null argument", this)); return E_INVALIDARG; } - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::FindNextAttrTransition() called " "but not supported (S_OK)", this)); @@ -2988,7 +2988,7 @@ nsTextStore::RetrieveRequestedAttrs(ULONG ulCount, ULONG *pcFetched) { if (!pcFetched || !paAttrVals) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::RetrieveRequestedAttrs() FAILED due to " "null argument", this)); return E_INVALIDARG; @@ -3001,14 +3001,14 @@ nsTextStore::RetrieveRequestedAttrs(ULONG ulCount, } } if (ulCount < expectedCount) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::RetrieveRequestedAttrs() FAILED due to " "not enough count ulCount=%u, expectedCount=%u", this, ulCount, expectedCount)); return E_INVALIDARG; } - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::RetrieveRequestedAttrs() called " "ulCount=%d, mRequestedAttrValues=%s", this, ulCount, GetBoolName(mRequestedAttrValues))); @@ -3022,7 +3022,7 @@ nsTextStore::RetrieveRequestedAttrs(ULONG ulCount, TS_ATTRID attrID = GetAttrID(i); - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::RetrieveRequestedAttrs() for %s", this, GetGUIDNameStrWithTable(attrID).get())); @@ -3069,7 +3069,7 @@ nsTextStore::RetrieveRequestedAttrs(ULONG ulCount, return S_OK; } - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::RetrieveRequestedAttrs() called " "for unknown TS_ATTRVAL, *pcFetched=0 (S_OK)", this)); @@ -3082,18 +3082,18 @@ nsTextStore::RetrieveRequestedAttrs(ULONG ulCount, STDMETHODIMP nsTextStore::GetEndACP(LONG *pacp) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::GetEndACP(pacp=0x%p)", this, pacp)); if (!IsReadLocked()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetEndACP() FAILED due to " "not locked (read)", this)); return TS_E_NOLOCK; } if (!pacp) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetEndACP() FAILED due to " "null argument", this)); return E_INVALIDARG; @@ -3101,7 +3101,7 @@ nsTextStore::GetEndACP(LONG *pacp) Content& lockedContent = LockedContent(); if (!lockedContent.IsInitialized()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetEndACP() FAILED due to " "LockedContent() failure", this)); return E_FAIL; @@ -3113,11 +3113,11 @@ nsTextStore::GetEndACP(LONG *pacp) STDMETHODIMP nsTextStore::GetActiveView(TsViewCookie *pvcView) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::GetActiveView(pvcView=0x%p)", this, pvcView)); if (!pvcView) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetActiveView() FAILED due to " "null argument", this)); return E_INVALIDARG; @@ -3125,7 +3125,7 @@ nsTextStore::GetActiveView(TsViewCookie *pvcView) *pvcView = TEXTSTORE_DEFAULT_VIEW; - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::GetActiveView() succeeded: *pvcView=%ld", this, *pvcView)); return S_OK; @@ -3137,42 +3137,42 @@ nsTextStore::GetACPFromPoint(TsViewCookie vcView, DWORD dwFlags, LONG *pacp) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::GetACPFromPoint(pvcView=%d, pt=%p (x=%d, " "y=%d), dwFlags=%s, pacp=%p", this, vcView, pt, pt ? pt->x : 0, pt ? pt->y : 0, GetACPFromPointFlagName(dwFlags).get(), pacp)); if (!IsReadLocked()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetACPFromPoint() FAILED due to " "not locked (read)", this)); return TS_E_NOLOCK; } if (vcView != TEXTSTORE_DEFAULT_VIEW) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetACPFromPoint() FAILED due to " "called with invalid view", this)); return E_INVALIDARG; } if (!pt) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetACPFromPoint() FAILED due to " "null pt", this)); return E_INVALIDARG; } if (!pacp) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetACPFromPoint() FAILED due to " "null pacp", this)); return E_INVALIDARG; } if (mLockedContent.IsLayoutChanged()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetACPFromPoint() FAILED due to " "layout not recomputed", this)); mPendingOnLayoutChange = true; @@ -3194,20 +3194,20 @@ nsTextStore::GetACPFromPoint(TsViewCookie vcView, nsRefPtr kungFuDeathGrip(this); mWidget->DispatchWindowEvent(&charAtPt); if (!mWidget || mWidget->Destroyed()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetACPFromPoint() FAILED due to " "mWidget was destroyed during NS_QUERY_CHARACTER_AT_POINT", this)); return E_FAIL; } - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::GetACPFromPoint(), charAtPt={ " "mSucceeded=%s, mReply={ mOffset=%u, mTentativeCaretOffset=%u }}", this, GetBoolName(charAtPt.mSucceeded), charAtPt.mReply.mOffset, charAtPt.mReply.mTentativeCaretOffset)); if (NS_WARN_IF(!charAtPt.mSucceeded)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetACPFromPoint() FAILED due to " "NS_QUERY_CHARACTER_AT_POINT failure", this)); return E_FAIL; @@ -3217,7 +3217,7 @@ nsTextStore::GetACPFromPoint(TsViewCookie vcView, // we should return TS_E_INVALIDPOINT. if (!(dwFlags & GXFPF_NEAREST) && charAtPt.mReply.mOffset == WidgetQueryContentEvent::NOT_FOUND) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetACPFromPoint() FAILED due to the " "point contained by no bounding box", this)); return TS_E_INVALIDPOINT; @@ -3255,7 +3255,7 @@ nsTextStore::GetACPFromPoint(TsViewCookie vcView, // offset. Content& lockedContent = LockedContent(); if (!lockedContent.IsInitialized()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetACPFromPoint() FAILED due to " "LockedContent() failure", this)); return E_FAIL; @@ -3268,14 +3268,14 @@ nsTextStore::GetACPFromPoint(TsViewCookie vcView, } if (NS_WARN_IF(offset > LONG_MAX)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetACPFromPoint() FAILED due to out of " "range of the result", this)); return TS_E_INVALIDPOINT; } *pacp = static_cast(offset); - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::GetACPFromPoint() succeeded: *pacp=%d", this, *pacp)); return S_OK; @@ -3288,34 +3288,34 @@ nsTextStore::GetTextExt(TsViewCookie vcView, RECT *prc, BOOL *pfClipped) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::GetTextExt(vcView=%ld, " "acpStart=%ld, acpEnd=%ld, prc=0x%p, pfClipped=0x%p)", this, vcView, acpStart, acpEnd, prc, pfClipped)); if (!IsReadLocked()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetTextExt() FAILED due to " "not locked (read)", this)); return TS_E_NOLOCK; } if (vcView != TEXTSTORE_DEFAULT_VIEW) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetTextExt() FAILED due to " "called with invalid view", this)); return E_INVALIDARG; } if (!prc || !pfClipped) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetTextExt() FAILED due to " "null argument", this)); return E_INVALIDARG; } if (acpStart < 0 || acpEnd < acpStart) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetTextExt() FAILED due to " "invalid position", this)); return TS_E_INVALIDPOS; @@ -3342,7 +3342,7 @@ nsTextStore::GetTextExt(TsViewCookie vcView, sDoNotReturnNoLayoutErrorToGoogleJaInputAtFirstChar && kSink->IsGoogleJapaneseInputActive()) { acpEnd = acpStart; - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::GetTextExt() hacked the offsets of " "the first character of changing range of the composition " "string for TIP acpStart=%d, acpEnd=%d", @@ -3358,7 +3358,7 @@ nsTextStore::GetTextExt(TsViewCookie vcView, sDoNotReturnNoLayoutErrorToGoogleJaInputAtCaret && kSink->IsGoogleJapaneseInputActive()) { acpEnd = acpStart = mLockedContent.MinOffsetOfLayoutChanged(); - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::GetTextExt() hacked the offsets of " "the caret of the composition string for TIP acpStart=%d, " "acpEnd=%d", this, acpStart, acpEnd)); @@ -3374,14 +3374,14 @@ nsTextStore::GetTextExt(TsViewCookie vcView, kSink->IsEasyChangjeiActive())) { acpEnd = mComposition.mStart; acpStart = std::min(acpStart, acpEnd); - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::GetTextExt() hacked the offsets for " "TIP acpStart=%d, acpEnd=%d", this, acpStart, acpEnd)); } } if (mLockedContent.IsLayoutChangedAfter(acpEnd)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetTextExt() FAILED due to " "layout not recomputed at %d", this, acpEnd)); mPendingOnLayoutChange = true; @@ -3394,7 +3394,7 @@ nsTextStore::GetTextExt(TsViewCookie vcView, event.InitForQueryTextRect(acpStart, acpEnd - acpStart); mWidget->DispatchWindowEvent(&event); if (!event.mSucceeded) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetTextExt() FAILED due to " "NS_QUERY_TEXT_RECT failure", this)); return TS_E_INVALIDPOS; // but unexpected failure, maybe. @@ -3411,7 +3411,7 @@ nsTextStore::GetTextExt(TsViewCookie vcView, // Result rect is in top level widget coordinates refWindow = refWindow->GetTopLevelWindow(false); if (!refWindow) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetTextExt() FAILED due to " "no top level window", this)); return E_FAIL; @@ -3421,7 +3421,7 @@ nsTextStore::GetTextExt(TsViewCookie vcView, // get bounding screen rect to test for clipping if (!GetScreenExtInternal(*prc)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetTextExt() FAILED due to " "GetScreenExtInternal() failure", this)); return E_FAIL; @@ -3452,7 +3452,7 @@ nsTextStore::GetTextExt(TsViewCookie vcView, CreateNativeCaret(); } - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::GetTextExt() succeeded: " "*prc={ left=%ld, top=%ld, right=%ld, bottom=%ld }, *pfClipped=%s", this, prc->left, prc->top, prc->right, prc->bottom, @@ -3465,32 +3465,32 @@ STDMETHODIMP nsTextStore::GetScreenExt(TsViewCookie vcView, RECT *prc) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::GetScreenExt(vcView=%ld, prc=0x%p)", this, vcView, prc)); if (vcView != TEXTSTORE_DEFAULT_VIEW) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetScreenExt() FAILED due to " "called with invalid view", this)); return E_INVALIDARG; } if (!prc) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetScreenExt() FAILED due to " "null argument", this)); return E_INVALIDARG; } if (!GetScreenExtInternal(*prc)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetScreenExt() FAILED due to " "GetScreenExtInternal() failure", this)); return E_FAIL; } - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::GetScreenExt() succeeded: " "*prc={ left=%ld, top=%ld, right=%ld, bottom=%ld }", this, prc->left, prc->top, prc->right, prc->bottom)); @@ -3500,7 +3500,7 @@ nsTextStore::GetScreenExt(TsViewCookie vcView, bool nsTextStore::GetScreenExtInternal(RECT &aScreenExt) { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::GetScreenExtInternal()", this)); // use NS_QUERY_EDITOR_RECT to get rect in system, screen coordinates @@ -3508,7 +3508,7 @@ nsTextStore::GetScreenExtInternal(RECT &aScreenExt) mWidget->InitEvent(event); mWidget->DispatchWindowEvent(&event); if (!event.mSucceeded) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetScreenExtInternal() FAILED due to " "NS_QUERY_EDITOR_RECT failure", this)); return false; @@ -3520,7 +3520,7 @@ nsTextStore::GetScreenExtInternal(RECT &aScreenExt) // Result rect is in top level widget coordinates refWindow = refWindow->GetTopLevelWindow(false); if (!refWindow) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetScreenExtInternal() FAILED due to " "no top level window", this)); return false; @@ -3528,7 +3528,7 @@ nsTextStore::GetScreenExtInternal(RECT &aScreenExt) nsIntRect boundRect; if (NS_FAILED(refWindow->GetClientBounds(boundRect))) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetScreenExtInternal() FAILED due to " "failed to get the client bounds", this)); return false; @@ -3546,7 +3546,7 @@ nsTextStore::GetScreenExtInternal(RECT &aScreenExt) ::SetRectEmpty(&aScreenExt); } - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::GetScreenExtInternal() succeeded: " "aScreenExt={ left=%ld, top=%ld, right=%ld, bottom=%ld }", this, aScreenExt.left, aScreenExt.top, @@ -3558,20 +3558,20 @@ STDMETHODIMP nsTextStore::GetWnd(TsViewCookie vcView, HWND *phwnd) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::GetWnd(vcView=%ld, phwnd=0x%p), " "mWidget=0x%p", this, vcView, phwnd, mWidget.get())); if (vcView != TEXTSTORE_DEFAULT_VIEW) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetWnd() FAILED due to " "called with invalid view", this)); return E_INVALIDARG; } if (!phwnd) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::GetScreenExt() FAILED due to " "null argument", this)); return E_INVALIDARG; @@ -3579,7 +3579,7 @@ nsTextStore::GetWnd(TsViewCookie vcView, *phwnd = mWidget->GetWindowHandle(); - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::GetWnd() succeeded: *phwnd=0x%p", this, static_cast(*phwnd))); return S_OK; @@ -3593,7 +3593,7 @@ nsTextStore::InsertTextAtSelection(DWORD dwFlags, LONG *pacpEnd, TS_TEXTCHANGE *pChange) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::InsertTextAtSelection(dwFlags=%s, " "pchText=0x%p \"%s\", cch=%lu, pacpStart=0x%p, pacpEnd=0x%p, " "pChange=0x%p), IsComposing()=%s", @@ -3606,7 +3606,7 @@ nsTextStore::InsertTextAtSelection(DWORD dwFlags, GetBoolName(mComposition.IsComposing()))); if (cch && !pchText) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::InsertTextAtSelection() FAILED due to " "null pchText", this)); return E_INVALIDARG; @@ -3614,14 +3614,14 @@ nsTextStore::InsertTextAtSelection(DWORD dwFlags, if (TS_IAS_QUERYONLY == dwFlags) { if (!IsReadLocked()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::InsertTextAtSelection() FAILED due to " "not locked (read)", this)); return TS_E_NOLOCK; } if (!pacpStart || !pacpEnd) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::InsertTextAtSelection() FAILED due to " "null argument", this)); return E_INVALIDARG; @@ -3630,7 +3630,7 @@ nsTextStore::InsertTextAtSelection(DWORD dwFlags, // Get selection first Selection& currentSel = CurrentSelection(); if (currentSel.IsDirty()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::InsertTextAtSelection() FAILED due to " "CurrentSelection() failure", this)); return E_FAIL; @@ -3646,21 +3646,21 @@ nsTextStore::InsertTextAtSelection(DWORD dwFlags, } } else { if (!IsReadWriteLocked()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::InsertTextAtSelection() FAILED due to " "not locked (read-write)", this)); return TS_E_NOLOCK; } if (!pChange) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::InsertTextAtSelection() FAILED due to " "null pChange", this)); return E_INVALIDARG; } if (TS_IAS_NOQUERY != dwFlags && (!pacpStart || !pacpEnd)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::InsertTextAtSelection() FAILED due to " "null argument", this)); return E_INVALIDARG; @@ -3668,7 +3668,7 @@ nsTextStore::InsertTextAtSelection(DWORD dwFlags, if (!InsertTextAtSelectionInternal(nsDependentSubstring(pchText, cch), pChange)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::InsertTextAtSelection() FAILED due to " "InsertTextAtSelectionInternal() failure", this)); return E_FAIL; @@ -3679,7 +3679,7 @@ nsTextStore::InsertTextAtSelection(DWORD dwFlags, *pacpEnd = pChange->acpNewEnd; } } - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::InsertTextAtSelection() succeeded: " "*pacpStart=%ld, *pacpEnd=%ld, " "*pChange={ acpStart=%ld, acpOldEnd=%ld, acpNewEnd=%ld })", @@ -3693,7 +3693,7 @@ bool nsTextStore::InsertTextAtSelectionInternal(const nsAString &aInsertStr, TS_TEXTCHANGE* aTextChange) { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::InsertTextAtSelectionInternal(" "aInsertStr=\"%s\", aTextChange=0x%p), IsComposing=%s", this, NS_ConvertUTF16toUTF8(aInsertStr).get(), aTextChange, @@ -3701,7 +3701,7 @@ nsTextStore::InsertTextAtSelectionInternal(const nsAString &aInsertStr, Content& lockedContent = LockedContent(); if (!lockedContent.IsInitialized()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::InsertTextAtSelectionInternal() failed " "due to LockedContent() failure()", this)); return false; @@ -3729,7 +3729,7 @@ nsTextStore::InsertTextAtSelectionInternal(const nsAString &aInsertStr, aTextChange->acpNewEnd = lockedContent.Selection().EndOffset(); } - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::InsertTextAtSelectionInternal() succeeded: " "mWidget=0x%p, mWidget->Destroyed()=%s, aTextChange={ acpStart=%ld, " "acpOldEnd=%ld, acpNewEnd=%ld }", @@ -3748,7 +3748,7 @@ nsTextStore::InsertEmbeddedAtSelection(DWORD dwFlags, LONG *pacpEnd, TS_TEXTCHANGE *pChange) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::InsertEmbeddedAtSelection() called " "but not supported (E_NOTIMPL)", this)); @@ -3761,7 +3761,7 @@ nsTextStore::RecordCompositionStartAction(ITfCompositionView* aComposition, ITfRange* aRange, bool aPreserveSelection) { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::RecordCompositionStartAction(" "aComposition=0x%p, aRange=0x%p, aPreserveSelection=%s), " "mComposition.mView=0x%p", @@ -3771,7 +3771,7 @@ nsTextStore::RecordCompositionStartAction(ITfCompositionView* aComposition, LONG start = 0, length = 0; HRESULT hr = GetRangeExtent(aRange, &start, &length); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::RecordCompositionStartAction() FAILED " "due to GetRangeExtent() failure", this)); return hr; @@ -3787,7 +3787,7 @@ nsTextStore::RecordCompositionStartAction(ITfCompositionView* aComposition, LONG aLength, bool aPreserveSelection) { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::RecordCompositionStartAction(" "aComposition=0x%p, aStart=%d, aLength=%d, aPreserveSelection=%s), " "mComposition.mView=0x%p", @@ -3796,7 +3796,7 @@ nsTextStore::RecordCompositionStartAction(ITfCompositionView* aComposition, Content& lockedContent = LockedContent(); if (!lockedContent.IsInitialized()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::RecordCompositionStartAction() FAILED " "due to LockedContent() failure", this)); return E_FAIL; @@ -3810,7 +3810,7 @@ nsTextStore::RecordCompositionStartAction(ITfCompositionView* aComposition, Selection& currentSel = CurrentSelection(); if (currentSel.IsDirty()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::RecordCompositionStartAction() FAILED " "due to CurrentSelection() failure", this)); action->mAdjustSelection = true; @@ -3829,7 +3829,7 @@ nsTextStore::RecordCompositionStartAction(ITfCompositionView* aComposition, lockedContent.StartComposition(aComposition, *action, aPreserveSelection); - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::RecordCompositionStartAction() succeeded: " "mComposition={ mStart=%ld, mString.Length()=%ld, " "mSelection={ acpStart=%ld, acpEnd=%ld, style.ase=%s, " @@ -3844,7 +3844,7 @@ nsTextStore::RecordCompositionStartAction(ITfCompositionView* aComposition, HRESULT nsTextStore::RecordCompositionEndAction() { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::RecordCompositionEndAction(), " "mComposition={ mView=0x%p, mString=\"%s\" }", this, mComposition.mView.get(), @@ -3859,14 +3859,14 @@ nsTextStore::RecordCompositionEndAction() Content& lockedContent = LockedContent(); if (!lockedContent.IsInitialized()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::RecordCompositionEndAction() FAILED due " "to LockedContent() failure", this)); return E_FAIL; } lockedContent.EndComposition(*action); - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::RecordCompositionEndAction(), succeeded", this)); return S_OK; @@ -3876,7 +3876,7 @@ STDMETHODIMP nsTextStore::OnStartComposition(ITfCompositionView* pComposition, BOOL* pfOk) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::OnStartComposition(pComposition=0x%p, " "pfOk=0x%p), mComposition.mView=0x%p", this, pComposition, pfOk, mComposition.mView.get())); @@ -3887,7 +3887,7 @@ nsTextStore::OnStartComposition(ITfCompositionView* pComposition, // Only one composition at a time if (mComposition.IsComposing()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::OnStartComposition() FAILED due to " "there is another composition already (but returns S_OK)", this)); return S_OK; @@ -3896,21 +3896,21 @@ nsTextStore::OnStartComposition(ITfCompositionView* pComposition, nsRefPtr range; HRESULT hr = pComposition->GetRange(getter_AddRefs(range)); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::OnStartComposition() FAILED due to " "pComposition->GetRange() failure", this)); return hr; } hr = RecordCompositionStartAction(pComposition, range, false); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::OnStartComposition() FAILED due to " "RecordCompositionStartAction() failure", this)); return hr; } *pfOk = TRUE; - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::OnStartComposition() succeeded", this)); return S_OK; } @@ -3919,7 +3919,7 @@ STDMETHODIMP nsTextStore::OnUpdateComposition(ITfCompositionView* pComposition, ITfRange* pRangeNew) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::OnUpdateComposition(pComposition=0x%p, " "pRangeNew=0x%p), mComposition.mView=0x%p", this, pComposition, pRangeNew, mComposition.mView.get())); @@ -3927,19 +3927,19 @@ nsTextStore::OnUpdateComposition(ITfCompositionView* pComposition, AutoPendingActionAndContentFlusher flusher(this); if (!mDocumentMgr || !mContext) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::OnUpdateComposition() FAILED due to " "not ready for the composition", this)); return E_UNEXPECTED; } if (!mComposition.IsComposing()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::OnUpdateComposition() FAILED due to " "no active composition", this)); return E_UNEXPECTED; } if (mComposition.mView != pComposition) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::OnUpdateComposition() FAILED due to " "different composition view specified", this)); return E_UNEXPECTED; @@ -3949,7 +3949,7 @@ nsTextStore::OnUpdateComposition(ITfCompositionView* pComposition, if (!pRangeNew) { PendingAction* action = LastOrNewPendingCompositionUpdate(); action->mIncomplete = true; - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::OnUpdateComposition() succeeded but " "not complete", this)); return S_OK; @@ -3957,7 +3957,7 @@ nsTextStore::OnUpdateComposition(ITfCompositionView* pComposition, HRESULT hr = RestartCompositionIfNecessary(pRangeNew); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::OnUpdateComposition() FAILED due to " "RestartCompositionIfNecessary() failure", this)); return hr; @@ -3965,21 +3965,21 @@ nsTextStore::OnUpdateComposition(ITfCompositionView* pComposition, hr = RecordCompositionUpdateAction(); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::OnUpdateComposition() FAILED due to " "RecordCompositionUpdateAction() failure", this)); return hr; } - if (MOZ_LOG_TEST(sTextStoreLog, LogLevel::Info)) { + if (PR_LOG_TEST(sTextStoreLog, PR_LOG_ALWAYS)) { Selection& currentSel = CurrentSelection(); if (currentSel.IsDirty()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::OnUpdateComposition() FAILED due to " "CurrentSelection() failure", this)); return E_FAIL; } - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::OnUpdateComposition() succeeded: " "mComposition={ mStart=%ld, mString=\"%s\" }, " "CurrentSelection()={ acpStart=%ld, acpEnd=%ld, style.ase=%s }", @@ -3994,7 +3994,7 @@ nsTextStore::OnUpdateComposition(ITfCompositionView* pComposition, STDMETHODIMP nsTextStore::OnEndComposition(ITfCompositionView* pComposition) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::OnEndComposition(pComposition=0x%p), " "mComposition={ mView=0x%p, mString=\"%s\" }", this, pComposition, mComposition.mView.get(), @@ -4003,14 +4003,14 @@ nsTextStore::OnEndComposition(ITfCompositionView* pComposition) AutoPendingActionAndContentFlusher flusher(this); if (!mComposition.IsComposing()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::OnEndComposition() FAILED due to " "no active composition", this)); return E_UNEXPECTED; } if (mComposition.mView != pComposition) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::OnEndComposition() FAILED due to " "different composition view specified", this)); return E_UNEXPECTED; @@ -4018,13 +4018,13 @@ nsTextStore::OnEndComposition(ITfCompositionView* pComposition) HRESULT hr = RecordCompositionEndAction(); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::OnEndComposition() FAILED due to " "RecordCompositionEndAction() failure", this)); return hr; } - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::OnEndComposition(), succeeded", this)); return S_OK; } @@ -4034,12 +4034,12 @@ nsTextStore::AdviseMouseSink(ITfRangeACP* range, ITfMouseSink* pSink, DWORD* pdwCookie) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::AdviseMouseSink(range=0x%p, pSink=0x%p, " "pdwCookie=0x%p)", this, range, pSink, pdwCookie)); if (!pdwCookie) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::AdviseMouseSink() FAILED due to the " "pdwCookie is null", this)); return E_INVALIDARG; @@ -4048,13 +4048,13 @@ nsTextStore::AdviseMouseSink(ITfRangeACP* range, *pdwCookie = MouseTracker::kInvalidCookie; if (!range) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::AdviseMouseSink() FAILED due to the " "range is null", this)); return E_INVALIDARG; } if (!pSink) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::AdviseMouseSink() FAILED due to the " "pSink is null", this)); return E_INVALIDARG; @@ -4074,7 +4074,7 @@ nsTextStore::AdviseMouseSink(ITfRangeACP* range, tracker = mMouseTrackers.AppendElement(); HRESULT hr = tracker->Init(this); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::AdviseMouseSink() FAILED due to " "failure of MouseTracker::Init()", this)); return hr; @@ -4082,13 +4082,13 @@ nsTextStore::AdviseMouseSink(ITfRangeACP* range, } HRESULT hr = tracker->AdviseSink(this, range, pSink); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::AdviseMouseSink() FAILED due to failure " "of MouseTracker::Init()", this)); return hr; } *pdwCookie = tracker->Cookie(); - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::AdviseMouseSink(), succeeded, " "*pdwCookie=%d", this, *pdwCookie)); return S_OK; @@ -4097,11 +4097,11 @@ nsTextStore::AdviseMouseSink(ITfRangeACP* range, STDMETHODIMP nsTextStore::UnadviseMouseSink(DWORD dwCookie) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::UnadviseMouseSink(dwCookie=%d)", this, dwCookie)); if (dwCookie == MouseTracker::kInvalidCookie) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::UnadviseMouseSink() FAILED due to " "the cookie is invalid value", this)); return E_INVALIDARG; @@ -4109,20 +4109,20 @@ nsTextStore::UnadviseMouseSink(DWORD dwCookie) // The cookie value must be an index of mMouseTrackers. // We can use this shortcut for now. if (static_cast(dwCookie) >= mMouseTrackers.Length()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::UnadviseMouseSink() FAILED due to " "the cookie is too large value", this)); return E_INVALIDARG; } MouseTracker& tracker = mMouseTrackers[dwCookie]; if (!tracker.IsUsing()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::UnadviseMouseSink() FAILED due to " "the found tracker uninstalled already", this)); return E_INVALIDARG; } tracker.UnadviseSink(); - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::UnadviseMouseSink(), succeeded", this)); return S_OK; } @@ -4133,7 +4133,7 @@ nsTextStore::OnFocusChange(bool aGotFocus, nsWindowBase* aFocusedWidget, const InputContext& aContext) { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: nsTextStore::OnFocusChange(aGotFocus=%s, " "aFocusedWidget=0x%p, aContext={ mIMEState={ mEnabled=%s }, " "mHTMLInputType=\"%s\" }), " @@ -4171,7 +4171,7 @@ nsTextStore::OnFocusChange(bool aGotFocus, if (!aGotFocus || !aContext.mIMEState.IsEditable()) { HRESULT hr = sThreadMgr->SetFocus(sDisabledDocumentMgr); if (NS_WARN_IF(FAILED(hr))) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: nsTextStore::OnFocusChange() FAILED due to " "ITfThreadMgr::SetFocus() failure")); return NS_ERROR_FAILURE; @@ -4181,7 +4181,7 @@ nsTextStore::OnFocusChange(bool aGotFocus, // If an editor is getting focus, create new TextStore and set focus. if (NS_WARN_IF(!CreateAndSetFocus(aFocusedWidget, aContext))) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: nsTextStore::OnFocusChange() FAILED due to " "ITfThreadMgr::CreateAndSetFocus() failure")); // If setting focus, we should destroy the TextStore completely because @@ -4205,13 +4205,13 @@ nsTextStore::CreateAndSetFocus(nsWindowBase* aFocusedWidget, // So, we should set sEnabledTextStore directly. sEnabledTextStore = new nsTextStore(); if (NS_WARN_IF(!sEnabledTextStore->Init(aFocusedWidget))) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: nsTextStore::CreateAndSetFocus() FAILED due to " "nsTextStore::Init() failure")); return false; } if (NS_WARN_IF(!sEnabledTextStore->mDocumentMgr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: nsTextStore::CreateAndSetFocus() FAILED due to " "invalid nsTextStore::mDocumentMgr")); return false; @@ -4226,7 +4226,7 @@ nsTextStore::CreateAndSetFocus(nsWindowBase* aFocusedWidget, } HRESULT hr = sThreadMgr->SetFocus(sEnabledTextStore->mDocumentMgr); if (NS_WARN_IF(FAILED(hr))) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: nsTextStore::CreateAndSetFocus() FAILED due to " "ITfTheadMgr::SetFocus() failure")); return false; @@ -4238,7 +4238,7 @@ nsTextStore::CreateAndSetFocus(nsWindowBase* aFocusedWidget, sEnabledTextStore->mDocumentMgr, getter_AddRefs(prevFocusedDocumentMgr)); if (NS_WARN_IF(FAILED(hr))) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: nsTextStore::CreateAndSetFocus() FAILED due to " "ITfTheadMgr::AssociateFocus() failure")); return false; @@ -4273,7 +4273,7 @@ nsTextStore::GetIMEUpdatePreference() nsresult nsTextStore::OnTextChangeInternal(const IMENotification& aIMENotification) { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::OnTextChangeInternal(aIMENotification={ " "mMessage=0x%08X, mTextChangeData={ mStartOffset=%lu, " "mOldEndOffset=%lu, mNewEndOffset=%lu}), mSink=0x%p, mSinkMask=%s, " @@ -4296,7 +4296,7 @@ nsTextStore::OnTextChangeInternal(const IMENotification& aIMENotification) } if (!aIMENotification.mTextChangeData.IsInInt32Range()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::OnTextChangeInternal() FAILED due to " "offset is too big for calling mSink->OnTextChange()...", this)); @@ -4307,7 +4307,7 @@ nsTextStore::OnTextChangeInternal(const IMENotification& aIMENotification) // Especially, some of them stop working for composition in our process. // For preventing it, let's commit the composition. if (mComposition.IsComposing()) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::OnTextChangeInternal(), " "committing the composition for avoiding making TIP confused...", this)); @@ -4323,7 +4323,7 @@ nsTextStore::OnTextChangeInternal(const IMENotification& aIMENotification) textChange.acpNewEnd = static_cast(aIMENotification.mTextChangeData.mNewEndOffset); - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::OnTextChangeInternal(), calling " "mSink->OnTextChange(0, { acpStart=%ld, acpOldEnd=%ld, " "acpNewEnd=%ld })...", this, textChange.acpStart, @@ -4336,7 +4336,7 @@ nsTextStore::OnTextChangeInternal(const IMENotification& aIMENotification) nsresult nsTextStore::OnSelectionChangeInternal(void) { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::OnSelectionChangeInternal(), " "mSink=0x%p, mSinkMask=%s, mIsRecordingActionsWithoutLock=%s, " "mComposition.IsComposing()=%s", @@ -4358,7 +4358,7 @@ nsTextStore::OnSelectionChangeInternal(void) // Especially, some of them stop working for composition in our process. // For preventing it, let's commit the composition. if (mComposition.IsComposing()) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::OnSelectionChangeInternal(), " "committing the composition for avoiding making TIP confused...", this)); @@ -4367,12 +4367,12 @@ nsTextStore::OnSelectionChangeInternal(void) } if (!mIsRecordingActionsWithoutLock) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::OnSelectionChangeInternal(), calling " "mSink->OnSelectionChange()...", this)); mSink->OnSelectionChange(); } else { - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::OnSelectionChangeInternal(), pending " "a call of mSink->OnSelectionChange()...", this)); mPendingOnSelectionChange = true; @@ -4386,7 +4386,7 @@ nsTextStore::OnLayoutChangeInternal() NS_ENSURE_TRUE(mContext, NS_ERROR_FAILURE); NS_ENSURE_TRUE(mSink, NS_ERROR_FAILURE); - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::OnLayoutChangeInternal(), calling " "mSink->OnLayoutChange()...", this)); HRESULT hr = mSink->OnLayoutChange(TS_LC_CHANGE, TEXTSTORE_DEFAULT_VIEW); @@ -4402,7 +4402,7 @@ nsTextStore::OnMouseButtonEventInternal(const IMENotification& aIMENotification) return NS_OK; } - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::OnMouseButtonEventInternal(" "aIMENotification={ mEventMessage=%s, mOffset=%u, mCursorPos={ " "mX=%d, mY=%d }, mCharRect={ mX=%d, mY=%d, mWidth=%d, mHeight=%d }, " @@ -4472,14 +4472,14 @@ nsTextStore::OnMouseButtonEventInternal(const IMENotification& aIMENotification) void nsTextStore::CreateNativeCaret() { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::CreateNativeCaret(), " "mComposition.IsComposing()=%s", this, GetBoolName(mComposition.IsComposing()))); Selection& currentSel = CurrentSelection(); if (currentSel.IsDirty()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::CreateNativeCaret() FAILED due to " "CurrentSelection() failure", this)); return; @@ -4494,7 +4494,7 @@ nsTextStore::CreateNativeCaret() mWidget->InitEvent(queryCaretRect); mWidget->DispatchWindowEvent(&queryCaretRect); if (!queryCaretRect.mSucceeded) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::CreateNativeCaret() FAILED due to " "NS_QUERY_CARET_RECT failure (offset=%d)", this, caretOffset)); return; @@ -4504,7 +4504,7 @@ nsTextStore::CreateNativeCaret() mNativeCaretIsCreated = ::CreateCaret(mWidget->GetWindowHandle(), nullptr, caretRect.width, caretRect.height); if (!mNativeCaretIsCreated) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::CreateNativeCaret() FAILED due to " "CreateCaret() failure", this)); return; @@ -4513,7 +4513,7 @@ nsTextStore::CreateNativeCaret() nsWindow* window = static_cast(mWidget.get()); nsWindow* toplevelWindow = window->GetTopLevelWindow(false); if (!toplevelWindow) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::CreateNativeCaret() FAILED due to " "no top level window", this)); return; @@ -4530,7 +4530,7 @@ nsTextStore::CreateNativeCaret() void nsTextStore::CommitCompositionInternal(bool aDiscard) { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::CommitCompositionInternal(aDiscard=%s), " "mSink=0x%p, mContext=0x%p, mComposition.mView=0x%p, " "mComposition.mString=\"%s\"", @@ -4546,7 +4546,7 @@ nsTextStore::CommitCompositionInternal(bool aDiscard) textChange.acpStart = mComposition.mStart; textChange.acpOldEnd = endOffset; textChange.acpNewEnd = mComposition.mStart; - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: 0x%p nsTextStore::CommitCompositionInternal(), calling" "mSink->OnTextChange(0, { acpStart=%ld, acpOldEnd=%ld, " "acpNewEnd=%ld })...", this, textChange.acpStart, @@ -4563,7 +4563,7 @@ nsTextStore::CommitCompositionInternal(bool aDiscard) context->QueryInterface(IID_ITfContextOwnerCompositionServices, getter_AddRefs(services)); if (services) { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::CommitCompositionInternal(), " "requesting TerminateComposition() for the context 0x%p...", this, context.get())); @@ -4597,14 +4597,14 @@ GetCompartment(IUnknown* pUnk, void nsTextStore::SetIMEOpenState(bool aState) { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: nsTextStore::SetIMEOpenState(aState=%s)", GetBoolName(aState))); nsRefPtr comp; if (!GetCompartment(sThreadMgr, GUID_COMPARTMENT_KEYBOARD_OPENCLOSE, getter_AddRefs(comp))) { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: nsTextStore::SetIMEOpenState() FAILED due to" "no compartment available")); return; @@ -4613,7 +4613,7 @@ nsTextStore::SetIMEOpenState(bool aState) VARIANT variant; variant.vt = VT_I4; variant.lVal = aState; - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: nsTextStore::SetIMEOpenState(), setting " "0x%04X to GUID_COMPARTMENT_KEYBOARD_OPENCLOSE...", variant.lVal)); @@ -4645,7 +4645,7 @@ nsTextStore::SetInputContext(nsWindowBase* aWidget, const InputContext& aContext, const InputContextAction& aAction) { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: nsTextStore::SetInputContext(aWidget=%p, " "aContext.mIMEState.mEnabled=%s, aAction.mFocusChange=%s), " "sEnabledTextStore=0x%p, ThinksHavingFocus()=%s", @@ -4683,13 +4683,13 @@ nsTextStore::MarkContextAsKeyboardDisabled(ITfContext* aContext) if (!GetCompartment(aContext, GUID_COMPARTMENT_KEYBOARD_DISABLED, getter_AddRefs(comp))) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: nsTextStore::MarkContextAsKeyboardDisabled() failed" "aContext=0x%p...", aContext)); return; } - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: nsTextStore::MarkContextAsKeyboardDisabled(), setting " "to disable context 0x%p...", aContext)); @@ -4708,13 +4708,13 @@ nsTextStore::MarkContextAsEmpty(ITfContext* aContext) if (!GetCompartment(aContext, GUID_COMPARTMENT_EMPTYCONTEXT, getter_AddRefs(comp))) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: nsTextStore::MarkContextAsEmpty() failed" "aContext=0x%p...", aContext)); return; } - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: nsTextStore::MarkContextAsEmpty(), setting " "to mark empty context 0x%p...", aContext)); comp->SetValue(sClientId, &variant_int4_value1); @@ -4728,11 +4728,11 @@ nsTextStore::Initialize() sTextStoreLog = PR_NewLogModule("nsTextStoreWidgets"); } - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: nsTextStore::Initialize() is called...")); if (sThreadMgr) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: nsTextStore::Initialize() FAILED due to already initialized")); return; } @@ -4741,7 +4741,7 @@ nsTextStore::Initialize() Preferences::GetBool(kPrefNameForceEnableTSF, false) || (IsVistaOrLater() && Preferences::GetBool(kPrefNameEnableTSF, false) && !BrowserTabsRemoteAutostart()); - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: nsTextStore::Initialize(), TSF is %s", enableTsf ? "enabled" : "disabled")); if (!enableTsf) { @@ -4759,7 +4759,7 @@ nsTextStore::Initialize() IID_ITfInputProcessorProfiles, getter_AddRefs(inputProcessorProfiles)); if (FAILED(hr) || !inputProcessorProfiles) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: nsTextStore::Initialize() FAILED to create input processor " "profiles, hr=0x%08X", hr)); return; @@ -4770,7 +4770,7 @@ nsTextStore::Initialize() CLSCTX_INPROC_SERVER, IID_ITfThreadMgr, getter_AddRefs(threadMgr)); if (FAILED(hr) || !threadMgr) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: nsTextStore::Initialize() FAILED to " "create the thread manager, hr=0x%08X", hr)); return; @@ -4780,7 +4780,7 @@ nsTextStore::Initialize() hr = threadMgr->QueryInterface(IID_ITfMessagePump, getter_AddRefs(messagePump)); if (FAILED(hr) || !messagePump) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: nsTextStore::Initialize() FAILED to " "QI message pump from the thread manager, hr=0x%08X", hr)); return; @@ -4790,7 +4790,7 @@ nsTextStore::Initialize() hr = threadMgr->QueryInterface(IID_ITfKeystrokeMgr, getter_AddRefs(keystrokeMgr)); if (FAILED(hr) || !keystrokeMgr) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: nsTextStore::Initialize() FAILED to " "QI keystroke manager from the thread manager, hr=0x%08X", hr)); return; @@ -4798,7 +4798,7 @@ nsTextStore::Initialize() hr = threadMgr->Activate(&sClientId); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: nsTextStore::Initialize() FAILED to activate, hr=0x%08X", hr)); return; } @@ -4808,7 +4808,7 @@ nsTextStore::Initialize() CLSCTX_INPROC_SERVER, IID_ITfDisplayAttributeMgr, getter_AddRefs(displayAttributeMgr)); if (FAILED(hr) || !displayAttributeMgr) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: nsTextStore::Initialize() FAILED to create " "a display attribute manager instance, hr=0x%08X", hr)); return; @@ -4819,7 +4819,7 @@ nsTextStore::Initialize() CLSCTX_INPROC_SERVER, IID_ITfCategoryMgr, getter_AddRefs(categoryMgr)); if (FAILED(hr) || !categoryMgr) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: nsTextStore::Initialize() FAILED to create " "a category manager instance, hr=0x%08X", hr)); return; @@ -4828,7 +4828,7 @@ nsTextStore::Initialize() nsRefPtr disabledDocumentMgr; hr = threadMgr->CreateDocumentMgr(getter_AddRefs(disabledDocumentMgr)); if (FAILED(hr) || !disabledDocumentMgr) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: nsTextStore::Initialize() FAILED to create " "a document manager for disabled mode, hr=0x%08X", hr)); return; @@ -4840,7 +4840,7 @@ nsTextStore::Initialize() getter_AddRefs(disabledContext), &editCookie); if (FAILED(hr) || !disabledContext) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: nsTextStore::Initialize() FAILED to create " "a context for disabled mode, hr=0x%08X", hr)); return; @@ -4849,13 +4849,13 @@ nsTextStore::Initialize() MarkContextAsKeyboardDisabled(disabledContext); MarkContextAsEmpty(disabledContext); - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: nsTextStore::Initialize() is creating " "a TSFStaticSink instance...")); TSFStaticSink* staticSink = TSFStaticSink::GetInstance(); if (!staticSink->Init(threadMgr, inputProcessorProfiles)) { TSFStaticSink::Shutdown(); - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: nsTextStore::Initialize() FAILED to initialize TSFStaticSink " "instance")); return; @@ -4887,7 +4887,7 @@ nsTextStore::Initialize() "intl.tsf.hack.google_ja_input.do_not_return_no_layout_error_at_caret", true); - MOZ_LOG(sTextStoreLog, LogLevel::Info, + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: nsTextStore::Initialize(), sThreadMgr=0x%p, " "sClientId=0x%08X, sDisplayAttrMgr=0x%p, " "sCategoryMgr=0x%p, sDisabledDocumentMgr=0x%p, sDisabledContext=%p, " @@ -4909,7 +4909,7 @@ nsTextStore::Initialize() void nsTextStore::Terminate(void) { - MOZ_LOG(sTextStoreLog, LogLevel::Info, ("TSF: nsTextStore::Terminate()")); + MOZ_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: nsTextStore::Terminate()")); TSFStaticSink::Shutdown(); @@ -5142,19 +5142,19 @@ nsTextStore::MouseTracker::MouseTracker() HRESULT nsTextStore::MouseTracker::Init(nsTextStore* aTextStore) { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::MouseTracker::Init(aTextStore=0x%p), " "aTextStore->mMouseTrackers.Length()=%d", this, aTextStore->mMouseTrackers.Length())); if (&aTextStore->mMouseTrackers.LastElement() != this) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::MouseTracker::Init() FAILED due to " "this is not the last element of mMouseTrackers", this)); return E_FAIL; } if (aTextStore->mMouseTrackers.Length() > kInvalidCookie) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::MouseTracker::Init() FAILED due to " "no new cookie available", this)); return E_FAIL; @@ -5170,14 +5170,14 @@ nsTextStore::MouseTracker::AdviseSink(nsTextStore* aTextStore, ITfRangeACP* aTextRange, ITfMouseSink* aMouseSink) { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::MouseTracker::AdviseSink(aTextStore=0x%p, " "aTextRange=0x%p, aMouseSink=0x%p), mCookie=%d, mSink=0x%p", this, aTextStore, aTextRange, aMouseSink, mCookie, mSink.get())); MOZ_ASSERT(mCookie != kInvalidCookie, "This hasn't been initalized?"); if (mSink) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::MouseTracker::AdviseMouseSink() FAILED " "due to already being used", this)); return E_FAIL; @@ -5185,14 +5185,14 @@ nsTextStore::MouseTracker::AdviseSink(nsTextStore* aTextStore, HRESULT hr = aTextRange->GetExtent(&mStart, &mLength); if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::MouseTracker::AdviseMouseSink() FAILED " "due to failure of ITfRangeACP::GetExtent()", this)); return hr; } if (mStart < 0 || mLength <= 0) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::MouseTracker::AdviseMouseSink() FAILED " "due to odd result of ITfRangeACP::GetExtent(), " "mStart=%d, mLength=%d", this, mStart, mLength)); @@ -5201,7 +5201,7 @@ nsTextStore::MouseTracker::AdviseSink(nsTextStore* aTextStore, nsAutoString textContent; if (NS_WARN_IF(!aTextStore->GetCurrentText(textContent))) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::MouseTracker::AdviseMouseSink() FAILED " "due to failure of nsTextStore::GetCurrentText()", this)); return E_FAIL; @@ -5209,7 +5209,7 @@ nsTextStore::MouseTracker::AdviseSink(nsTextStore* aTextStore, if (textContent.Length() <= static_cast(mStart) || textContent.Length() < static_cast(mStart + mLength)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: 0x%p nsTextStore::MouseTracker::AdviseMouseSink() FAILED " "due to out of range, mStart=%d, mLength=%d, " "textContent.Length()=%d", @@ -5219,7 +5219,7 @@ nsTextStore::MouseTracker::AdviseSink(nsTextStore* aTextStore, mSink = aMouseSink; - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::MouseTracker::AdviseMouseSink(), " "succeeded, mStart=%d, mLength=%d, textContent.Length()=%d", this, mStart, mLength, textContent.Length())); @@ -5229,7 +5229,7 @@ nsTextStore::MouseTracker::AdviseSink(nsTextStore* aTextStore, void nsTextStore::MouseTracker::UnadviseSink() { - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::MouseTracker::UnadviseSink(), " "mCookie=%d, mSink=0x%p, mStart=%d, mLength=%d", this, mCookie, mSink.get(), mStart, mLength)); @@ -5247,7 +5247,7 @@ nsTextStore::MouseTracker::OnMouseButtonEvent(ULONG aEdge, BOOL eaten = FALSE; HRESULT hr = mSink->OnMouseEvent(aEdge, aQuadrant, aButtonStatus, &eaten); - MOZ_LOG(sTextStoreLog, LogLevel::Debug, + MOZ_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::MouseTracker::OnMouseEvent(aEdge=%d, " "aQuadrant=%d, aButtonStatus=0x%08X), hr=0x%08X, eaten=%s", this, aEdge, aQuadrant, aButtonStatus, hr, GetBoolName(!!eaten))); @@ -5261,7 +5261,7 @@ bool nsTextStore::CurrentKeyboardLayoutHasIME() { if (!sInputProcessorProfiles) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: nsTextStore::CurrentKeyboardLayoutHasIME() FAILED due to there is " "no input processor profiles instance")); return false; @@ -5275,7 +5275,7 @@ nsTextStore::CurrentKeyboardLayoutHasIME() // If we failed to obtain the profile manager, we cannot know if current // keyboard layout has IME. if (IsVistaOrLater()) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: nsTextStore::CurrentKeyboardLayoutHasIME() FAILED to query " "ITfInputProcessorProfileMgr")); return false; @@ -5292,7 +5292,7 @@ nsTextStore::CurrentKeyboardLayoutHasIME() return false; // not found or not active } if (FAILED(hr)) { - MOZ_LOG(sTextStoreLog, LogLevel::Error, + MOZ_LOG(sTextStoreLog, PR_LOG_ERROR, ("TSF: nsTextStore::CurrentKeyboardLayoutHasIME() FAILED to retreive " "active profile")); return false; diff --git a/widget/windows/nsWinGesture.cpp b/widget/windows/nsWinGesture.cpp index 3bd037d5e655..839ad3a1f9a3 100644 --- a/widget/windows/nsWinGesture.cpp +++ b/widget/windows/nsWinGesture.cpp @@ -455,7 +455,7 @@ nsWinGesture::ProcessPanMessage(HWND hWnd, WPARAM wParam, LPARAM lParam) #ifdef DBG_jimm int32_t deltaX = mPanIntermediate.x - coord.x; int32_t deltaY = mPanIntermediate.y - coord.y; - MOZ_LOG(gWindowsLog, LogLevel::Info, + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("coordX=%d coordY=%d deltaX=%d deltaY=%d x:%d y:%d\n", coord.x, coord.y, deltaX, deltaY, mXAxisFeedback, mYAxisFeedback)); #endif diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index a36e8ff957b7..ddcc0517a4bc 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -1391,7 +1391,7 @@ NS_METHOD nsWindow::Move(double aX, double aY) ::SystemParametersInfo(SPI_GETWORKAREA, 0, &workArea, 0); // no annoying assertions. just mention the issue. if (x < 0 || x >= workArea.right || y < 0 || y >= workArea.bottom) { - MOZ_LOG(gWindowsLog, LogLevel::Info, + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("window moved to offscreen position\n")); } } @@ -1804,10 +1804,10 @@ NS_METHOD nsWindow::SetFocus(bool aRaise) if (mWnd) { #ifdef WINSTATE_DEBUG_OUTPUT if (mWnd == WinUtils::GetTopLevelHWND(mWnd)) { - MOZ_LOG(gWindowsLog, LogLevel::Info, + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("*** SetFocus: [ top] raise=%d\n", aRaise)); } else { - MOZ_LOG(gWindowsLog, LogLevel::Info, + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("*** SetFocus: [child] raise=%d\n", aRaise)); } #endif @@ -2713,7 +2713,7 @@ void nsWindow::UpdateGlass() break; } - MOZ_LOG(gWindowsLog, LogLevel::Info, + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("glass margins: left:%d top:%d right:%d bottom:%d\n", margins.cxLeftWidth, margins.cyTopHeight, margins.cxRightWidth, margins.cyBottomHeight)); @@ -3046,7 +3046,7 @@ NS_METHOD nsWindow::SetIcon(const nsAString& aIconSpec) #ifdef DEBUG_SetIcon else { NS_LossyConvertUTF16toASCII cPath(iconPath); - MOZ_LOG(gWindowsLog, LogLevel::Info, + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("\nIcon load error; icon=%s, rc=0x%08X\n\n", cPath.get(), ::GetLastError())); } @@ -3060,7 +3060,7 @@ NS_METHOD nsWindow::SetIcon(const nsAString& aIconSpec) #ifdef DEBUG_SetIcon else { NS_LossyConvertUTF16toASCII cPath(iconPath); - MOZ_LOG(gWindowsLog, LogLevel::Info, + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("\nSmall icon load error; icon=%s, rc=0x%08X\n\n", cPath.get(), ::GetLastError())); } @@ -3901,7 +3901,7 @@ bool nsWindow::DispatchMouseEvent(uint32_t aEventType, WPARAM wParam, event.clickCount = sLastClickCount; #ifdef NS_DEBUG_XX - MOZ_LOG(gWindowsLog, LogLevel::Info, + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("Msg Time: %d Click Count: %d\n", curMsgTime, event.clickCount)); #endif @@ -5881,30 +5881,30 @@ void nsWindow::OnWindowPosChanged(WINDOWPOS* wp) #ifdef WINSTATE_DEBUG_OUTPUT if (mWnd == WinUtils::GetTopLevelHWND(mWnd)) { - MOZ_LOG(gWindowsLog, LogLevel::Info, ("*** OnWindowPosChanged: [ top] ")); + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("*** OnWindowPosChanged: [ top] ")); } else { - MOZ_LOG(gWindowsLog, LogLevel::Info, ("*** OnWindowPosChanged: [child] ")); + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("*** OnWindowPosChanged: [child] ")); } - MOZ_LOG(gWindowsLog, LogLevel::Info, ("WINDOWPOS flags:")); + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("WINDOWPOS flags:")); if (wp->flags & SWP_FRAMECHANGED) { - MOZ_LOG(gWindowsLog, LogLevel::Info, ("SWP_FRAMECHANGED ")); + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("SWP_FRAMECHANGED ")); } if (wp->flags & SWP_SHOWWINDOW) { - MOZ_LOG(gWindowsLog, LogLevel::Info, ("SWP_SHOWWINDOW ")); + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("SWP_SHOWWINDOW ")); } if (wp->flags & SWP_NOSIZE) { - MOZ_LOG(gWindowsLog, LogLevel::Info, ("SWP_NOSIZE ")); + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("SWP_NOSIZE ")); } if (wp->flags & SWP_HIDEWINDOW) { - MOZ_LOG(gWindowsLog, LogLevel::Info, ("SWP_HIDEWINDOW ")); + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("SWP_HIDEWINDOW ")); } if (wp->flags & SWP_NOZORDER) { - MOZ_LOG(gWindowsLog, LogLevel::Info, ("SWP_NOZORDER ")); + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("SWP_NOZORDER ")); } if (wp->flags & SWP_NOACTIVATE) { - MOZ_LOG(gWindowsLog, LogLevel::Info, ("SWP_NOACTIVATE ")); + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("SWP_NOACTIVATE ")); } - MOZ_LOG(gWindowsLog, LogLevel::Info, ("\n")); + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("\n")); #endif // Handle window size mode changes @@ -5948,19 +5948,19 @@ void nsWindow::OnWindowPosChanged(WINDOWPOS* wp) #ifdef WINSTATE_DEBUG_OUTPUT switch (mSizeMode) { case nsSizeMode_Normal: - MOZ_LOG(gWindowsLog, LogLevel::Info, + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("*** mSizeMode: nsSizeMode_Normal\n")); break; case nsSizeMode_Minimized: - MOZ_LOG(gWindowsLog, LogLevel::Info, + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("*** mSizeMode: nsSizeMode_Minimized\n")); break; case nsSizeMode_Maximized: - MOZ_LOG(gWindowsLog, LogLevel::Info, + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("*** mSizeMode: nsSizeMode_Maximized\n")); break; default: - MOZ_LOG(gWindowsLog, LogLevel::Info, ("*** mSizeMode: ??????\n")); + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("*** mSizeMode: ??????\n")); break; }; #endif @@ -6044,7 +6044,7 @@ void nsWindow::OnWindowPosChanged(WINDOWPOS* wp) mLastSize.height = newHeight; #ifdef WINSTATE_DEBUG_OUTPUT - MOZ_LOG(gWindowsLog, LogLevel::Info, + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("*** Resize window: %d x %d x %d x %d\n", wp->x, wp->y, newWidth, newHeight)); #endif @@ -6730,7 +6730,7 @@ NS_IMETHODIMP nsWindow::GetToggledKeyState(uint32_t aKeyCode, bool* aLEDState) { #ifdef DEBUG_KBSTATE - MOZ_LOG(gWindowsLog, LogLevel::Info, ("GetToggledKeyState\n")); + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("GetToggledKeyState\n")); #endif NS_ENSURE_ARG_POINTER(aLEDState); *aLEDState = (::GetKeyState(aKeyCode) & 1) != 0; @@ -6970,13 +6970,13 @@ LRESULT CALLBACK nsWindow::MozSpecialMsgFilter(int code, WPARAM wParam, LPARAM l if (code != gLastMsgCode) { if (gMSGFEvents[inx].mId == code) { #ifdef DEBUG - MOZ_LOG(gWindowsLog, LogLevel::Info, + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("MozSpecialMessageProc - code: 0x%X - %s hw: %p\n", code, gMSGFEvents[inx].mStr, pMsg->hwnd)); #endif } else { #ifdef DEBUG - MOZ_LOG(gWindowsLog, LogLevel::Info, + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("MozSpecialMessageProc - code: 0x%X - %d hw: %p\n", code, gMSGFEvents[inx].mId, pMsg->hwnd)); #endif @@ -7062,7 +7062,7 @@ void nsWindow::RegisterSpecialDropdownHooks() nullptr, GetCurrentThreadId()); #ifdef POPUP_ROLLUP_DEBUG_OUTPUT if (!sMsgFilterHook) { - MOZ_LOG(gWindowsLog, LogLevel::Info, + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("***** SetWindowsHookEx is NOT installed for WH_MSGFILTER!\n")); } #endif @@ -7075,7 +7075,7 @@ void nsWindow::RegisterSpecialDropdownHooks() nullptr, GetCurrentThreadId()); #ifdef POPUP_ROLLUP_DEBUG_OUTPUT if (!sCallProcHook) { - MOZ_LOG(gWindowsLog, LogLevel::Info, + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("***** SetWindowsHookEx is NOT installed for WH_CALLWNDPROC!\n")); } #endif @@ -7088,7 +7088,7 @@ void nsWindow::RegisterSpecialDropdownHooks() nullptr, GetCurrentThreadId()); #ifdef POPUP_ROLLUP_DEBUG_OUTPUT if (!sCallMouseHook) { - MOZ_LOG(gWindowsLog, LogLevel::Info, + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("***** SetWindowsHookEx is NOT installed for WH_MOUSE!\n")); } #endif diff --git a/widget/windows/nsWindowDbg.cpp b/widget/windows/nsWindowDbg.cpp index 61bf4e992ced..da7fdcb1dd4f 100644 --- a/widget/windows/nsWindowDbg.cpp +++ b/widget/windows/nsWindowDbg.cpp @@ -37,7 +37,7 @@ void PrintEvent(UINT msg, bool aShowAllEvents, bool aShowMouseMoves) } if (aShowAllEvents || (!aShowAllEvents && gLastEventMsg != (long)msg)) { if (aShowMouseMoves || (!aShowMouseMoves && msg != 0x0020 && msg != 0x0200 && msg != 0x0084)) { - MOZ_LOG(gWindowsLog, LogLevel::Info, + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("%6d - 0x%04X %s\n", gEventCounter++, msg, gAllEvents[inx].mStr ? gAllEvents[inx].mStr : "Unknown")); gLastEventMsg = msg; @@ -49,7 +49,7 @@ void PrintEvent(UINT msg, bool aShowAllEvents, bool aShowMouseMoves) void DDError(const char *msg, HRESULT hr) { /*XXX make nicer */ - MOZ_LOG(gWindowsLog, LogLevel::Error, + MOZ_LOG(gWindowsLog, PR_LOG_ERROR, ("direct draw error %s: 0x%08lx\n", msg, hr)); } #endif @@ -59,7 +59,7 @@ bool is_vk_down(int vk) { SHORT st = GetKeyState(vk); #ifdef DEBUG - MOZ_LOG(gWindowsLog, LogLevel::Info, ("is_vk_down vk=%x st=%x\n",vk, st)); + MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ("is_vk_down vk=%x st=%x\n",vk, st)); #endif return (st < 0); } diff --git a/widget/windows/nsWindowDbg.h b/widget/windows/nsWindowDbg.h index 66076995272b..9bd0c12f0617 100644 --- a/widget/windows/nsWindowDbg.h +++ b/widget/windows/nsWindowDbg.h @@ -42,7 +42,7 @@ typedef struct { int mId; } MSGFEventMsgInfo; -#define DISPLAY_NMM_PRT(_arg) MOZ_LOG(gWindowsLog, mozilla::LogLevel::Info, ((_arg))); +#define DISPLAY_NMM_PRT(_arg) MOZ_LOG(gWindowsLog, PR_LOG_ALWAYS, ((_arg))); #else #define DISPLAY_NMM_PRT(_arg) #endif // defined(POPUP_ROLLUP_DEBUG_OUTPUT) diff --git a/widget/xremoteclient/XRemoteClient.cpp b/widget/xremoteclient/XRemoteClient.cpp index f9c2b06e6174..43790463c483 100644 --- a/widget/xremoteclient/XRemoteClient.cpp +++ b/widget/xremoteclient/XRemoteClient.cpp @@ -49,8 +49,6 @@ #endif #endif -using mozilla::LogLevel; - static PRLogModuleInfo *sRemoteLm = nullptr; static int (*sOldHandler)(Display *, XErrorEvent *); @@ -68,12 +66,12 @@ XRemoteClient::XRemoteClient() mLockData = 0; if (!sRemoteLm) sRemoteLm = PR_NewLogModule("XRemoteClient"); - MOZ_LOG(sRemoteLm, LogLevel::Debug, ("XRemoteClient::XRemoteClient")); + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("XRemoteClient::XRemoteClient")); } XRemoteClient::~XRemoteClient() { - MOZ_LOG(sRemoteLm, LogLevel::Debug, ("XRemoteClient::~XRemoteClient")); + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("XRemoteClient::~XRemoteClient")); if (mInitialized) Shutdown(); } @@ -94,7 +92,7 @@ static Atom XAtoms[MOZ_ARRAY_LENGTH(XAtomNames)]; nsresult XRemoteClient::Init() { - MOZ_LOG(sRemoteLm, LogLevel::Debug, ("XRemoteClient::Init")); + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("XRemoteClient::Init")); if (mInitialized) return NS_OK; @@ -126,7 +124,7 @@ XRemoteClient::Init() void XRemoteClient::Shutdown (void) { - MOZ_LOG(sRemoteLm, LogLevel::Debug, ("XRemoteClient::Shutdown")); + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("XRemoteClient::Shutdown")); if (!mInitialized) return; @@ -160,7 +158,7 @@ XRemoteClient::SendCommandLine (const char *aProgram, const char *aUsername, const char* aDesktopStartupID, char **aResponse, bool *aWindowFound) { - MOZ_LOG(sRemoteLm, LogLevel::Debug, ("XRemoteClient::SendCommandLine")); + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("XRemoteClient::SendCommandLine")); *aWindowFound = false; @@ -205,7 +203,7 @@ XRemoteClient::SendCommandLine (const char *aProgram, const char *aUsername, XSetErrorHandler(sOldHandler); - MOZ_LOG(sRemoteLm, LogLevel::Debug, ("SendCommandInternal returning 0x%x\n", rv)); + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("SendCommandInternal returning 0x%x\n", rv)); return rv; } @@ -350,7 +348,7 @@ XRemoteClient::GetLock(Window aWindow, bool *aDestroyed) /* We tried to grab the lock this time, and failed because someone else is holding it already. So, wait for a PropertyDelete event to come in, and try again. */ - MOZ_LOG(sRemoteLm, LogLevel::Debug, + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("window 0x%x is locked by %s; waiting...\n", (unsigned int) aWindow, data)); waited = True; @@ -369,11 +367,11 @@ XRemoteClient::GetLock(Window aWindow, bool *aDestroyed) &select_set, nullptr, nullptr, &delay); // did we time out? if (select_retval == 0) { - MOZ_LOG(sRemoteLm, LogLevel::Debug, ("timed out waiting for window\n")); + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("timed out waiting for window\n")); rv = NS_ERROR_FAILURE; break; } - MOZ_LOG(sRemoteLm, LogLevel::Debug, ("xevent...\n")); + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("xevent...\n")); XNextEvent (mDisplay, &event); if (event.xany.type == DestroyNotify && event.xdestroywindow.window == aWindow) { @@ -387,7 +385,7 @@ XRemoteClient::GetLock(Window aWindow, bool *aDestroyed) event.xproperty.atom == mMozLockAtom) { /* Ok! Someone deleted their lock, so now we can try again. */ - MOZ_LOG(sRemoteLm, LogLevel::Debug, + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("(0x%x unlocked, trying again...)\n", (unsigned int) aWindow)); break; @@ -399,9 +397,9 @@ XRemoteClient::GetLock(Window aWindow, bool *aDestroyed) } while (!locked && !NS_FAILED(rv)); if (waited && locked) { - MOZ_LOG(sRemoteLm, LogLevel::Debug, ("obtained lock.\n")); + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("obtained lock.\n")); } else if (*aDestroyed) { - MOZ_LOG(sRemoteLm, LogLevel::Debug, + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("window 0x%x unexpectedly destroyed.\n", (unsigned int) aWindow)); } @@ -421,13 +419,13 @@ XRemoteClient::FindBestWindow(const char *aProgram, const char *aUsername, // Get a list of the children of the root window, walk the list // looking for the best window that fits the criteria. if (!XQueryTree(mDisplay, root, &root2, &parent, &kids, &nkids)) { - MOZ_LOG(sRemoteLm, LogLevel::Debug, + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("XQueryTree failed in XRemoteClient::FindBestWindow")); return 0; } if (!(kids && nkids)) { - MOZ_LOG(sRemoteLm, LogLevel::Debug, ("root window has no children")); + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("root window has no children")); return 0; } @@ -576,20 +574,20 @@ XRemoteClient::FreeLock(Window aWindow) &nitems, &bytes_after, &data); if (result != Success) { - MOZ_LOG(sRemoteLm, LogLevel::Debug, + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("unable to read and delete " MOZILLA_LOCK_PROP " property\n")); return NS_ERROR_FAILURE; } else if (!data || !*data){ - MOZ_LOG(sRemoteLm, LogLevel::Debug, + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("invalid data on " MOZILLA_LOCK_PROP " of window 0x%x.\n", (unsigned int) aWindow)); return NS_ERROR_FAILURE; } else if (strcmp((char *)data, mLockData)) { - MOZ_LOG(sRemoteLm, LogLevel::Debug, + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, (MOZILLA_LOCK_PROP " was stolen! Expected \"%s\", saw \"%s\"!\n", mLockData, data)); return NS_ERROR_FAILURE; @@ -699,7 +697,7 @@ XRemoteClient::WaitForResponse(Window aWindow, char **aResponse, if (event.xany.type == DestroyNotify && event.xdestroywindow.window == aWindow) { /* Print to warn user...*/ - MOZ_LOG(sRemoteLm, LogLevel::Debug, + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("window 0x%x was destroyed.\n", (unsigned int) aWindow)); *aResponse = strdup("Window was destroyed while reading response."); @@ -723,7 +721,7 @@ XRemoteClient::WaitForResponse(Window aWindow, char **aResponse, &nitems, &bytes_after, &data); if (result != Success) { - MOZ_LOG(sRemoteLm, LogLevel::Debug, + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("failed reading " MOZILLA_RESPONSE_PROP " from window 0x%0x.\n", (unsigned int) aWindow)); @@ -731,7 +729,7 @@ XRemoteClient::WaitForResponse(Window aWindow, char **aResponse, done = true; } else if (!data || strlen((char *) data) < 5) { - MOZ_LOG(sRemoteLm, LogLevel::Debug, + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("invalid data on " MOZILLA_RESPONSE_PROP " property of window 0x%0x.\n", (unsigned int) aWindow)); @@ -739,7 +737,7 @@ XRemoteClient::WaitForResponse(Window aWindow, char **aResponse, done = true; } else if (*data == '1') { /* positive preliminary reply */ - MOZ_LOG(sRemoteLm, LogLevel::Debug, ("%s\n", data + 4)); + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("%s\n", data + 4)); /* keep going */ done = false; } @@ -751,14 +749,14 @@ XRemoteClient::WaitForResponse(Window aWindow, char **aResponse, } else if (*data == '2') { /* positive completion */ - MOZ_LOG(sRemoteLm, LogLevel::Debug, ("%s\n", data + 4)); + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("%s\n", data + 4)); *aResponse = strdup((char *)data); accepted = true; done = true; } else if (*data == '3') { /* positive intermediate reply */ - MOZ_LOG(sRemoteLm, LogLevel::Debug, + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("internal error: " "server wants more information? (%s)\n", data)); @@ -768,13 +766,13 @@ XRemoteClient::WaitForResponse(Window aWindow, char **aResponse, else if (*data == '4' || /* transient negative completion */ *data == '5') { /* permanent negative completion */ - MOZ_LOG(sRemoteLm, LogLevel::Debug, ("%s\n", data + 4)); + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("%s\n", data + 4)); *aResponse = strdup((char *)data); done = true; } else { - MOZ_LOG(sRemoteLm, LogLevel::Debug, + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("unrecognised " MOZILLA_RESPONSE_PROP " from window 0x%x: %s\n", (unsigned int) aWindow, data)); @@ -790,7 +788,7 @@ XRemoteClient::WaitForResponse(Window aWindow, char **aResponse, event.xproperty.window == aWindow && event.xproperty.state == PropertyDelete && event.xproperty.atom == aCommandAtom) { - MOZ_LOG(sRemoteLm, LogLevel::Debug, + MOZ_LOG(sRemoteLm, PR_LOG_DEBUG, ("(server 0x%x has accepted " MOZILLA_COMMANDLINE_PROP ".)\n", (unsigned int) aWindow)); diff --git a/xpcom/base/nsDebugImpl.cpp b/xpcom/base/nsDebugImpl.cpp index 7d05954a3448..7fb2578d0c17 100644 --- a/xpcom/base/nsDebugImpl.cpp +++ b/xpcom/base/nsDebugImpl.cpp @@ -320,23 +320,23 @@ NS_DebugBreak(uint32_t aSeverity, const char* aStr, const char* aExpr, InitLog(); FixedBuffer buf; - mozilla::LogLevel ll = LogLevel::Warning; + PRLogModuleLevel ll = PR_LOG_WARNING; const char* sevString = "WARNING"; switch (aSeverity) { case NS_DEBUG_ASSERTION: sevString = "###!!! ASSERTION"; - ll = LogLevel::Error; + ll = PR_LOG_ERROR; break; case NS_DEBUG_BREAK: sevString = "###!!! BREAK"; - ll = LogLevel::Error; + ll = PR_LOG_ALWAYS; break; case NS_DEBUG_ABORT: sevString = "###!!! ABORT"; - ll = LogLevel::Error; + ll = PR_LOG_ALWAYS; break; default: @@ -377,7 +377,7 @@ NS_DebugBreak(uint32_t aSeverity, const char* aStr, const char* aExpr, // errors on platforms without a debugdlg ring a bell on stderr #if !defined(XP_WIN) - if (ll != LogLevel::Warning) { + if (ll != PR_LOG_WARNING) { fprintf(stderr, "\07"); } #endif diff --git a/xpcom/build/perfprobe.cpp b/xpcom/build/perfprobe.cpp index 23d4d48ae24c..92d76e2f473d 100644 --- a/xpcom/build/perfprobe.cpp +++ b/xpcom/build/perfprobe.cpp @@ -27,7 +27,7 @@ GetProbeLog() } return sLog; } -#define LOG(x) MOZ_LOG(GetProbeLog(), mozilla::LogLevel::Debug, x) +#define LOG(x) MOZ_LOG(GetProbeLog(), PR_LOG_DEBUG, x) #else #define LOG(x) #endif diff --git a/xpcom/components/nsComponentManager.cpp b/xpcom/components/nsComponentManager.cpp index 1320880ffde7..ee317afd1a48 100644 --- a/xpcom/components/nsComponentManager.cpp +++ b/xpcom/components/nsComponentManager.cpp @@ -459,7 +459,7 @@ nsComponentManagerImpl::Init() // point. So we wait until now. nsCategoryManager::GetSingleton()->InitMemoryReporter(); - MOZ_LOG(nsComponentManagerLog, LogLevel::Debug, + MOZ_LOG(nsComponentManagerLog, PR_LOG_DEBUG, ("nsComponentManager: Initialized.")); mStatus = NORMAL; @@ -913,7 +913,7 @@ nsresult nsComponentManagerImpl::Shutdown(void) mStatus = SHUTDOWN_IN_PROGRESS; // Shutdown the component manager - MOZ_LOG(nsComponentManagerLog, LogLevel::Debug, + MOZ_LOG(nsComponentManagerLog, PR_LOG_DEBUG, ("nsComponentManager: Beginning Shutdown.")); #if !defined(MOZILLA_XPCOMRT_API) @@ -944,7 +944,7 @@ nsresult nsComponentManagerImpl::Shutdown(void) mStatus = SHUTDOWN_COMPLETE; - MOZ_LOG(nsComponentManagerLog, LogLevel::Debug, + MOZ_LOG(nsComponentManagerLog, PR_LOG_DEBUG, ("nsComponentManager: Shutdown complete.")); return NS_OK; @@ -952,14 +952,14 @@ nsresult nsComponentManagerImpl::Shutdown(void) nsComponentManagerImpl::~nsComponentManagerImpl() { - MOZ_LOG(nsComponentManagerLog, LogLevel::Debug, + MOZ_LOG(nsComponentManagerLog, PR_LOG_DEBUG, ("nsComponentManager: Beginning destruction.")); if (SHUTDOWN_COMPLETE != mStatus) { Shutdown(); } - MOZ_LOG(nsComponentManagerLog, LogLevel::Debug, + MOZ_LOG(nsComponentManagerLog, PR_LOG_DEBUG, ("nsComponentManager: Destroyed.")); } @@ -1031,7 +1031,7 @@ nsComponentManagerImpl::GetClassObject(const nsCID& aClass, const nsIID& aIID, { nsresult rv; - if (MOZ_LOG_TEST(nsComponentManagerLog, LogLevel::Debug)) { + if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_DEBUG)) { char* buf = aClass.ToString(); PR_LogPrint("nsComponentManager: GetClassObject(%s)", buf); if (buf) { @@ -1048,7 +1048,7 @@ nsComponentManagerImpl::GetClassObject(const nsCID& aClass, const nsIID& aIID, rv = factory->QueryInterface(aIID, aResult); - MOZ_LOG(nsComponentManagerLog, LogLevel::Warning, + MOZ_LOG(nsComponentManagerLog, PR_LOG_WARNING, ("\t\tGetClassObject() %s", NS_SUCCEEDED(rv) ? "succeeded" : "FAILED")); return rv; @@ -1067,7 +1067,7 @@ nsComponentManagerImpl::GetClassObjectByContractID(const char* aContractID, nsresult rv; - MOZ_LOG(nsComponentManagerLog, LogLevel::Debug, + MOZ_LOG(nsComponentManagerLog, PR_LOG_DEBUG, ("nsComponentManager: GetClassObject(%s)", aContractID)); nsCOMPtr factory = FindFactory(aContractID, strlen(aContractID)); @@ -1077,7 +1077,7 @@ nsComponentManagerImpl::GetClassObjectByContractID(const char* aContractID, rv = factory->QueryInterface(aIID, aResult); - MOZ_LOG(nsComponentManagerLog, LogLevel::Warning, + MOZ_LOG(nsComponentManagerLog, PR_LOG_WARNING, ("\t\tGetClassObject() %s", NS_SUCCEEDED(rv) ? "succeeded" : "FAILED")); return rv; @@ -1147,9 +1147,9 @@ nsComponentManagerImpl::CreateInstance(const nsCID& aClass, rv = NS_ERROR_FACTORY_NOT_REGISTERED; } - if (MOZ_LOG_TEST(nsComponentManagerLog, LogLevel::Warning)) { + if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_WARNING)) { char* buf = aClass.ToString(); - MOZ_LOG(nsComponentManagerLog, LogLevel::Warning, + MOZ_LOG(nsComponentManagerLog, PR_LOG_WARNING, ("nsComponentManager: CreateInstance(%s) %s", buf, NS_SUCCEEDED(rv) ? "succeeded" : "FAILED")); if (buf) { @@ -1230,7 +1230,7 @@ nsComponentManagerImpl::CreateInstanceByContractID(const char* aContractID, rv = NS_ERROR_FACTORY_NOT_REGISTERED; } - MOZ_LOG(nsComponentManagerLog, LogLevel::Warning, + MOZ_LOG(nsComponentManagerLog, PR_LOG_WARNING, ("nsComponentManager: CreateInstanceByContractID(%s) %s", aContractID, NS_SUCCEEDED(rv) ? "succeeded" : "FAILED")); diff --git a/xpcom/components/nsNativeModuleLoader.cpp b/xpcom/components/nsNativeModuleLoader.cpp index bf6b5fa2314c..373a7ead6938 100644 --- a/xpcom/components/nsNativeModuleLoader.cpp +++ b/xpcom/components/nsNativeModuleLoader.cpp @@ -65,7 +65,7 @@ nsresult nsNativeModuleLoader::Init() { MOZ_ASSERT(NS_IsMainThread(), "Startup not on main thread?"); - LOG(LogLevel::Debug, ("nsNativeModuleLoader::Init()")); + LOG(PR_LOG_DEBUG, ("nsNativeModuleLoader::Init()")); return NS_OK; } @@ -125,7 +125,7 @@ nsNativeModuleLoader::LoadModule(FileLocation& aFile) if (mLibraries.Get(hashedFile, &data)) { NS_ASSERTION(data.mModule, "Corrupt mLibraries hash"); - LOG(LogLevel::Debug, + LOG(PR_LOG_DEBUG, ("nsNativeModuleLoader::LoadModule(\"%s\") - found in cache", filePath.get())); return data.mModule; @@ -203,13 +203,13 @@ PLDHashOperator nsNativeModuleLoader::UnloaderFunc(nsIHashable* aHashedFile, NativeLoadData& aLoadData, void*) { - if (MOZ_LOG_TEST(GetNativeModuleLoaderLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetNativeModuleLoaderLog(), PR_LOG_DEBUG)) { nsCOMPtr file(do_QueryInterface(aHashedFile)); nsAutoCString filePath; file->GetNativePath(filePath); - LOG(LogLevel::Debug, + LOG(PR_LOG_DEBUG, ("nsNativeModuleLoader::UnloaderFunc(\"%s\")", filePath.get())); } diff --git a/xpcom/ds/TimeStamp_windows.cpp b/xpcom/ds/TimeStamp_windows.cpp index 15e3c2b00f2e..27338dddd926 100644 --- a/xpcom/ds/TimeStamp_windows.cpp +++ b/xpcom/ds/TimeStamp_windows.cpp @@ -27,7 +27,7 @@ // set NSPR_LOG_MODULES=TimeStampWindows:5 // set NSPR_LOG_FILE=nspr.log // -// this enables LogLevel::Debug level information and places all output in +// this enables PR_LOG_DEBUG level information and places all output in // the file nspr.log static PRLogModuleInfo* GetTimeStampLog() @@ -38,7 +38,7 @@ GetTimeStampLog() } return sLog; } -#define LOG(x) MOZ_LOG(GetTimeStampLog(), mozilla::LogLevel::Debug, x) +#define LOG(x) MOZ_LOG(GetTimeStampLog(), PR_LOG_DEBUG, x) // Estimate of the smallest duration of time we can measure. static volatile ULONGLONG sResolution; diff --git a/xpcom/ds/nsObserverService.cpp b/xpcom/ds/nsObserverService.cpp index f36a8baab742..dc6de5e49c51 100644 --- a/xpcom/ds/nsObserverService.cpp +++ b/xpcom/ds/nsObserverService.cpp @@ -25,7 +25,7 @@ // set NSPR_LOG_MODULES=ObserverService:5 // set NSPR_LOG_FILE=nspr.log // -// this enables LogLevel::Debug level information and places all output in +// this enables PR_LOG_DEBUG level information and places all output in // the file nspr.log static PRLogModuleInfo* GetObserverServiceLog() @@ -36,7 +36,7 @@ GetObserverServiceLog() } return sLog; } -#define LOG(x) MOZ_LOG(GetObserverServiceLog(), mozilla::LogLevel::Debug, x) +#define LOG(x) MOZ_LOG(GetObserverServiceLog(), PR_LOG_DEBUG, x) namespace mozilla { diff --git a/xpcom/glue/Logging.h b/xpcom/glue/Logging.h index 55b60668a083..0a5e7597f2f3 100644 --- a/xpcom/glue/Logging.h +++ b/xpcom/glue/Logging.h @@ -9,62 +9,12 @@ #include "prlog.h" -#include "mozilla/Assertions.h" - // This file is a placeholder for a replacement to the NSPR logging framework // that is defined in prlog.h. Currently it is just a pass through, but as // work progresses more functionality will be swapped out in favor of // mozilla logging implementations. -namespace mozilla { - -// While not a 100% mapping to PR_LOG's numeric values, mozilla::LogLevel does -// maintain a direct mapping for the Disabled, Debug and Verbose levels. -// -// Mappings of LogLevel to PR_LOG's numeric values: -// -// +---------+------------------+-----------------+ -// | Numeric | NSPR Logging | Mozilla Logging | -// +---------+------------------+-----------------+ -// | 0 | PR_LOG_NONE | Disabled | -// | 1 | PR_LOG_ALWAYS | Error | -// | 2 | PR_LOG_ERROR | Warning | -// | 3 | PR_LOG_WARNING | Info | -// | 4 | PR_LOG_DEBUG | Debug | -// | 5 | PR_LOG_DEBUG + 1 | Verbose | -// +---------+------------------+-----------------+ -// -enum class LogLevel { - Disabled = 0, - Error, - Warning, - Info, - Debug, - Verbose, -}; - -namespace detail { - -inline bool log_test(const PRLogModuleInfo* module, LogLevel level) { - MOZ_ASSERT(level != LogLevel::Disabled); - return module && module->level >= static_cast(level); -} - -} - -} - -#define MOZ_LOG_TEST(_module,_level) mozilla::detail::log_test(_module, _level) - -#define MOZ_LOG(_module,_level,_args) \ - PR_BEGIN_MACRO \ - if (MOZ_LOG_TEST(_module,_level)) { \ - PR_LogPrint _args; \ - } \ - PR_END_MACRO - -#undef PR_LOG -#undef PR_LOG_TEST +#define MOZ_LOG PR_LOG #endif // mozilla_logging_h diff --git a/xpcom/io/nsInputStreamTee.cpp b/xpcom/io/nsInputStreamTee.cpp index 28fceb509e35..28d217384568 100644 --- a/xpcom/io/nsInputStreamTee.cpp +++ b/xpcom/io/nsInputStreamTee.cpp @@ -31,7 +31,7 @@ GetTeeLog() } return sLog; } -#define LOG(args) MOZ_LOG(GetTeeLog(), mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(GetTeeLog(), PR_LOG_DEBUG, args) class nsInputStreamTee final : public nsIInputStreamTee { diff --git a/xpcom/io/nsPipe3.cpp b/xpcom/io/nsPipe3.cpp index 76d0e1a416ff..bcf3b4872a17 100644 --- a/xpcom/io/nsPipe3.cpp +++ b/xpcom/io/nsPipe3.cpp @@ -40,7 +40,7 @@ GetPipeLog() } return sLog; } -#define LOG(args) MOZ_LOG(GetPipeLog(), mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(GetPipeLog(), PR_LOG_DEBUG, args) #define DEFAULT_SEGMENT_SIZE 4096 #define DEFAULT_SEGMENT_COUNT 16 diff --git a/xpcom/io/nsStorageStream.cpp b/xpcom/io/nsStorageStream.cpp index f982130af250..b55ffa0f456c 100644 --- a/xpcom/io/nsStorageStream.cpp +++ b/xpcom/io/nsStorageStream.cpp @@ -38,7 +38,7 @@ using mozilla::ipc::StringInputStreamParams; // set NSPR_LOG_MODULES=StorageStreamLog:5 // set NSPR_LOG_FILE=nspr.log // -// this enables LogLevel::Debug level information and places all output in +// this enables PR_LOG_DEBUG level information and places all output in // the file nspr.log // static PRLogModuleInfo* @@ -53,7 +53,7 @@ GetStorageStreamLog() #ifdef LOG #undef LOG #endif -#define LOG(args) MOZ_LOG(GetStorageStreamLog(), mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(GetStorageStreamLog(), PR_LOG_DEBUG, args) nsStorageStream::nsStorageStream() : mSegmentedBuffer(0), mSegmentSize(0), mWriteInProgress(false), diff --git a/xpcom/threads/TimerThread.cpp b/xpcom/threads/TimerThread.cpp index 92ee7c2e1d71..c5fe246914f6 100644 --- a/xpcom/threads/TimerThread.cpp +++ b/xpcom/threads/TimerThread.cpp @@ -82,7 +82,7 @@ TimerObserverRunnable::Run() nsresult TimerThread::Init() { - MOZ_LOG(GetTimerLog(), LogLevel::Debug, + MOZ_LOG(GetTimerLog(), PR_LOG_DEBUG, ("TimerThread::Init [%d]\n", mInitialized)); if (mInitialized) { @@ -129,7 +129,7 @@ TimerThread::Init() nsresult TimerThread::Shutdown() { - MOZ_LOG(GetTimerLog(), LogLevel::Debug, ("TimerThread::Shutdown begin\n")); + MOZ_LOG(GetTimerLog(), PR_LOG_DEBUG, ("TimerThread::Shutdown begin\n")); if (!mThread) { return NS_ERROR_NOT_INITIALIZED; @@ -167,7 +167,7 @@ TimerThread::Shutdown() mThread->Shutdown(); // wait for the thread to die - MOZ_LOG(GetTimerLog(), LogLevel::Debug, ("TimerThread::Shutdown end\n")); + MOZ_LOG(GetTimerLog(), PR_LOG_DEBUG, ("TimerThread::Shutdown end\n")); return NS_OK; } @@ -259,7 +259,7 @@ TimerThread::Run() RemoveTimerInternal(timer); timer = nullptr; - MOZ_LOG(GetTimerLog(), LogLevel::Debug, + MOZ_LOG(GetTimerLog(), PR_LOG_DEBUG, ("Timer thread woke up %fms from when it was supposed to\n", fabs((now - timerRef->mTimeout).ToMilliseconds()))); @@ -341,12 +341,12 @@ TimerThread::Run() } } - if (MOZ_LOG_TEST(GetTimerLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetTimerLog(), PR_LOG_DEBUG)) { if (waitFor == PR_INTERVAL_NO_TIMEOUT) - MOZ_LOG(GetTimerLog(), LogLevel::Debug, + MOZ_LOG(GetTimerLog(), PR_LOG_DEBUG, ("waiting for PR_INTERVAL_NO_TIMEOUT\n")); else - MOZ_LOG(GetTimerLog(), LogLevel::Debug, + MOZ_LOG(GetTimerLog(), PR_LOG_DEBUG, ("waiting for %u\n", PR_IntervalToMilliseconds(waitFor))); } } diff --git a/xpcom/threads/nsEventQueue.cpp b/xpcom/threads/nsEventQueue.cpp index b858a7c5124a..adf11d5ec168 100644 --- a/xpcom/threads/nsEventQueue.cpp +++ b/xpcom/threads/nsEventQueue.cpp @@ -25,7 +25,7 @@ GetLog() #ifdef LOG #undef LOG #endif -#define LOG(args) MOZ_LOG(GetLog(), mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(GetLog(), PR_LOG_DEBUG, args) nsEventQueue::nsEventQueue() : mReentrantMonitor("nsEventQueue.mReentrantMonitor") diff --git a/xpcom/threads/nsThread.cpp b/xpcom/threads/nsThread.cpp index 7c2ae020b3d3..697dda264d28 100644 --- a/xpcom/threads/nsThread.cpp +++ b/xpcom/threads/nsThread.cpp @@ -89,7 +89,7 @@ GetThreadLog() #ifdef LOG #undef LOG #endif -#define LOG(args) MOZ_LOG(GetThreadLog(), mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(GetThreadLog(), PR_LOG_DEBUG, args) NS_DECL_CI_INTERFACE_GETTER(nsThread) diff --git a/xpcom/threads/nsThreadPool.cpp b/xpcom/threads/nsThreadPool.cpp index 64f7f01ecab1..b7de32207d38 100644 --- a/xpcom/threads/nsThreadPool.cpp +++ b/xpcom/threads/nsThreadPool.cpp @@ -27,7 +27,7 @@ GetThreadPoolLog() #ifdef LOG #undef LOG #endif -#define LOG(args) MOZ_LOG(GetThreadPoolLog(), mozilla::LogLevel::Debug, args) +#define LOG(args) MOZ_LOG(GetThreadPoolLog(), PR_LOG_DEBUG, args) // DESIGN: // o Allocate anonymous threads. diff --git a/xpcom/threads/nsTimerImpl.cpp b/xpcom/threads/nsTimerImpl.cpp index 2b406269eb4c..a8127d08fce6 100644 --- a/xpcom/threads/nsTimerImpl.cpp +++ b/xpcom/threads/nsTimerImpl.cpp @@ -13,13 +13,11 @@ #include "pratom.h" #include "GeckoProfiler.h" #include "mozilla/Atomics.h" -#include "mozilla/Logging.h" #ifdef MOZ_NUWA_PROCESS #include "ipc/Nuwa.h" #endif using mozilla::Atomic; -using mozilla::LogLevel; using mozilla::TimeDuration; using mozilla::TimeStamp; @@ -315,14 +313,14 @@ nsTimerImpl::Startup() void nsTimerImpl::Shutdown() { - if (MOZ_LOG_TEST(GetTimerLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetTimerLog(), PR_LOG_DEBUG)) { double mean = 0, stddev = 0; myNS_MeanAndStdDev(sDeltaNum, sDeltaSum, sDeltaSumSquared, &mean, &stddev); - MOZ_LOG(GetTimerLog(), LogLevel::Debug, + MOZ_LOG(GetTimerLog(), PR_LOG_DEBUG, ("sDeltaNum = %f, sDeltaSum = %f, sDeltaSumSquared = %f\n", sDeltaNum, sDeltaSum, sDeltaSumSquared)); - MOZ_LOG(GetTimerLog(), LogLevel::Debug, + MOZ_LOG(GetTimerLog(), PR_LOG_DEBUG, ("mean: %fms, stddev: %fms\n", mean, stddev)); } @@ -564,7 +562,7 @@ nsTimerImpl::Fire() #endif TimeStamp now = TimeStamp::Now(); - if (MOZ_LOG_TEST(GetTimerLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetTimerLog(), PR_LOG_DEBUG)) { TimeDuration a = now - mStart; // actual delay in intervals TimeDuration b = TimeDuration::FromMilliseconds(mDelay); // expected delay in intervals TimeDuration delta = (a > b) ? a - b : b - a; @@ -573,14 +571,14 @@ nsTimerImpl::Fire() sDeltaSumSquared += double(d) * double(d); sDeltaNum++; - MOZ_LOG(GetTimerLog(), LogLevel::Debug, + MOZ_LOG(GetTimerLog(), PR_LOG_DEBUG, ("[this=%p] expected delay time %4ums\n", this, mDelay)); - MOZ_LOG(GetTimerLog(), LogLevel::Debug, + MOZ_LOG(GetTimerLog(), PR_LOG_DEBUG, ("[this=%p] actual delay time %fms\n", this, a.ToMilliseconds())); - MOZ_LOG(GetTimerLog(), LogLevel::Debug, + MOZ_LOG(GetTimerLog(), PR_LOG_DEBUG, ("[this=%p] (mType is %d) -------\n", this, mType)); - MOZ_LOG(GetTimerLog(), LogLevel::Debug, + MOZ_LOG(GetTimerLog(), PR_LOG_DEBUG, ("[this=%p] delta %4dms\n", this, (a > b) ? (int32_t)d : -(int32_t)d)); @@ -645,7 +643,7 @@ nsTimerImpl::Fire() mFiring = false; mTimerCallbackWhileFiring = nullptr; - MOZ_LOG(GetTimerLog(), LogLevel::Debug, + MOZ_LOG(GetTimerLog(), PR_LOG_DEBUG, ("[this=%p] Took %fms to fire timer callback\n", this, (TimeStamp::Now() - now).ToMilliseconds())); @@ -693,9 +691,9 @@ nsTimerEvent::Run() return NS_OK; } - if (MOZ_LOG_TEST(GetTimerLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetTimerLog(), PR_LOG_DEBUG)) { TimeStamp now = TimeStamp::Now(); - MOZ_LOG(GetTimerLog(), LogLevel::Debug, + MOZ_LOG(GetTimerLog(), PR_LOG_DEBUG, ("[this=%p] time between PostTimerEvent() and Fire(): %fms\n", this, (now - mInitTime).ToMilliseconds())); } @@ -734,7 +732,7 @@ nsTimerImpl::PostTimerEvent(already_AddRefed aTimerRef) return timer.forget(); } - if (MOZ_LOG_TEST(GetTimerLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetTimerLog(), PR_LOG_DEBUG)) { event->mInitTime = TimeStamp::Now(); } @@ -781,7 +779,7 @@ nsTimerImpl::SetDelayInternal(uint32_t aDelay) mTimeout += delayInterval; - if (MOZ_LOG_TEST(GetTimerLog(), LogLevel::Debug)) { + if (PR_LOG_TEST(GetTimerLog(), PR_LOG_DEBUG)) { if (mStart.IsNull()) { mStart = now; } else {