include/Spectre/System/Log.h: implement a static "Log" class instead of just a function.
This commit is contained in:
parent
e10daeaaa6
commit
3b27db9435
8 changed files with 101 additions and 31 deletions
|
|
@ -37,14 +37,14 @@ bool ImageLoader::loadFromFile(const char *filename, Image& img)
|
|||
|
||||
// loaded into memory. now decode.
|
||||
if (decode((const char*)&buf[0], buf.size(), img) == false) {
|
||||
log("ImageLoader: could not load file '%s'. Reason: %s",
|
||||
Log::warn("ImageLoader: could not load file '%s'. Reason: %s",
|
||||
filename, m_error);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
log("ImageLoader: could not open file '%s'. Reason: %s",
|
||||
Log::warn("ImageLoader: could not open file '%s'. Reason: %s",
|
||||
filename, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
|
@ -67,12 +67,12 @@ bool ImageLoader::saveToFile(const Image& img, const char *filename)
|
|||
if (ext == "png") {
|
||||
|
||||
if (!encodePNG(img, encoded_data)) {
|
||||
log("ImageLoader: failed to save file '%s'. Reason: \n",
|
||||
Log::warn("ImageLoader: failed to save file '%s'. Reason: %s",
|
||||
filename, m_error);
|
||||
}
|
||||
|
||||
} else {
|
||||
log("ImageLoader: Invalid file format\n");
|
||||
Log::warn("ImageLoader: Invalid file format");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue