diff --git a/modules/juce_core/logging/juce_Logger.cpp b/modules/juce_core/logging/juce_Logger.cpp index 6e2c940a3e..0a600ef856 100644 --- a/modules/juce_core/logging/juce_Logger.cpp +++ b/modules/juce_core/logging/juce_Logger.cpp @@ -45,12 +45,16 @@ void Logger::writeToLog (const String& message) outputDebugString (message); } -#if JUCE_LOG_ASSERTIONS +#if JUCE_LOG_ASSERTIONS || JUCE_DEBUG void JUCE_API logAssertion (const char* const filename, const int lineNum) noexcept { String m ("JUCE Assertion failure in "); m << File::createFileWithoutCheckingPath (filename).getFileName() << ':' << lineNum; + #if JUCE_LOG_ASSERTIONS Logger::writeToLog (m); + #else + DBG (m); + #endif } #endif diff --git a/modules/juce_core/native/juce_mac_SystemStats.mm b/modules/juce_core/native/juce_mac_SystemStats.mm index c485e4bf9b..d51fe781cf 100644 --- a/modules/juce_core/native/juce_mac_SystemStats.mm +++ b/modules/juce_core/native/juce_mac_SystemStats.mm @@ -36,7 +36,11 @@ ScopedAutoReleasePool::~ScopedAutoReleasePool() //============================================================================== void Logger::outputDebugString (const String& text) { - std::cerr << text << std::endl; + // Would prefer to use std::cerr here, but avoiding it for + // the moment, due to clang JIT linkage problems. + fputs (text.toUTF8().getAddress(), stderr); + fputs ("\n", stderr); + fflush (stderr); } //============================================================================== diff --git a/modules/juce_core/system/juce_PlatformDefs.h b/modules/juce_core/system/juce_PlatformDefs.h index 288595eed4..8545209460 100644 --- a/modules/juce_core/system/juce_PlatformDefs.h +++ b/modules/juce_core/system/juce_PlatformDefs.h @@ -51,10 +51,8 @@ //============================================================================== // Debugging and assertion macros -#if JUCE_LOG_ASSERTIONS +#if JUCE_LOG_ASSERTIONS || JUCE_DEBUG #define juce_LogCurrentAssertion juce::logAssertion (__FILE__, __LINE__); -#elif JUCE_DEBUG - #define juce_LogCurrentAssertion std::cerr << "JUCE Assertion failure in " << __FILE__ << ", line " << __LINE__ << std::endl; #else #define juce_LogCurrentAssertion #endif diff --git a/modules/juce_core/system/juce_StandardHeader.h b/modules/juce_core/system/juce_StandardHeader.h index 70ae55ba2e..938cb0b812 100644 --- a/modules/juce_core/system/juce_StandardHeader.h +++ b/modules/juce_core/system/juce_StandardHeader.h @@ -156,10 +156,7 @@ namespace juce { extern JUCE_API bool JUCE_CALLTYPE juce_isRunningUnderDebugger(); - - #if JUCE_LOG_ASSERTIONS - extern JUCE_API void logAssertion (const char* file, int line) noexcept; - #endif + extern JUCE_API void logAssertion (const char* file, int line) noexcept; #include "../memory/juce_Memory.h" #include "../maths/juce_MathsFunctions.h"