MAINT-2740 convert to std::string based API for OutputDebug wrapper cleanliness after sage counsel (slight refrain)

meow-7.2.2
Graham Madarasz 2013-06-04 14:17:34 -07:00
parent 0638f847c7
commit 0ce3d2e1cc
3 changed files with 11 additions and 9 deletions

View File

@ -201,7 +201,7 @@ namespace {
virtual void recordMessage(LLError::ELevel level,
const std::string& message)
{
LL_WINDOWS_OUTPUT_DEBUG(wstring_to_utf16str(utf8str_to_wstring(message)).c_str());
LL_WINDOWS_OUTPUT_DEBUG(message);
}
};
#endif
@ -1400,13 +1400,15 @@ namespace LLError
}
#if LL_WINDOWS && !defined(LL_RELEASE_FOR_DOWNLOAD)
void LLOutputDebugUTF16(const unsigned short* s)
void LLOutputDebugUTF8(const std::string& s)
{
// Be careful not to enable this in non-debug builds as there are bad interactions between the
// exceptions thrown by this function and the handling of stacks in coroutine fibers. BUG-2707
//
#if defined(_DEBUG)
OutputDebugString(s);
// Need UTF16 for Unicode OutputDebugString
//
OutputDebugString(utf8str_to_utf16str(s).c_str());
OutputDebugString(TEXT("\n"));
#endif
}

View File

@ -200,7 +200,7 @@ namespace LLError
};
#if LL_WINDOWS && !defined(LL_RELEASE_FOR_DOWNLOAD)
void LLOutputDebugUTF16(const unsigned short* s);
void LLOutputDebugUTF8(const std::string& s);
#endif
}
@ -209,7 +209,7 @@ namespace LLError
// Macro accepting a wchar_t* for display in windows debugging console in debug builds only
// (wchar_t flavor chosen for maximal utility with unicode text debugging)
//
#define LL_WINDOWS_OUTPUT_DEBUG(a) LLError::LLOutputDebugUTF16((a))
#define LL_WINDOWS_OUTPUT_DEBUG(a) LLError::LLOutputDebugUTF8((a))
#else
#define LL_WINDOWS_OUTPUT_DEBUG(a)
#endif

View File

@ -1310,7 +1310,7 @@ void LLXUIParser::parserWarning(const std::string& message)
{
#ifdef LL_WINDOWS
// use Visual Studo friendly formatting of output message for easy access to originating xml
LL_WINDOWS_OUTPUT_DEBUG(utf8str_to_utf16str(llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str())).c_str());
LL_WINDOWS_OUTPUT_DEBUG(llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str()));
#else
Parser::parserWarning(message);
#endif
@ -1319,7 +1319,7 @@ void LLXUIParser::parserWarning(const std::string& message)
void LLXUIParser::parserError(const std::string& message)
{
#ifdef LL_WINDOWS
LL_WINDOWS_OUTPUT_DEBUG(utf8str_to_utf16str(llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str())).c_str());
LL_WINDOWS_OUTPUT_DEBUG(llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str()));
#else
Parser::parserError(message);
#endif
@ -1637,7 +1637,7 @@ void LLSimpleXUIParser::parserWarning(const std::string& message)
{
#ifdef LL_WINDOWS
// use Visual Studo friendly formatting of output message for easy access to originating xml
LL_WINDOWS_OUTPUT_DEBUG(utf8str_to_utf16str(llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str())).c_str());
LL_WINDOWS_OUTPUT_DEBUG(llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()));
#else
Parser::parserWarning(message);
#endif
@ -1646,7 +1646,7 @@ void LLSimpleXUIParser::parserWarning(const std::string& message)
void LLSimpleXUIParser::parserError(const std::string& message)
{
#ifdef LL_WINDOWS
LL_WINDOWS_OUTPUT_DEBUG(utf8str_to_utf16str(llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str())).c_str());
LL_WINDOWS_OUTPUT_DEBUG(llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()));
#else
Parser::parserError(message);
#endif