mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
吸出し起動時にログを削除するように
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@17 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
parent
52cb279122
commit
2c24127d32
@ -191,6 +191,9 @@ extern "C" void nnMain(void)
|
|||||||
// RenderSystemを作ってからログが出せる
|
// RenderSystemを作ってからログが出せる
|
||||||
common::Logger::InitializeEjectThread();
|
common::Logger::InitializeEjectThread();
|
||||||
common::Logger::SetEjectHandler(OnSdEjected);
|
common::Logger::SetEjectHandler(OnSdEjected);
|
||||||
|
// 起動時に削除
|
||||||
|
common::Logger::GetLoggerInstance()->ClearLog();
|
||||||
|
|
||||||
COMMON_LOGGER("\n");
|
COMMON_LOGGER("\n");
|
||||||
COMMON_LOGGER("CTR Console Backup start\n");
|
COMMON_LOGGER("CTR Console Backup start\n");
|
||||||
|
|
||||||
|
|||||||
@ -91,6 +91,12 @@ void CommonLogger::PrintResultIfFailed(nn::Result result, u32 line)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CommonLogger::ClearLog()
|
||||||
|
{
|
||||||
|
nn::os::CriticalSection::ScopedLock lock(m_CriticalSection);
|
||||||
|
GetSdInstance()->Clear();
|
||||||
|
}
|
||||||
|
|
||||||
void CommonLogger::ScrollUp()
|
void CommonLogger::ScrollUp()
|
||||||
{
|
{
|
||||||
GetConsoleInstance()->ScrollUp();
|
GetConsoleInstance()->ScrollUp();
|
||||||
|
|||||||
@ -28,6 +28,7 @@
|
|||||||
(void)common::Logger::GetLoggerInstance()->PrintResult("Result = %X\n", result.GetPrintableBits()); \
|
(void)common::Logger::GetLoggerInstance()->PrintResult("Result = %X\n", result.GetPrintableBits()); \
|
||||||
|
|
||||||
#define COMMON_LOGGER_RESULT_WITH_LINE(result, line) \
|
#define COMMON_LOGGER_RESULT_WITH_LINE(result, line) \
|
||||||
|
(void)nn::dbg::detail::Printf("%d\n", line); \
|
||||||
(void)nn::dbg::PrintResult(result); \
|
(void)nn::dbg::PrintResult(result); \
|
||||||
(void)common::Logger::GetLoggerInstance()->PrintResult("line = %d\n", line); \
|
(void)common::Logger::GetLoggerInstance()->PrintResult("line = %d\n", line); \
|
||||||
(void)common::Logger::GetLoggerInstance()->PrintResult("Result = %X\n", result.GetPrintableBits()); \
|
(void)common::Logger::GetLoggerInstance()->PrintResult("Result = %X\n", result.GetPrintableBits()); \
|
||||||
@ -62,6 +63,7 @@ public:
|
|||||||
void Print(const char* fmt, ...);
|
void Print(const char* fmt, ...);
|
||||||
void PrintResult(const char* fmt, ...);
|
void PrintResult(const char* fmt, ...);
|
||||||
void PrintResultIfFailed(nn::Result result, u32 line = 0);
|
void PrintResultIfFailed(nn::Result result, u32 line = 0);
|
||||||
|
void ClearLog();
|
||||||
void ScrollUp();
|
void ScrollUp();
|
||||||
void ScrollDown();
|
void ScrollDown();
|
||||||
void ScrollToBegin();
|
void ScrollToBegin();
|
||||||
|
|||||||
@ -189,6 +189,23 @@ void SdLogger::Print(const char* fmt, ::std::va_list arg)
|
|||||||
SdMountManager::Unmount();
|
SdMountManager::Unmount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SdLogger::Clear()
|
||||||
|
{
|
||||||
|
nn::Result result;
|
||||||
|
SdMountManager::Mount();
|
||||||
|
|
||||||
|
::std::wstring log(SDMC_ROOT_NAME);
|
||||||
|
log += LOG_FILENAME;
|
||||||
|
|
||||||
|
result = nn::fs::TryDeleteFile(log.c_str());
|
||||||
|
if(result.IsFailure())
|
||||||
|
{
|
||||||
|
nn::dbg::PrintResult(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
SdMountManager::Unmount();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Logger
|
} // namespace Logger
|
||||||
} // namespace ConsoleBackup
|
} // namespace ConsoleBackup
|
||||||
|
|
||||||
|
|||||||
@ -36,6 +36,7 @@ public:
|
|||||||
~SdLogger() {};
|
~SdLogger() {};
|
||||||
|
|
||||||
void Print(const char* fmt, ::std::va_list arg);
|
void Print(const char* fmt, ::std::va_list arg);
|
||||||
|
void Clear();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
nn::fs::FileOutputStream sd;
|
nn::fs::FileOutputStream sd;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user