improve the logging of resource loading failures
this message was particularly unreadable in the unit test logs Change-Id: I5faa5b33ae75488664d498232ec26c66f11361f3
This commit is contained in:
@@ -667,30 +667,30 @@ void ResMgr::RscError_Impl( const sal_Char* pMessage, ResMgr* pResMgr,
|
|||||||
|
|
||||||
ResMgr* pNewResMgr = new ResMgr( pImp );
|
ResMgr* pNewResMgr = new ResMgr( pImp );
|
||||||
|
|
||||||
OStringBuffer aStr(OUStringToOString(pResMgr->GetFileName(),
|
OString aFilename(OUStringToOString(pResMgr->GetFileName(),
|
||||||
RTL_TEXTENCODING_UTF8));
|
RTL_TEXTENCODING_UTF8));
|
||||||
|
OStringBuffer aStr(pMessage);
|
||||||
|
aStr.append(aFilename);
|
||||||
|
aStr.append('\n');
|
||||||
|
|
||||||
if (aStr.getLength())
|
aStr.append(" Class: ");
|
||||||
aStr.append('\n');
|
|
||||||
|
|
||||||
aStr.append("Class: ");
|
|
||||||
aStr.append(OUStringToOString(GetTypeRes_Impl(ResId(nRT, *pNewResMgr)),
|
aStr.append(OUStringToOString(GetTypeRes_Impl(ResId(nRT, *pNewResMgr)),
|
||||||
RTL_TEXTENCODING_UTF8));
|
RTL_TEXTENCODING_UTF8));
|
||||||
aStr.append(", Id: ");
|
aStr.append(", Id: ");
|
||||||
aStr.append(static_cast<sal_Int32>(nId));
|
aStr.append(static_cast<sal_Int32>(nId));
|
||||||
aStr.append(". ");
|
aStr.append(". ");
|
||||||
aStr.append(pMessage);
|
|
||||||
|
|
||||||
aStr.append("\nResource Stack\n");
|
aStr.append(" Resource Stack:");
|
||||||
while( nDepth > 0 )
|
while( nDepth > 0 )
|
||||||
{
|
{
|
||||||
aStr.append("Class: ");
|
aStr.append(" [ Class: ");
|
||||||
aStr.append(OUStringToOString(GetTypeRes_Impl(
|
aStr.append(OUStringToOString(GetTypeRes_Impl(
|
||||||
ResId(rResStack[nDepth].pResource->GetRT(), *pNewResMgr)),
|
ResId(rResStack[nDepth].pResource->GetRT(), *pNewResMgr)),
|
||||||
RTL_TEXTENCODING_UTF8));
|
RTL_TEXTENCODING_UTF8));
|
||||||
aStr.append(", Id: ");
|
aStr.append(", Id: ");
|
||||||
aStr.append(static_cast<sal_Int32>(
|
aStr.append(static_cast<sal_Int32>(
|
||||||
rResStack[nDepth].pResource->GetId()));
|
rResStack[nDepth].pResource->GetId()));
|
||||||
|
aStr.append("]");
|
||||||
nDepth--;
|
nDepth--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user