Browse Source

More plFormat -- some may make minor changes to certain debug output

(mostly regarding bools)
Michael Hansen 11 years ago
parent
commit
48ca0fde19
  1. 4
      Sources/Plasma/NucleusLib/pnKeyedObject/hsKeyedObject.cpp
  2. 4
      Sources/Plasma/PubUtilLib/plModifier/plSDLModifier.cpp
  3. 5
      Sources/Plasma/PubUtilLib/plNetCommon/plSpawnPointInfo.cpp
  4. 4
      Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp
  5. 16
      Sources/Plasma/PubUtilLib/plSDL/plStateDataRecord.cpp
  6. 20
      Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp

4
Sources/Plasma/NucleusLib/pnKeyedObject/hsKeyedObject.cpp

@ -148,8 +148,8 @@ void hsKeyedObject::UnRegisterAsManual(plUoid& inUoid)
{ {
#if !HS_BUILD_FOR_UNIX // disable for unix servers #if !HS_BUILD_FOR_UNIX // disable for unix servers
hsAssert(false, hsAssert(false,
plString::Format("Request to Unregister wrong FixedKey, keyName=%s, inUoid=%s, myUoid=%s", plFormat("Request to Unregister wrong FixedKey, keyName={}, inUoid={}, myUoid={}",
fpKey->GetName().c_str("?"), inUoid.StringIze().c_str(), myUoid.StringIze().c_str()).c_str()); fpKey->GetName(), inUoid, myUoid).c_str());
#endif #endif
} }
((plKeyImp*)fpKey)->UnRegister(); ((plKeyImp*)fpKey)->UnRegister();

4
Sources/Plasma/PubUtilLib/plModifier/plSDLModifier.cpp

@ -178,8 +178,8 @@ void plSDLModifier::SendState(uint32_t sendFlags)
{ {
gMooseDump=true; gMooseDump=true;
plNetObjectDebugger::GetInstance()->SetDebugging(true); plNetObjectDebugger::GetInstance()->SetDebugging(true);
curState->DumpToObjectDebugger(plString::Format("Object %s SENDS SDL state", curState->DumpToObjectDebugger(plFormat("Object {} SENDS SDL state",
GetStateOwnerKey()->GetName().c_str(), dirtyOnly).c_str()); GetStateOwnerKey()->GetName()).c_str(), dirtyOnly);
gMooseDump=false; gMooseDump=false;
} }

5
Sources/Plasma/PubUtilLib/plNetCommon/plSpawnPointInfo.cpp

@ -122,8 +122,5 @@ void plSpawnPointInfo::Reset()
plString plSpawnPointInfo::AsString() const plString plSpawnPointInfo::AsString() const
{ {
return plString::Format( "t:%s,n:%s,c:%s", return plFormat("t:{},n:{},c:{}", fTitle, fSpawnPt, fCameraStack);
fTitle.c_str("(nil)"),
fSpawnPt.c_str("(nil)"),
fCameraStack.c_str("(nil)") );
} }

4
Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp

@ -704,8 +704,8 @@ plString plNetMsgSDLState::AsString() const
{ {
ISetDescName(); // set desc name for debug if necessary ISetDescName(); // set desc name for debug if necessary
return plString::Format("object:%s, initial:%d, %s", return plFormat("object:{}, initial:{}, {}",
ObjectInfo()->GetObjectName().c_str(), fIsInitialState, plNetMsgStreamedObject::AsString().c_str() ); ObjectInfo()->GetObjectName(), fIsInitialState, plNetMsgStreamedObject::AsString());
} }
// //

16
Sources/Plasma/PubUtilLib/plSDL/plStateDataRecord.cpp

@ -277,8 +277,8 @@ bool plStateDataRecord::Read(hsStream* s, float timeConvert, uint32_t readOption
catch(...) catch(...)
{ {
hsAssert( false, hsAssert( false,
plString::Format("Something bad happened while reading simple var data, desc:%s", plFormat("Something bad happened while reading simple var data, desc:{}",
fDescriptor ? fDescriptor->GetName().c_str("?") : "?").c_str()); fDescriptor ? fDescriptor->GetName() : "?").c_str());
return false; return false;
} }
@ -311,8 +311,8 @@ bool plStateDataRecord::Read(hsStream* s, float timeConvert, uint32_t readOption
catch(...) catch(...)
{ {
hsAssert( false, hsAssert( false,
plString::Format("Something bad happened while reading nested var data, desc:%s", plFormat("Something bad happened while reading nested var data, desc:{}",
fDescriptor ? fDescriptor->GetName().c_str("?") : "?").c_str()); fDescriptor ? fDescriptor->GetName() : "?").c_str());
return false; return false;
} }
@ -745,8 +745,8 @@ void plStateDataRecord::DumpToObjectDebugger(const char* msg, bool dirtyOnly, in
if (msg) if (msg)
dbg->LogMsg(plFormat("{}{}", pad, msg).c_str()); dbg->LogMsg(plFormat("{}{}", pad, msg).c_str());
dbg->LogMsg(plString::Format("%sSDR(%p), desc=%s, showDirty=%d, numVars=%d, vol=%d", dbg->LogMsg(plFormat("{}SDR(0x{x}), desc={}, showDirty={}, numVars={}, vol={}",
pad.c_str(), this, fDescriptor->GetName().c_str(), dirtyOnly, numVars+numSDVars, fFlags&kVolatile).c_str()); pad, (uintptr_t)this, fDescriptor->GetName(), dirtyOnly, numVars+numSDVars, fFlags&kVolatile).c_str());
// dump simple vars // dump simple vars
for (size_t i=0; i<fVarsList.size(); i++) for (size_t i=0; i<fVarsList.size(); i++)
@ -783,8 +783,8 @@ void plStateDataRecord::DumpToStream(hsStream* stream, const char* msg, bool dir
stream->Write(logStr.GetSize(), logStr.c_str()); stream->Write(logStr.GetSize(), logStr.c_str());
} }
logStr = plString::Format("%sSDR(%p), desc=%s, showDirty=%d, numVars=%d, vol=%d", logStr = plFormat("{}SDR(0x{x}), desc={}, showDirty={}, numVars={}, vol={}",
pad.c_str(), this, fDescriptor->GetName().c_str(), dirtyOnly, numVars+numSDVars, fFlags&kVolatile); pad, (uintptr_t)this, fDescriptor->GetName(), dirtyOnly, numVars+numSDVars, fFlags&kVolatile);
stream->Write(logStr.GetSize(), logStr.c_str()); stream->Write(logStr.GetSize(), logStr.c_str());
// dump simple vars // dump simple vars

20
Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp

@ -209,8 +209,8 @@ void plSimpleStateVariable::IDeAlloc()
} }
break; break;
default: default:
hsAssert(false, plString::Format("undefined atomic type:%d var:%s cnt:%d", hsAssert(false, plFormat("undefined atomic type:{} var:{} cnt:{}",
type, GetName().c_str("?"), GetCount()).c_str()); type, GetName(), GetCount()).c_str());
break; break;
}; };
@ -2305,7 +2305,7 @@ void plSimpleStateVariable::DumpToObjectDebugger(bool dirtyOnly, int level) cons
} }
if ( !dirtyOnly ) if ( !dirtyOnly )
logMsg += plString::Format( " dirty:%d", IsDirty() ); logMsg += plFormat(" dirty:{}", IsDirty());
dbg->LogMsg(logMsg.c_str()); dbg->LogMsg(logMsg.c_str());
logMsg = ""; logMsg = "";
@ -2340,7 +2340,7 @@ void plSimpleStateVariable::DumpToStream(hsStream* stream, bool dirtyOnly, int l
} }
if ( !dirtyOnly ) if ( !dirtyOnly )
logMsg += plString::Format( " dirty:%d", IsDirty() ); logMsg += plFormat(" dirty:{}", IsDirty());
stream->WriteString(logMsg); stream->WriteString(logMsg);
logMsg = ""; logMsg = "";
@ -2479,8 +2479,8 @@ void plSDStateVariable::CopyFrom(plSDStateVariable* other, uint32_t writeOptions
void plSDStateVariable::UpdateFrom(plSDStateVariable* other, uint32_t writeOptions/*=0*/) void plSDStateVariable::UpdateFrom(plSDStateVariable* other, uint32_t writeOptions/*=0*/)
{ {
hsAssert(!other->GetSDVarDescriptor()->GetName().CompareI(fVarDescriptor->GetName()), hsAssert(!other->GetSDVarDescriptor()->GetName().CompareI(fVarDescriptor->GetName()),
plString::Format("var descriptor mismatch in UpdateFrom, name %s,%s ver %d,%d", plFormat("var descriptor mismatch in UpdateFrom, name {},{}",
GetName().c_str(), other->GetName().c_str()).c_str()); GetName(), other->GetName()).c_str());
Resize(other->GetCount()); // make sure sizes match Resize(other->GetCount()); // make sure sizes match
bool dirtyOnly = (writeOptions & plSDL::kDirtyOnly); bool dirtyOnly = (writeOptions & plSDL::kDirtyOnly);
@ -2673,8 +2673,8 @@ void plSDStateVariable::DumpToObjectDebugger(bool dirtyOnly, int level) const
plString pad = plString::Fill(level * 3, ' '); plString pad = plString::Fill(level * 3, ' ');
int cnt = dirtyOnly ? GetDirtyCount() : GetUsedCount(); int cnt = dirtyOnly ? GetDirtyCount() : GetUsedCount();
dbg->LogMsg(plString::Format( "%sSDVar, name:%s dirtyOnly:%d count:%d", dbg->LogMsg(plFormat("{}SDVar, name:{} dirtyOnly:{} count:{}",
pad.c_str(), GetName().c_str(), dirtyOnly, cnt).c_str()); pad, GetName(), dirtyOnly, cnt).c_str());
for (size_t i=0; i<GetCount(); i++) for (size_t i=0; i<GetCount(); i++)
{ {
@ -2694,8 +2694,8 @@ void plSDStateVariable::DumpToStream(hsStream* stream, bool dirtyOnly, int level
pad += " "; pad += " ";
int cnt = dirtyOnly ? GetDirtyCount() : GetUsedCount(); int cnt = dirtyOnly ? GetDirtyCount() : GetUsedCount();
stream->WriteString(plString::Format( "%sSDVar, name:%s dirtyOnly:%d count:%d", stream->WriteString(plFormat("{}SDVar, name:{} dirtyOnly:{} count:{}",
pad.c_str(), GetName().c_str(), dirtyOnly, cnt)); pad, GetName(), dirtyOnly, cnt));
for(i=0;i<GetCount();i++) for(i=0;i<GetCount();i++)
{ {

Loading…
Cancel
Save