Bug 47207. Changing printf to PRINTF to use new logging facility. r=valeski,sr=waterson

git-svn-id: svn://10.0.0.236/trunk@81885 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
warren%netscape.com
2000-10-27 22:43:51 +00:00
parent e7c9040b5e
commit c6b67eceeb
757 changed files with 10724 additions and 8223 deletions

View File

@@ -26,6 +26,12 @@
#include "nsGenericFactory.h"
#include "nsCRT.h"
#include "nslog.h"
NS_IMPL_LOG(nsGenericFactoryLog)
#define PRINTF NS_LOG_PRINTF(nsGenericFactoryLog)
#define FLUSH NS_LOG_FLUSH(nsGenericFactoryLog)
nsGenericFactory::nsGenericFactory(ConstructorProcPtr constructor)
: mConstructor(constructor), mDestructor(NULL)
{
@@ -186,9 +192,9 @@ nsGenericModule::GetClassObject(nsIComponentManager *aCompMgr,
desc++;
}
// not found in descriptions
#ifdef DEBUG
#ifdef NS_ENABLE_LOGGING
char* cs = aClass.ToString();
printf("+++ nsGenericModule %s: unable to create factory for %s\n", mModuleName, cs);
PRINTF("+++ nsGenericModule %s: unable to create factory for %s\n", mModuleName, cs);
nsCRT::free(cs);
#endif
// XXX put in stop-gap so that we don't search for this one again
@@ -207,9 +213,7 @@ nsGenericModule::RegisterSelf(nsIComponentManager *aCompMgr,
{
nsresult rv = NS_OK;
#ifdef DEBUG
printf("*** Registering %s components (all right -- a generic module!)\n", mModuleName);
#endif
PRINTF("*** Registering %s components (all right -- a generic module!)\n", mModuleName);
nsModuleComponentInfo* cp = mComponents;
for (PRUint32 i = 0; i < mComponentCount; i++) {
@@ -217,10 +221,8 @@ nsGenericModule::RegisterSelf(nsIComponentManager *aCompMgr,
cp->mContractID, aPath, PR_TRUE,
PR_TRUE);
if (NS_FAILED(rv)) {
#ifdef DEBUG
printf("nsGenericModule %s: unable to register %s component => %x\n",
PRINTF("nsGenericModule %s: unable to register %s component => %x\n",
mModuleName?mModuleName:"(null)", cp->mDescription?cp->mDescription:"(null)", rv);
#endif
break;
}
// Call the registration hook of the component, if any
@@ -228,10 +230,8 @@ nsGenericModule::RegisterSelf(nsIComponentManager *aCompMgr,
{
rv = cp->mRegisterSelfProc(aCompMgr, aPath, registryLocation, componentType);
if (NS_FAILED(rv)) {
#ifdef DEBUG
printf("nsGenericModule %s: Register hook for %s component returned error => %x\n",
PRINTF("nsGenericModule %s: Register hook for %s component returned error => %x\n",
mModuleName?mModuleName:"(null)", cp->mDescription?cp->mDescription:"(null)", rv);
#endif
break;
}
}
@@ -246,9 +246,7 @@ nsGenericModule::UnregisterSelf(nsIComponentManager* aCompMgr,
nsIFile* aPath,
const char* registryLocation)
{
#ifdef DEBUG
printf("*** Unregistering %s components (all right -- a generic module!)\n", mModuleName);
#endif
PRINTF("*** Unregistering %s components (all right -- a generic module!)\n", mModuleName);
nsModuleComponentInfo* cp = mComponents;
for (PRUint32 i = 0; i < mComponentCount; i++) {
// Call the unregistration hook of the component, if any
@@ -259,10 +257,8 @@ nsGenericModule::UnregisterSelf(nsIComponentManager* aCompMgr,
// Unregister the component
nsresult rv = aCompMgr->UnregisterComponentSpec(cp->mCID, aPath);
if (NS_FAILED(rv)) {
#ifdef DEBUG
printf("nsGenericModule %s: unable to unregister %s component => %x\n",
PRINTF("nsGenericModule %s: unable to unregister %s component => %x\n",
mModuleName, cp->mDescription, rv);
#endif
}
cp++;
}