Merge pull request #10504 from Pokechu22/info-logspam

Reduce logspam at info level
This commit is contained in:
JosJuice 2022-03-12 11:46:51 +01:00 committed by GitHub
commit 9962b0bcaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 16 deletions

View File

@ -168,7 +168,7 @@ bool IsFile(const std::string& path)
// Doesn't supports deleting a directory // Doesn't supports deleting a directory
bool Delete(const std::string& filename, IfAbsentBehavior behavior) bool Delete(const std::string& filename, IfAbsentBehavior behavior)
{ {
INFO_LOG_FMT(COMMON, "Delete: file {}", filename); DEBUG_LOG_FMT(COMMON, "Delete: file {}", filename);
#ifdef ANDROID #ifdef ANDROID
if (StringBeginsWith(filename, "content://")) if (StringBeginsWith(filename, "content://"))
@ -219,7 +219,7 @@ bool Delete(const std::string& filename, IfAbsentBehavior behavior)
// Returns true if successful, or path already exists. // Returns true if successful, or path already exists.
bool CreateDir(const std::string& path) bool CreateDir(const std::string& path)
{ {
INFO_LOG_FMT(COMMON, "CreateDir: directory {}", path); DEBUG_LOG_FMT(COMMON, "CreateDir: directory {}", path);
#ifdef _WIN32 #ifdef _WIN32
if (::CreateDirectory(UTF8ToTStr(path).c_str(), nullptr)) if (::CreateDirectory(UTF8ToTStr(path).c_str(), nullptr))
return true; return true;
@ -252,11 +252,11 @@ bool CreateDir(const std::string& path)
bool CreateFullPath(const std::string& fullPath) bool CreateFullPath(const std::string& fullPath)
{ {
int panicCounter = 100; int panicCounter = 100;
INFO_LOG_FMT(COMMON, "CreateFullPath: path {}", fullPath); DEBUG_LOG_FMT(COMMON, "CreateFullPath: path {}", fullPath);
if (Exists(fullPath)) if (Exists(fullPath))
{ {
INFO_LOG_FMT(COMMON, "CreateFullPath: path exists {}", fullPath); DEBUG_LOG_FMT(COMMON, "CreateFullPath: path exists {}", fullPath);
return true; return true;
} }
@ -289,7 +289,7 @@ bool CreateFullPath(const std::string& fullPath)
// Deletes a directory filename, returns true on success // Deletes a directory filename, returns true on success
bool DeleteDir(const std::string& filename, IfAbsentBehavior behavior) bool DeleteDir(const std::string& filename, IfAbsentBehavior behavior)
{ {
INFO_LOG_FMT(COMMON, "DeleteDir: directory {}", filename); DEBUG_LOG_FMT(COMMON, "DeleteDir: directory {}", filename);
// Return true because we care about the directory not being there, not the actual delete. // Return true because we care about the directory not being there, not the actual delete.
if (!File::Exists(filename)) if (!File::Exists(filename))
@ -348,7 +348,7 @@ static bool AttemptMaxTimesWithExponentialDelay(int max_attempts, std::chrono::m
// renames file srcFilename to destFilename, returns true on success // renames file srcFilename to destFilename, returns true on success
bool Rename(const std::string& srcFilename, const std::string& destFilename) bool Rename(const std::string& srcFilename, const std::string& destFilename)
{ {
INFO_LOG_FMT(COMMON, "Rename: {} --> {}", srcFilename, destFilename); DEBUG_LOG_FMT(COMMON, "Rename: {} --> {}", srcFilename, destFilename);
#ifdef _WIN32 #ifdef _WIN32
const std::wstring source_wstring = UTF8ToTStr(srcFilename); const std::wstring source_wstring = UTF8ToTStr(srcFilename);
const std::wstring destination_wstring = UTF8ToTStr(destFilename); const std::wstring destination_wstring = UTF8ToTStr(destFilename);
@ -357,7 +357,8 @@ bool Rename(const std::string& srcFilename, const std::string& destFilename)
// Retry the operation with increasing delays, and if none of them work there's probably a // Retry the operation with increasing delays, and if none of them work there's probably a
// persistent problem. // persistent problem.
const bool success = AttemptMaxTimesWithExponentialDelay( const bool success = AttemptMaxTimesWithExponentialDelay(
3, std::chrono::milliseconds(5), "Rename", [&source_wstring, &destination_wstring] { 3, std::chrono::milliseconds(5), fmt::format("Rename {} --> {}", srcFilename, destFilename),
[&source_wstring, &destination_wstring] {
if (ReplaceFile(destination_wstring.c_str(), source_wstring.c_str(), nullptr, if (ReplaceFile(destination_wstring.c_str(), source_wstring.c_str(), nullptr,
REPLACEFILE_IGNORE_MERGE_ERRORS, nullptr, nullptr)) REPLACEFILE_IGNORE_MERGE_ERRORS, nullptr, nullptr))
{ {
@ -421,7 +422,7 @@ bool RenameSync(const std::string& srcFilename, const std::string& destFilename)
// copies file source_path to destination_path, returns true on success // copies file source_path to destination_path, returns true on success
bool Copy(const std::string& source_path, const std::string& destination_path) bool Copy(const std::string& source_path, const std::string& destination_path)
{ {
INFO_LOG_FMT(COMMON, "Copy: {} --> {}", source_path, destination_path); DEBUG_LOG_FMT(COMMON, "Copy: {} --> {}", source_path, destination_path);
#ifdef _WIN32 #ifdef _WIN32
if (CopyFile(UTF8ToTStr(source_path).c_str(), UTF8ToTStr(destination_path).c_str(), FALSE)) if (CopyFile(UTF8ToTStr(source_path).c_str(), UTF8ToTStr(destination_path).c_str(), FALSE))
return true; return true;
@ -473,7 +474,7 @@ u64 GetSize(FILE* f)
// creates an empty file filename, returns true on success // creates an empty file filename, returns true on success
bool CreateEmptyFile(const std::string& filename) bool CreateEmptyFile(const std::string& filename)
{ {
INFO_LOG_FMT(COMMON, "CreateEmptyFile: {}", filename); DEBUG_LOG_FMT(COMMON, "CreateEmptyFile: {}", filename);
if (!File::IOFile(filename, "wb")) if (!File::IOFile(filename, "wb"))
{ {
@ -495,7 +496,7 @@ FSTEntry ScanDirectoryTree(std::string directory, bool recursive)
directory.pop_back(); directory.pop_back();
#endif #endif
INFO_LOG_FMT(COMMON, "ScanDirectoryTree: directory {}", directory); DEBUG_LOG_FMT(COMMON, "ScanDirectoryTree: directory {}", directory);
FSTEntry parent_entry; FSTEntry parent_entry;
parent_entry.physicalName = directory; parent_entry.physicalName = directory;
parent_entry.isDirectory = true; parent_entry.isDirectory = true;
@ -596,7 +597,7 @@ FSTEntry ScanDirectoryTree(std::string directory, bool recursive)
// Deletes the given directory and anything under it. Returns true on success. // Deletes the given directory and anything under it. Returns true on success.
bool DeleteDirRecursively(const std::string& directory) bool DeleteDirRecursively(const std::string& directory)
{ {
INFO_LOG_FMT(COMMON, "DeleteDirRecursively: {}", directory); DEBUG_LOG_FMT(COMMON, "DeleteDirRecursively: {}", directory);
bool success = true; bool success = true;
#ifdef _WIN32 #ifdef _WIN32

View File

@ -87,7 +87,7 @@ static void SetPixelColorOnly(u32 offset, u8* rgb)
break; break;
case PixelFormat::RGB565_Z16: case PixelFormat::RGB565_Z16:
{ {
INFO_LOG_FMT(VIDEO, "RGB565_Z16 is not supported correctly yet"); // TODO: RGB565_Z16 is not supported correctly yet
u32 src = *(u32*)rgb; u32 src = *(u32*)rgb;
u32* dst = (u32*)&efb[offset]; u32* dst = (u32*)&efb[offset];
u32 val = *dst & 0xff000000; u32 val = *dst & 0xff000000;
@ -129,7 +129,7 @@ static void SetPixelAlphaColor(u32 offset, u8* color)
break; break;
case PixelFormat::RGB565_Z16: case PixelFormat::RGB565_Z16:
{ {
INFO_LOG_FMT(VIDEO, "RGB565_Z16 is not supported correctly yet"); // TODO: RGB565_Z16 is not supported correctly yet
u32 src = *(u32*)color; u32 src = *(u32*)color;
u32* dst = (u32*)&efb[offset]; u32* dst = (u32*)&efb[offset];
u32 val = *dst & 0xff000000; u32 val = *dst & 0xff000000;
@ -161,7 +161,7 @@ static u32 GetPixelColor(u32 offset)
Convert6To8((src >> 18) & 0x3f) << 24; // Red Convert6To8((src >> 18) & 0x3f) << 24; // Red
case PixelFormat::RGB565_Z16: case PixelFormat::RGB565_Z16:
INFO_LOG_FMT(VIDEO, "RGB565_Z16 is not supported correctly yet"); // TODO: RGB565_Z16 is not supported correctly yet
return 0xff | ((src & 0x00ffffff) << 8); return 0xff | ((src & 0x00ffffff) << 8);
default: default:
@ -186,7 +186,7 @@ static void SetPixelDepth(u32 offset, u32 depth)
break; break;
case PixelFormat::RGB565_Z16: case PixelFormat::RGB565_Z16:
{ {
INFO_LOG_FMT(VIDEO, "RGB565_Z16 is not supported correctly yet"); // TODO: RGB565_Z16 is not supported correctly yet
u32* dst = (u32*)&efb[offset]; u32* dst = (u32*)&efb[offset];
u32 val = *dst & 0xff000000; u32 val = *dst & 0xff000000;
val |= depth & 0x00ffffff; val |= depth & 0x00ffffff;
@ -214,7 +214,7 @@ static u32 GetPixelDepth(u32 offset)
break; break;
case PixelFormat::RGB565_Z16: case PixelFormat::RGB565_Z16:
{ {
INFO_LOG_FMT(VIDEO, "RGB565_Z16 is not supported correctly yet"); // TODO: RGB565_Z16 is not supported correctly yet
depth = (*(u32*)&efb[offset]) & 0x00ffffff; depth = (*(u32*)&efb[offset]) & 0x00ffffff;
} }
break; break;