Introduce Platform::Log (#1640)

* Add Platform::Log and Platform::LogLevel

* Replace most printf calls with Platform::Log calls

* Move a brace down

* Move some log entries to one Log call

- Some implementations of Log may assume a full line

* Log the MAC address as LogLevel::Info
This commit is contained in:
Jesse Talavera-Greenberg
2023-03-23 13:04:38 -04:00
committed by GitHub
parent 19280cff2d
commit 79dfb8dc8f
50 changed files with 521 additions and 378 deletions

View File

@ -22,6 +22,8 @@
#include "SaveManager.h"
#include "Platform.h"
using Platform::Log;
using Platform::LogLevel;
SaveManager::SaveManager(std::string path) : QThread()
{
@ -122,7 +124,7 @@ void SaveManager::CheckFlush()
SecondaryBufferLock->lock();
printf("SaveManager: Flush requested\n");
Log(LogLevel::Info, "SaveManager: Flush requested\n");
if (SecondaryBufferLength != Length)
{
@ -178,7 +180,7 @@ void SaveManager::FlushSecondaryBuffer(u8* dst, u32 dstLength)
FILE* f = Platform::OpenFile(Path, "wb");
if (f)
{
printf("SaveManager: Written\n");
Log(LogLevel::Info, "SaveManager: Written\n");
fwrite(SecondaryBuffer, SecondaryBufferLength, 1, f);
fclose(f);
}