From 5a16dcbfd77361e64f838226ea40e11dba788035 Mon Sep 17 00:00:00 2001 From: "timeless%mozdev.org" Date: Tue, 17 Jun 2003 17:50:00 +0000 Subject: [PATCH] Bug 204146 Undefined symbols during autoregistration should go to stdout Change output for NSPR_LOG_MODULES=nsComponentManager:1 .. 4 to be useful r=dougt git-svn-id: svn://10.0.0.236/trunk@143805 18797224-902f-48f8-a5cc-f745e15eee43 --- .../xpcom/components/nsComponentManager.cpp | 46 +++++++++---------- .../components/nsNativeComponentLoader.cpp | 20 ++++---- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/mozilla/xpcom/components/nsComponentManager.cpp b/mozilla/xpcom/components/nsComponentManager.cpp index cfd152b0e7b..884780c331a 100644 --- a/mozilla/xpcom/components/nsComponentManager.cpp +++ b/mozilla/xpcom/components/nsComponentManager.cpp @@ -841,7 +841,7 @@ nsresult nsComponentManagerImpl::Init(void) return NS_ERROR_FAILURE; } - PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, + PR_LOG(nsComponentManagerLog, PR_LOG_DEBUG, ("nsComponentManager: Initialized.")); return NS_OK; @@ -862,7 +862,7 @@ nsresult nsComponentManagerImpl::Shutdown(void) mShuttingDown = NS_SHUTDOWN_INPROGRESS; // Shutdown the component manager - PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, ("nsComponentManager: Beginning Shutdown.")); + PR_LOG(nsComponentManagerLog, PR_LOG_DEBUG, ("nsComponentManager: Beginning Shutdown.")); PRInt32 i; @@ -870,7 +870,7 @@ nsresult nsComponentManagerImpl::Shutdown(void) if (mRegistryDirty) { nsresult rv = WritePersistentRegistry(); if (NS_FAILED(rv)) { - PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, ("nsComponentManager: Could not write out perisistant registry.")); + PR_LOG(nsComponentManagerLog, PR_LOG_ERROR, ("nsComponentManager: Could not write out perisistant registry.")); #ifdef DEBUG printf("Could not write out perisistant registry!\n"); #endif @@ -914,14 +914,14 @@ nsresult nsComponentManagerImpl::Shutdown(void) mShuttingDown = NS_SHUTDOWN_COMPLETE; - PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, ("nsComponentManager: Shutdown complete.")); + PR_LOG(nsComponentManagerLog, PR_LOG_DEBUG, ("nsComponentManager: Shutdown complete.")); return NS_OK; } nsComponentManagerImpl::~nsComponentManagerImpl() { - PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, ("nsComponentManager: Beginning destruction.")); + PR_LOG(nsComponentManagerLog, PR_LOG_DEBUG, ("nsComponentManager: Beginning destruction.")); if (mShuttingDown != NS_SHUTDOWN_COMPLETE) Shutdown(); @@ -929,7 +929,7 @@ nsComponentManagerImpl::~nsComponentManagerImpl() if (mMon) { nsAutoMonitor::DestroyMonitor(mMon); } - PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, ("nsComponentManager: Destroyed.")); + PR_LOG(nsComponentManagerLog, PR_LOG_DEBUG, ("nsComponentManager: Destroyed.")); } NS_IMPL_THREADSAFE_ISUPPORTS8(nsComponentManagerImpl, @@ -1729,7 +1729,7 @@ nsComponentManagerImpl::GetClassObject(const nsCID &aClass, const nsIID &aIID, nsCOMPtr factory; #ifdef PR_LOGGING - if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_ALWAYS)) + if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_DEBUG)) { char *buf = aClass.ToString(); PR_LogPrint("nsComponentManager: GetClassObject(%s)", buf); @@ -1762,7 +1762,7 @@ nsComponentManagerImpl::GetClassObjectByContractID(const char *contractID, nsCOMPtr factory; #ifdef PR_LOGGING - if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_ALWAYS)) + if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_DEBUG)) { PR_LogPrint("nsComponentManager: GetClassObject(%s)", contractID); } @@ -1806,11 +1806,11 @@ nsComponentManagerImpl::ContractIDToClassID(const char *aContractID, nsCID *aCla rv = NS_OK; } #ifdef PR_LOGGING - if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_ALWAYS)) { + if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_WARNING)) { char *buf = 0; if (NS_SUCCEEDED(rv)) buf = aClass->ToString(); - PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, + PR_LOG(nsComponentManagerLog, PR_LOG_WARNING, ("nsComponentManager: ContractIDToClassID(%s)->%s", aContractID, NS_SUCCEEDED(rv) ? buf : "[FAILED]")); if (buf) @@ -1837,7 +1837,7 @@ nsComponentManagerImpl::CLSIDToContractID(const nsCID &aClass, nsresult rv = NS_ERROR_FACTORY_NOT_REGISTERED; #ifdef PR_LOGGING - if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_ALWAYS)) + if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_WARNING)) { char *buf = aClass.ToString(); PR_LOG(nsComponentManagerLog, PR_LOG_WARNING, @@ -1938,10 +1938,10 @@ nsComponentManagerImpl::CreateInstance(const nsCID &aClass, } #ifdef PR_LOGGING - if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_ALWAYS)) + if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_WARNING)) { char *buf = aClass.ToString(); - PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, + PR_LOG(nsComponentManagerLog, PR_LOG_WARNING, ("nsComponentManager: CreateInstance(%s) %s", buf, NS_SUCCEEDED(rv) ? "succeeded" : "FAILED")); if (buf) @@ -2012,7 +2012,7 @@ nsComponentManagerImpl::CreateInstanceByContractID(const char *aContractID, rv = NS_ERROR_FACTORY_NOT_REGISTERED; } - PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, + PR_LOG(nsComponentManagerLog, PR_LOG_WARNING, ("nsComponentManager: CreateInstanceByContractID(%s) %s", aContractID, NS_SUCCEEDED(rv) ? "succeeded" : "FAILED")); @@ -2653,10 +2653,10 @@ nsComponentManagerImpl::RegisterFactory(const nsCID &aClass, { nsAutoMonitor mon(mMon); #ifdef PR_LOGGING - if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_ALWAYS)) + if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_WARNING)) { char *buf = aClass.ToString(); - PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, + PR_LOG(nsComponentManagerLog, PR_LOG_WARNING, ("nsComponentManager: RegisterFactory(%s, %s)", buf, (aContractID ? aContractID : "(null)"))); if (buf) @@ -2817,10 +2817,10 @@ nsComponentManagerImpl::RegisterComponentCommon(const nsCID &aClass, const char *contractID = (aContractID && *aContractID) ? aContractID : nsnull; const char *className = (aClassName && *aClassName) ? aClassName : nsnull; #ifdef PR_LOGGING - if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_ALWAYS)) + if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_WARNING)) { char *buf = aClass.ToString(); - PR_LOG(nsComponentManagerLog, PR_LOG_DEBUG, + PR_LOG(nsComponentManagerLog, PR_LOG_WARNING, ("nsComponentManager: RegisterComponentCommon(%s, %s, %s, %s)", buf, contractID ? contractID : "(null)", @@ -3029,10 +3029,10 @@ nsComponentManagerImpl::UnregisterFactory(const nsCID &aClass, nsIFactory *aFactory) { #ifdef PR_LOGGING - if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_ALWAYS)) + if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_WARNING)) { char *buf = aClass.ToString(); - PR_LOG(nsComponentManagerLog, PR_LOG_DEBUG, + PR_LOG(nsComponentManagerLog, PR_LOG_WARNING, ("nsComponentManager: UnregisterFactory(%s)", buf)); if (buf) PR_Free(buf); @@ -3066,10 +3066,10 @@ nsComponentManagerImpl::UnregisterComponent(const nsCID &aClass, const char *registryName) { #ifdef PR_LOGGING - if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_ALWAYS)) + if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_WARNING)) { char *buf = aClass.ToString(); - PR_LOG(nsComponentManagerLog, PR_LOG_DEBUG, + PR_LOG(nsComponentManagerLog, PR_LOG_WARNING, ("nsComponentManager: UnregisterComponent(%s)", buf)); if (buf) PR_Free(buf); @@ -3122,7 +3122,7 @@ nsComponentManagerImpl::UnloadLibraries(nsIServiceManager *serviceMgr, PRInt32 a nsAutoMonitor mon(mMon); - PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, + PR_LOG(nsComponentManagerLog, PR_LOG_WARNING, ("nsComponentManager: Unloading Libraries.")); // UnloadAll the loaders diff --git a/mozilla/xpcom/components/nsNativeComponentLoader.cpp b/mozilla/xpcom/components/nsNativeComponentLoader.cpp index 0cb944be7b5..a2dc294036d 100644 --- a/mozilla/xpcom/components/nsNativeComponentLoader.cpp +++ b/mozilla/xpcom/components/nsNativeComponentLoader.cpp @@ -110,7 +110,7 @@ nsNativeComponentLoader::GetFactory(const nsIID & aCID, #endif if (!dll->Load()) { - PR_LOG(nsComponentManagerLog, PR_LOG_ERROR, + PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, ("nsNativeComponentLoader: load FAILED")); char errorMsg[1024] = ""; @@ -132,7 +132,7 @@ nsNativeComponentLoader::GetFactory(const nsIID & aCID, rv = GetFactoryFromModule(dll, aCID, _retval); - PR_LOG(nsComponentManagerLog, PR_LOG_ERROR, + PR_LOG(nsComponentManagerLog, NS_SUCCEEDED(rv) ? PR_LOG_DEBUG : PR_LOG_ERROR, ("nsNativeComponentLoader: Factory creation %s for %s", (NS_SUCCEEDED(rv) ? "succeeded" : "FAILED"), aLocation)); @@ -326,7 +326,7 @@ nsFreeLibrary(nsDll *dll, nsIServiceManager *serviceMgr, PRInt32 when) nsXPIDLCString displayPath; dll->GetDisplayPath(displayPath); - PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, + PR_LOG(nsComponentManagerLog, PR_LOG_WARNING, ("nsNativeComponentLoader: NOT ready for unload %s", displayPath.get())); #endif rv = NS_ERROR_FAILURE; @@ -519,7 +519,7 @@ nsNativeComponentLoader::DumpLoadError(nsDll *dll, nsXPIDLCString displayPath; dll->GetDisplayPath(displayPath); - PR_LOG(nsComponentManagerLog, PR_LOG_ERROR, + PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, ("nsNativeComponentLoader: %s(%s) Load FAILED with error:%s", aCallerName, displayPath.get(), @@ -616,7 +616,7 @@ nsNativeComponentLoader::AutoUnregisterComponent(PRInt32 when, nsXPIDLCString displayPath; dll->GetDisplayPath(displayPath); - PR_LOG(nsComponentManagerLog, PR_LOG_ERROR, + PR_LOG(nsComponentManagerLog, NS_SUCCEEDED(rv) ? PR_LOG_DEBUG : PR_LOG_ERROR, ("nsNativeComponentLoader: AutoUnregistration for %s %s.", (NS_FAILED(rv) ? "FAILED" : "succeeded"), displayPath.get())); #endif @@ -751,7 +751,7 @@ nsNativeComponentLoader::AutoRegisterComponent(PRInt32 when, dll->GetDisplayPath(displayPath); // Dll hasn't changed. Skip. - PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, + PR_LOG(nsComponentManagerLog, PR_LOG_DEBUG, ("nsNativeComponentLoader: + nsDll not changed \"%s\". Skipping...", displayPath.get())); #endif @@ -810,7 +810,7 @@ nsNativeComponentLoader::AutoRegisterComponent(PRInt32 when, nsXPIDLCString displayPath; dll->GetDisplayPath(displayPath); - PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, + PR_LOG(nsComponentManagerLog, PR_LOG_WARNING, ("nsNativeComponentLoader: *** Dll already loaded. " "Cannot unload either. Hence cannot re-register " "\"%s\". Skipping...", displayPath.get())); @@ -824,7 +824,7 @@ nsNativeComponentLoader::AutoRegisterComponent(PRInt32 when, #ifdef PR_LOGGING nsXPIDLCString displayPath; dll->GetDisplayPath(displayPath); - PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, + PR_LOG(nsComponentManagerLog, PR_LOG_DEBUG, ("nsNativeComponentLoader: + Unloading \"%s\". (no CanUnloadProc).", displayPath.get())); #endif @@ -841,7 +841,7 @@ nsNativeComponentLoader::AutoRegisterComponent(PRInt32 when, #ifdef PR_LOGGING nsXPIDLCString displayPath; dll->GetDisplayPath(displayPath); - PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, + PR_LOG(nsComponentManagerLog, PR_LOG_WARNING, ("nsNativeComponentLoader: Dll still loaded. Cannot re-register " "\"%s\". Skipping...", displayPath.get())); #endif @@ -890,7 +890,7 @@ nsNativeComponentLoader::AutoRegisterComponent(PRInt32 when, nsXPIDLCString displayPath; dll->GetDisplayPath(displayPath); - PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, + PR_LOG(nsComponentManagerLog, PR_LOG_WARNING, ("nsNativeComponentLoader: Autoregistration Passed for " "\"%s\".", displayPath.get())); #endif