diff --git a/build/mac/build_scripts/MozillaBuildFlags.txt b/build/mac/build_scripts/MozillaBuildFlags.txt index 9ed5e551663..ed3ead723d4 100644 --- a/build/mac/build_scripts/MozillaBuildFlags.txt +++ b/build/mac/build_scripts/MozillaBuildFlags.txt @@ -61,6 +61,7 @@ accessible 1 bidi 0 p3p 0 jsdebugger 0 +moz_logging 1 filepath_flags idepath ":CodeWarrior IDE Path.txt" diff --git a/config/config.mak b/config/config.mak index 5fb1e9cd17c..5e651f16ecc 100644 --- a/config/config.mak +++ b/config/config.mak @@ -151,7 +151,11 @@ CFLAGS = $(CFLAGS) -DDEVELOPER_DEBUG CFLAGS = $(CFLAGS) -FR !endif - +!ifdef NO_LOGGING +CFLAGS=$(CFLAGS) -DNS_DISABLE_LOGGING +!else +CFLAGS=$(CFLAGS) -DMOZ_LOGGING +!endif #//----------------------------------------------------------------------- #// diff --git a/configure b/configure index 442d4289db3..d1b271492ea 100755 --- a/configure +++ b/configure @@ -97,7 +97,7 @@ ac_help="$ac_help ac_help="$ac_help --disable-async-dns Disable separate dns thread" ac_help="$ac_help - --disable-logging Disable nsLogging facilities" + --disable-logging Disable logging facilities" ac_help="$ac_help --disable-build-xpfe Disable building of mozilla/xpfe (BROKEN)" ac_help="$ac_help @@ -10960,12 +10960,16 @@ if test "${enable_logging+set}" = set; then fi if test "$NS_DISABLE_LOGGING"; then - cat >> confdefs.h <<\EOF + cat >> confdefs.h <<\EOF #define NS_DISABLE_LOGGING 1 EOF -fi +else + cat >> confdefs.h <<\EOF +#define MOZ_LOGGING 1 +EOF +fi MOZ_BUILD_XPFE=1 # Check whether --enable-build-xpfe or --disable-build-xpfe was given. @@ -11524,12 +11528,12 @@ cross_compiling=$ac_cv_prog_cxx_cross _SAVE_CXXFLAGS=$CXXFLAGS CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic" echo $ac_n "checking whether C++ compiler has -pedantic long long bug""... $ac_c" 1>&6 -echo "configure:11528: checking whether C++ compiler has -pedantic long long bug" >&5 +echo "configure:11532: checking whether C++ compiler has -pedantic long long bug" >&5 if test "$cross_compiling" = yes; then result="maybe" else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:11546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then result="no" else @@ -11586,12 +11590,12 @@ _SAVE_CXXFLAGS=$CXXFLAGS CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}" echo $ac_n "checking for correct overload resolution with const and templates""... $ac_c" 1>&6 -echo "configure:11590: checking for correct overload resolution with const and templates" >&5 +echo "configure:11594: checking for correct overload resolution with const and templates" >&5 if eval "test \"`echo '$''{'ac_nscap_nonconst_opeq_bug'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -11621,7 +11625,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:11625: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:11629: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_nscap_nonconst_opeq_bug="no" else @@ -11667,16 +11671,16 @@ if test "$_IGNORE_LONG_LONG_WARNINGS"; then _SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS ${_COMPILER_PREFIX}-Wno-long-long" echo $ac_n "checking whether compiler supports -Wno-long-long""... $ac_c" 1>&6 -echo "configure:11671: checking whether compiler supports -Wno-long-long" >&5 +echo "configure:11675: checking whether compiler supports -Wno-long-long" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:11684: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-Wno-long-long" _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-long-long" @@ -11924,7 +11928,7 @@ fi echo $ac_n "checking webshell leaks option""... $ac_c" 1>&6 -echo "configure:11928: checking webshell leaks option" >&5 +echo "configure:11932: checking webshell leaks option" >&5 # Check whether --enable-detect-webshell-leaks or --disable-detect-webshell-leaks was given. if test "${enable_detect_webshell_leaks+set}" = set; then enableval="$enable_detect_webshell_leaks" @@ -11998,7 +12002,7 @@ if test "${enable_efence+set}" = set; then enableval="$enable_efence" if test "$enableval" = "yes"; then echo $ac_n "checking for malloc in -lefence""... $ac_c" 1>&6 -echo "configure:12002: checking for malloc in -lefence" >&5 +echo "configure:12006: checking for malloc in -lefence" >&5 ac_lib_var=`echo efence'_'malloc | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -12006,7 +12010,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lefence $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12053,7 +12057,7 @@ fi echo $ac_n "checking for cplus_demangle in -liberty""... $ac_c" 1>&6 -echo "configure:12057: checking for cplus_demangle in -liberty" >&5 +echo "configure:12061: checking for cplus_demangle in -liberty" >&5 ac_lib_var=`echo iberty'_'cplus_demangle | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -12061,7 +12065,7 @@ else ac_save_LIBS="$LIBS" LIBS="-liberty "-liberty" $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12418,7 +12422,7 @@ case "$target" in # Extract the first word of "makeC++SharedLib_r", so it can be a program name with args. set dummy makeC++SharedLib_r; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:12422: checking for $ac_word" >&5 +echo "configure:12426: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_AIX_SHLIB_BIN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -12563,7 +12567,7 @@ if test "$JPEG_DIR" = no; then SYSTEM_JPEG= else echo $ac_n "checking for jpeg_destroy_compress in -ljpeg""... $ac_c" 1>&6 -echo "configure:12567: checking for jpeg_destroy_compress in -ljpeg" >&5 +echo "configure:12571: checking for jpeg_destroy_compress in -ljpeg" >&5 ac_lib_var=`echo jpeg'_'jpeg_destroy_compress | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -12571,7 +12575,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ljpeg $JPEG_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12611,7 +12615,7 @@ if test "$SYSTEM_JPEG" = 1; then SYSTEM_JPEG= else cat > conftest.$ac_ext < #include @@ -12625,7 +12629,7 @@ else } EOF -if { (eval echo configure:12629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:12633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then SYSTEM_JPEG=1 else @@ -12663,16 +12667,16 @@ if test "$ZLIB_DIR" = no; then SYSTEM_ZLIB= else echo $ac_n "checking "for zlib.h"""... $ac_c" 1>&6 -echo "configure:12667: checking "for zlib.h"" >&5 +echo "configure:12671: checking "for zlib.h"" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* result="yes" SYSTEM_ZLIB=1 else @@ -12686,7 +12690,7 @@ rm -f conftest* fi if test "$SYSTEM_ZLIB" = 1; then echo $ac_n "checking for gzread in -lz""... $ac_c" 1>&6 -echo "configure:12690: checking for gzread in -lz" >&5 +echo "configure:12694: checking for gzread in -lz" >&5 ac_lib_var=`echo z'_'gzread | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -12694,7 +12698,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lz $ZLIB_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12751,7 +12755,7 @@ if test "$PNG_DIR" = no; then SYSTEM_PNG= else echo $ac_n "checking for png_get_valid in -lpng""... $ac_c" 1>&6 -echo "configure:12755: checking for png_get_valid in -lpng" >&5 +echo "configure:12759: checking for png_get_valid in -lpng" >&5 ac_lib_var=`echo png'_'png_get_valid | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -12759,7 +12763,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpng $PNG_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12798,7 +12802,7 @@ if test "$SYSTEM_PNG" = 1; then SYSTEM_PNG= else cat > conftest.$ac_ext < #include @@ -12812,7 +12816,7 @@ else } EOF -if { (eval echo configure:12816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:12820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then SYSTEM_PNG=1 else @@ -12851,7 +12855,7 @@ if test "$MNG_DIR" = no; then SYSTEM_MNG= else echo $ac_n "checking for mng_initialize in -lmng""... $ac_c" 1>&6 -echo "configure:12855: checking for mng_initialize in -lmng" >&5 +echo "configure:12859: checking for mng_initialize in -lmng" >&5 ac_lib_var=`echo mng'_'mng_initialize | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -12859,7 +12863,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lmng $MNG_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12898,7 +12902,7 @@ if test "$SYSTEM_MNG" = 1; then SYSTEM_MNG= else cat > conftest.$ac_ext < #include @@ -12912,7 +12916,7 @@ else } EOF -if { (eval echo configure:12916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:12920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then SYSTEM_MNG=1 else @@ -12978,9 +12982,9 @@ CFLAGS="$CFLAGS -I${FULLCIRCLE_DIR}" LDFLAGS="$LDFLAGS -L${FULLCIRCLE_DIR}" LIBS="-lfullsoft $LIBS" echo $ac_n "checking "for FCInitialize in -lfullsoft"""... $ac_c" 1>&6 -echo "configure:12982: checking "for FCInitialize in -lfullsoft"" >&5; +echo "configure:12986: checking "for FCInitialize in -lfullsoft"" >&5; cat > conftest.$ac_ext < #include "fullsoft.h" @@ -12988,7 +12992,7 @@ int main() { FCInitialize(); exit(0); ; return 0; } EOF -if { (eval echo configure:12992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* FULLCIRCLE_LIBS="-I${FULLCIRCLE_DIR} -L${FULLCIRCLE_DIR} -lfullsoft" result="yes" else @@ -13532,7 +13536,6 @@ s%@GLIB_LIBS@%$GLIB_LIBS%g s%@LIBIDL_CFLAGS@%$LIBIDL_CFLAGS%g s%@LIBIDL_LIBS@%$LIBIDL_LIBS%g s%@LIBOBJS@%$LIBOBJS%g -s%@NS_DISABLE_LOGGING@%$NS_DISABLE_LOGGING%g s%@MOZ_MAIL_NEWS@%$MOZ_MAIL_NEWS%g s%@MOZ_EDITOR_API_LOG@%$MOZ_EDITOR_API_LOG%g s%@MOZ_ENDER_LITE@%$MOZ_ENDER_LITE%g diff --git a/configure.in b/configure.in index 5b1471889f3..60774a6fa91 100644 --- a/configure.in +++ b/configure.in @@ -2977,12 +2977,13 @@ MOZ_ARG_DISABLE_BOOL(async-dns, NO_UNIX_ASYNC_DNS=1) MOZ_ARG_DISABLE_BOOL(logging, -[ --disable-logging Disable nsLogging facilities], +[ --disable-logging Disable logging facilities], NS_DISABLE_LOGGING=1) if test "$NS_DISABLE_LOGGING"; then - AC_DEFINE(NS_DISABLE_LOGGING) + AC_DEFINE(NS_DISABLE_LOGGING) +else + AC_DEFINE(MOZ_LOGGING) fi -AC_SUBST(NS_DISABLE_LOGGING) dnl build mozilla/xpfe by default MOZ_BUILD_XPFE=1 diff --git a/dom/src/base/nsJSEnvironment.cpp b/dom/src/base/nsJSEnvironment.cpp index c4cc92cf7f8..19def01a08d 100644 --- a/dom/src/base/nsJSEnvironment.cpp +++ b/dom/src/base/nsJSEnvironment.cpp @@ -55,8 +55,10 @@ #include "nsIPrompt.h" #include "nsIObserverService.h" +#ifdef MOZ_LOGGING // Force PR_LOGGING so we can get JS strict warnings even in release builds #define FORCE_PR_LOG 1 +#endif #include "prlog.h" #include "prthread.h" diff --git a/mailnews/compose/src/nsSmtpProtocol.cpp b/mailnews/compose/src/nsSmtpProtocol.cpp index b16fea40cfa..6538d9473af 100644 --- a/mailnews/compose/src/nsSmtpProtocol.cpp +++ b/mailnews/compose/src/nsSmtpProtocol.cpp @@ -20,8 +20,10 @@ * Contributor(s): */ +#ifdef MOZ_LOGGING // sorry, this has to be before the pre-compiled header #define FORCE_PR_LOG /* Allow logging in the release build */ +#endif #include "msgCore.h" #include "nsSmtpProtocol.h" diff --git a/mailnews/imap/src/nsImapProtocol.cpp b/mailnews/imap/src/nsImapProtocol.cpp index 80532883343..de15c530cf7 100644 --- a/mailnews/imap/src/nsImapProtocol.cpp +++ b/mailnews/imap/src/nsImapProtocol.cpp @@ -22,8 +22,11 @@ */ #define DOING_PSEUDO_MAILBOXES +#ifdef MOZ_LOGGING // sorry, this has to be before the pre-compiled header #define FORCE_PR_LOG /* Allow logging in the release build */ +#endif + // as does this #define NS_IMPL_IDS #include "msgCore.h" // for pre-compiled headers diff --git a/mailnews/imap/src/nsImapServerResponseParser.cpp b/mailnews/imap/src/nsImapServerResponseParser.cpp index 2c39aacd2e9..1c4f8187d66 100644 --- a/mailnews/imap/src/nsImapServerResponseParser.cpp +++ b/mailnews/imap/src/nsImapServerResponseParser.cpp @@ -21,8 +21,10 @@ * Pierre Phaneuf */ +#ifdef MOZ_LOGGING // sorry, this has to be before the pre-compiled header #define FORCE_PR_LOG /* Allow logging in the release build */ +#endif #include "msgCore.h" // for pre-compiled headers #include "nsMimeTypes.h" diff --git a/mailnews/local/src/nsMailboxProtocol.cpp b/mailnews/local/src/nsMailboxProtocol.cpp index e948def4156..13bae22efbe 100644 --- a/mailnews/local/src/nsMailboxProtocol.cpp +++ b/mailnews/local/src/nsMailboxProtocol.cpp @@ -21,8 +21,10 @@ * Pierre Phaneuf */ +#ifdef MOZ_LOGGING // sorry, this has to be before the pre-compiled header #define FORCE_PR_LOG /* Allow logging in the release build */ +#endif #include "msgCore.h" diff --git a/mailnews/local/src/nsPop3Protocol.cpp b/mailnews/local/src/nsPop3Protocol.cpp index a316bf3401f..052603c543e 100644 --- a/mailnews/local/src/nsPop3Protocol.cpp +++ b/mailnews/local/src/nsPop3Protocol.cpp @@ -29,7 +29,7 @@ * 06/07/2000 Jason Eager Added check for out of disk space */ -#ifndef FORCE_PR_LOG +#ifdef MOZ_LOGGING #define FORCE_PR_LOG #endif diff --git a/mailnews/news/src/nsNNTPProtocol.cpp b/mailnews/news/src/nsNNTPProtocol.cpp index ca978f4a101..18b8592de7e 100644 --- a/mailnews/news/src/nsNNTPProtocol.cpp +++ b/mailnews/news/src/nsNNTPProtocol.cpp @@ -26,7 +26,10 @@ * Pierre Phaneuf */ +#ifdef MOZ_LOGGING #define FORCE_PR_LOG /* Allow logging in the release build (sorry this breaks the PCH) */ +#endif + #include "msgCore.h" // precompiled header... #include "MailNewsTypes.h" #include "nntpCore.h" diff --git a/modules/libreg/xpcom/nsRegistry.cpp b/modules/libreg/xpcom/nsRegistry.cpp index dcbcc811499..922aa5b0fa6 100644 --- a/modules/libreg/xpcom/nsRegistry.cpp +++ b/modules/libreg/xpcom/nsRegistry.cpp @@ -20,6 +20,10 @@ * Contributor(s): */ +#ifdef MOZ_LOGGING +#define FORCE_PR_LOG /* Allow logging in the release build */ +#endif + #include "nsRegistry.h" #include "nsIEnumerator.h" #include "nsDirectoryService.h" @@ -53,7 +57,6 @@ #endif // Logging of debug output -#define FORCE_PR_LOG /* Allow logging in the release build */ extern PRLogModuleInfo *nsComponentManagerLog; PRUnichar widestrFormat[] = { PRUnichar('%'),PRUnichar('s'),PRUnichar(0)}; diff --git a/netwerk/protocol/ftp/src/makefile.win b/netwerk/protocol/ftp/src/makefile.win index dfb28daf1a1..e7d2958c205 100644 --- a/netwerk/protocol/ftp/src/makefile.win +++ b/netwerk/protocol/ftp/src/makefile.win @@ -26,8 +26,10 @@ LIBRARY_NAME=nkftp_s LCFLAGS = -DWIN32_LEAN_AND_MEAN -D_IMPL_NS_NET !ifndef MOZ_DEBUG +!ifndef NO_LOGGING LCFLAGS = $(LCFLAGS) -DFORCE_PR_LOG !endif +!endif CPP_OBJS = \ .\$(OBJDIR)\nsFtpProtocolHandler.obj \ diff --git a/xpcom/components/nsComponentManager.cpp b/xpcom/components/nsComponentManager.cpp index f1d4d7e4524..5161110b638 100644 --- a/xpcom/components/nsComponentManager.cpp +++ b/xpcom/components/nsComponentManager.cpp @@ -82,7 +82,9 @@ #include "nsRegistry.h" // Logging of debug output +#ifdef MOZ_LOGGING #define FORCE_PR_LOG /* Allow logging in the release build */ +#endif #include "prlog.h" PRLogModuleInfo* nsComponentManagerLog = NULL; diff --git a/xpcom/components/nsNativeComponentLoader.cpp b/xpcom/components/nsNativeComponentLoader.cpp index bcbb30d110b..a5a0a8c3cf3 100644 --- a/xpcom/components/nsNativeComponentLoader.cpp +++ b/xpcom/components/nsNativeComponentLoader.cpp @@ -55,7 +55,9 @@ #define XPCOM_USE_NSGETFACTORY 1 // Logging of debug output +#ifdef MOZ_LOGGING #define FORCE_PR_LOG /* Allow logging in the release build */ +#endif #include "prlog.h" extern PRLogModuleInfo *nsComponentManagerLog; diff --git a/xpcom/components/nsRegistry.cpp b/xpcom/components/nsRegistry.cpp index dcbcc811499..922aa5b0fa6 100644 --- a/xpcom/components/nsRegistry.cpp +++ b/xpcom/components/nsRegistry.cpp @@ -20,6 +20,10 @@ * Contributor(s): */ +#ifdef MOZ_LOGGING +#define FORCE_PR_LOG /* Allow logging in the release build */ +#endif + #include "nsRegistry.h" #include "nsIEnumerator.h" #include "nsDirectoryService.h" @@ -53,7 +57,6 @@ #endif // Logging of debug output -#define FORCE_PR_LOG /* Allow logging in the release build */ extern PRLogModuleInfo *nsComponentManagerLog; PRUnichar widestrFormat[] = { PRUnichar('%'),PRUnichar('s'),PRUnichar(0)}; diff --git a/xpcom/threads/nsThread.cpp b/xpcom/threads/nsThread.cpp index 810888e89f6..59d975c0637 100644 --- a/xpcom/threads/nsThread.cpp +++ b/xpcom/threads/nsThread.cpp @@ -749,11 +749,12 @@ nsThreadPool::AddThread() { nsresult rv; -#ifdef DEBUG +#if defined(DEBUG) || defined(FORCE_PR_LOG) PRUint32 cnt; rv = mThreads->Count(&cnt); if (NS_FAILED(rv)) return rv; - +#endif +#ifdef DEBUG if (cnt >= mMaxThreads) return NS_ERROR_FAILURE; #endif