1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-01 00:45:26 +02:00

Logging cleanup.

This commit is contained in:
AlexVinS
2017-08-11 14:38:10 +03:00
parent c293589c07
commit 64d9dadd64
30 changed files with 146 additions and 149 deletions

View File

@ -130,7 +130,7 @@ SDL_Surface * BitmapHandler::loadBitmapFromDir(std::string path, std::string fna
}
else
{
logGlobal->errorStream()<<"Failed to open "<<fname<<" as H3 PCX!";
logGlobal->error("Failed to open %s as H3 PCX!", fname);
return nullptr;
}
}
@ -151,8 +151,8 @@ SDL_Surface * BitmapHandler::loadBitmapFromDir(std::string path, std::string fna
}
else
{
logGlobal->errorStream() << "Failed to open " << fname << " via SDL_Image";
logGlobal->errorStream() << "Reason: " << IMG_GetError();
logGlobal->error("Failed to open %s via SDL_Image", fname);
logGlobal->error("Reason: %s", IMG_GetError());
return nullptr;
}
}
@ -183,7 +183,7 @@ SDL_Surface * BitmapHandler::loadBitmap(std::string fname, bool setKey)
if (!(bitmap = loadBitmapFromDir("DATA/", fname, setKey)) &&
!(bitmap = loadBitmapFromDir("SPRITES/", fname, setKey)))
{
logGlobal->errorStream() << "Error: Failed to find file " << fname;
logGlobal->error("Error: Failed to find file %s", fname);
}
return bitmap;