Common: Migrate logging to fmt

Continues the migration of our code over to the fmt logger.
This commit is contained in:
Lioncash
2020-10-23 14:41:30 -04:00
parent 4f5c8bb42a
commit 4e8df93f41
18 changed files with 154 additions and 152 deletions

View File

@ -35,7 +35,6 @@
#include "Common/SDCardUtil.h"
#include <algorithm>
#include <cinttypes>
#include <cstddef>
#include <cstdio>
#include <cstring>
@ -208,9 +207,8 @@ bool SDCardCreate(u64 disk_size /*in MB*/, const std::string& filename)
if (disk_size < 0x800000 || disk_size > 0x800000000ULL)
{
ERROR_LOG(COMMON,
"Trying to create SD Card image of size %" PRIu64 "MB is out of range (8MB-32GB)",
disk_size / (1024 * 1024));
ERROR_LOG_FMT(COMMON, "Trying to create SD Card image of size {}MB is out of range (8MB-32GB)",
disk_size / (1024 * 1024));
return false;
}
@ -224,7 +222,7 @@ bool SDCardCreate(u64 disk_size /*in MB*/, const std::string& filename)
File::IOFile file(filename, "wb");
if (!file)
{
ERROR_LOG(COMMON, "Could not create file '%s', aborting...", filename.c_str());
ERROR_LOG_FMT(COMMON, "Could not create file '{}', aborting...", filename);
return false;
}
@ -285,9 +283,9 @@ bool SDCardCreate(u64 disk_size /*in MB*/, const std::string& filename)
return true;
FailWrite:
ERROR_LOG(COMMON, "Could not write to '%s', aborting...", filename.c_str());
ERROR_LOG_FMT(COMMON, "Could not write to '{}', aborting...", filename);
if (unlink(filename.c_str()) < 0)
ERROR_LOG(COMMON, "unlink(%s) failed: %s", filename.c_str(), LastStrerrorString().c_str());
ERROR_LOG_FMT(COMMON, "unlink({}) failed: {}", filename, LastStrerrorString());
return false;
}
} // namespace Common