1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Logging cleanup

This commit is contained in:
AlexVinS
2017-08-10 21:59:55 +03:00
parent 96eb9c0ac7
commit 143ff682bc
13 changed files with 52 additions and 54 deletions

View File

@@ -95,7 +95,7 @@ void CPathfinder::calculatePaths()
return false;
};
//logGlobal->infoStream() << boost::format("Calculating paths for hero %s (adress %d) of player %d") % hero->name % hero % hero->tempOwner;
//logGlobal->info("Calculating paths for hero %s (adress %d) of player %d", hero->name, hero , hero->tempOwner);
//initial tile - set cost on 0 and add to the queue
CGPathNode * initialNode = out.getNode(out.hpos, hero->boat ? ELayer::SAIL : ELayer::LAND);

View File

@@ -63,24 +63,24 @@ void LibClasses::loadFilesystem()
CStopWatch loadTime;
CResourceHandler::initialize();
logGlobal->infoStream()<<"\tInitialization: "<<loadTime.getDiff();
logGlobal->info("\tInitialization: %d ms", loadTime.getDiff());
CResourceHandler::load("config/filesystem.json");
logGlobal->infoStream()<<"\tData loading: "<<loadTime.getDiff();
logGlobal->info("\tData loading: %d ms", loadTime.getDiff());
modh = new CModHandler();
logGlobal->infoStream()<<"\tMod handler: "<<loadTime.getDiff();
logGlobal->info("\tMod handler: %d ms", loadTime.getDiff());
modh->loadMods();
modh->loadModFilesystems();
logGlobal->infoStream()<<"\tMod filesystems: "<<loadTime.getDiff();
logGlobal->info("\tMod filesystems: %d ms", loadTime.getDiff());
logGlobal->infoStream()<<"Basic initialization: "<<totalTime.getDiff();
logGlobal->info("Basic initialization: %d ms", totalTime.getDiff());
}
static void logHandlerLoaded(const std::string& name, CStopWatch &timer)
static void logHandlerLoaded(const std::string & name, CStopWatch & timer)
{
logGlobal->infoStream()<<"\t\t" << name << " handler: "<<timer.getDiff();
logGlobal->info("\t\t %s handler: %d ms", name, timer.getDiff());
}
template <class Handler> void createHandler(Handler *&handler, const std::string &name, CStopWatch &timer)
@@ -117,7 +117,7 @@ void LibClasses::init()
createHandler(tplh, "Template", pomtime); //templates need already resolved identifiers (refactor?)
logGlobal->infoStream()<<"\tInitializing handlers: "<< totalTime.getDiff();
logGlobal->info("\tInitializing handlers: %d ms", totalTime.getDiff());
modh->load();

View File

@@ -2121,8 +2121,7 @@ void CGObelisk::setPropertyDer( ui8 what, ui32 val )
{
assert(val < PlayerColor::PLAYER_LIMIT_I);
auto progress = ++visited[TeamID(val)];
logGlobal->debugStream() << boost::format("Player %d: obelisk progress %d / %d")
% val % static_cast<int>(progress) % static_cast<int>(obeliskCount);
logGlobal->debug("Player %d: obelisk progress %d / %d", val, static_cast<int>(progress) , static_cast<int>(obeliskCount));
if(progress > obeliskCount)
{

View File

@@ -742,7 +742,7 @@ do not leave zone border
if (!(result || distance < lastDistance || anotherPos.valid()))
{
//FIXME: seemingly this condition is messed up, tells nothing
//logGlobal->warnStream() << boost::format("No tile closer than %s found on path from %s to %s") % currentPos %src %dst;
//logGlobal->warn("No tile closer than %s found on path from %s to %s", currentPos, src , dst);
break;
}
}

View File

@@ -134,7 +134,7 @@ void CZonePlacer::placeZones(const CMapGenOptions * mapGenOptions, CRandomGenera
improvement = true;
}
logGlobal->traceStream() << boost::format("Total distance between zones after this iteration: %2.4f, Total overlap: %2.4f, Improved: %s") % totalDistance % totalOverlap % improvement;
logGlobal->trace("Total distance between zones after this iteration: %2.4f, Total overlap: %2.4f, Improved: %s", totalDistance, totalOverlap , improvement);
//save best solution
if (improvement)

View File

@@ -57,7 +57,7 @@ void CLoadFile::openNextFile(const boost::filesystem::path & fname, int minimalV
if(serializer.fileVersion > SERIALIZATION_VERSION)
{
logGlobal->warnStream() << boost::format("Warning format version mismatch: found %d when current is %d! (file %s)\n") % serializer.fileVersion % SERIALIZATION_VERSION % fName;
logGlobal->warn("Warning format version mismatch: found %d when current is %d! (file %s)\n", serializer.fileVersion, SERIALIZATION_VERSION , fName);
auto versionptr = (char*)&serializer.fileVersion;
std::reverse(versionptr, versionptr + 4);