From 456af7c5d9af9648feabb1620929e613c18450c1 Mon Sep 17 00:00:00 2001 From: "mcmullen%netscape.com" Date: Thu, 10 Jun 1999 19:50:56 +0000 Subject: [PATCH] Compromise. On other platforms, NS_WARNING does not call break. So we'll do the same. So for NS_WARNING, we'll simply print to the console and continue, a la mode de Pierre, while for other forms of NS_BLOWCHUNKS, we'll break into the debugger, as of old. --- xpcom/base/nsDebug.cpp | 10 +++++++--- xpcom/glue/nsDebug.cpp | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/xpcom/base/nsDebug.cpp b/xpcom/base/nsDebug.cpp index 5b0b3b38690..0c0fe742849 100644 --- a/xpcom/base/nsDebug.cpp +++ b/xpcom/base/nsDebug.cpp @@ -34,6 +34,7 @@ #ifdef TEMP_MAC_HACK #include #include + #include // TEMPORARY UNTIL WE HAVE MACINTOSH ENVIRONMENT VARIABLES THAT CAN TURN ON // LOGGING ON MACINTOSH @@ -43,7 +44,9 @@ #include #undef PR_LOG + #undef PR_LogFlush #define PR_LOG(module,level,args) dprintf args + #define PR_LogFlush() static void dprintf(const char *format, ...) { va_list ap; @@ -52,8 +55,10 @@ va_start(ap, format); buffer[0] = vsnprintf((char *)buffer + 1, sizeof(buffer) - 1, format, ap); va_end(ap); - - DebugStr(buffer); + if (strstr(format, "Warning: ") == format) + printf("еее%s\n", (char*)buffer + 1); + else + DebugStr(buffer); } #endif // TEMP_MAC_HACK //------------------------ @@ -101,7 +106,6 @@ NS_COM void nsDebug::Break(const char* aFile, PRIntn aLine) PR_LOG(gDebugLog, PR_LOG_ERROR, ("Break: at file %s, line %d", aFile, aLine)); PR_LogFlush(); - //XXX this works on win32 only for now. For all the other platforms call Abort #if defined(_WIN32) ::DebugBreak(); #elif defined(XP_UNIX) && !defined(UNIX_CRASH_ON_ASSERT) diff --git a/xpcom/glue/nsDebug.cpp b/xpcom/glue/nsDebug.cpp index 5b0b3b38690..0c0fe742849 100644 --- a/xpcom/glue/nsDebug.cpp +++ b/xpcom/glue/nsDebug.cpp @@ -34,6 +34,7 @@ #ifdef TEMP_MAC_HACK #include #include + #include // TEMPORARY UNTIL WE HAVE MACINTOSH ENVIRONMENT VARIABLES THAT CAN TURN ON // LOGGING ON MACINTOSH @@ -43,7 +44,9 @@ #include #undef PR_LOG + #undef PR_LogFlush #define PR_LOG(module,level,args) dprintf args + #define PR_LogFlush() static void dprintf(const char *format, ...) { va_list ap; @@ -52,8 +55,10 @@ va_start(ap, format); buffer[0] = vsnprintf((char *)buffer + 1, sizeof(buffer) - 1, format, ap); va_end(ap); - - DebugStr(buffer); + if (strstr(format, "Warning: ") == format) + printf("еее%s\n", (char*)buffer + 1); + else + DebugStr(buffer); } #endif // TEMP_MAC_HACK //------------------------ @@ -101,7 +106,6 @@ NS_COM void nsDebug::Break(const char* aFile, PRIntn aLine) PR_LOG(gDebugLog, PR_LOG_ERROR, ("Break: at file %s, line %d", aFile, aLine)); PR_LogFlush(); - //XXX this works on win32 only for now. For all the other platforms call Abort #if defined(_WIN32) ::DebugBreak(); #elif defined(XP_UNIX) && !defined(UNIX_CRASH_ON_ASSERT)