diff options
| author | KiritoDv <kiritodev01@gmail.com> | 2023-09-24 14:26:01 -0600 |
|---|---|---|
| committer | KiritoDv <kiritodev01@gmail.com> | 2023-09-24 14:26:01 -0600 |
| commit | bc291abe508aa887543350a2db8883930778aafd (patch) | |
| tree | e6af6f5c72ecaaed32180fbfbf14023628ef8f1b | |
| parent | 9c6e090b80a7ea6fd4bf41f3b5fefb5de5c4e61b (diff) | |
Moved pattern into variables
| -rw-r--r-- | src/Companion.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/Companion.cpp b/src/Companion.cpp index 40fd975..2528ce9 100644 --- a/src/Companion.cpp +++ b/src/Companion.cpp @@ -49,6 +49,9 @@ void Companion::Init() { void Companion::Process() { + const std::string regular = "[%Y-%m-%d %H:%M:%S.%e] [%l] %v"; + const std::string line = "[%Y-%m-%d %H:%M:%S.%e] [%l] > %v"; + auto start = duration_cast<milliseconds>(system_clock::now().time_since_epoch()); std::ifstream input( this->gRomPath, std::ios::binary ); @@ -70,7 +73,7 @@ void Companion::Process() { auto otr = cfg["output"].as<std::string>(); SPDLOG_INFO("------------------------------------------------"); - spdlog::set_pattern("[%Y-%m-%d %H:%M:%S.%e] [%l] > %v"); + spdlog::set_pattern(line); SPDLOG_INFO("Starting CubeOS..."); SPDLOG_INFO("Game: {}", cartridge->GetGameTitle()); @@ -95,9 +98,9 @@ void Companion::Process() { LUS::BinaryWriter write = LUS::BinaryWriter(); RawFactory* factory = this->GetFactory(type); - spdlog::set_pattern("[%Y-%m-%d %H:%M:%S.%e] [%l] %v"); + spdlog::set_pattern(regular); SPDLOG_INFO("------------------------------------------------"); - spdlog::set_pattern("[%Y-%m-%d %H:%M:%S.%e] [%l] > %v"); + spdlog::set_pattern(line); SPDLOG_INFO("Processing {} [{}]", asset->first.as<std::string>(), type); SPDLOG_INFO("Root: {}", entry.path().string()); @@ -130,16 +133,16 @@ void Companion::Process() { } } - spdlog::set_pattern("[%Y-%m-%d %H:%M:%S.%e] [%l] %v"); + spdlog::set_pattern(regular); SPDLOG_INFO("------------------------------------------------"); - spdlog::set_pattern("[%Y-%m-%d %H:%M:%S.%e] [%l] > %v"); + spdlog::set_pattern(line); SPDLOG_INFO("Writing version file"); wrapper.CreateFile("version", vWriter.ToVector()); vWriter.Close(); auto end = duration_cast<milliseconds>(system_clock::now().time_since_epoch()); SPDLOG_INFO("Done! Took {}ms", end.count() - start.count()); SPDLOG_INFO("Exported to {}", otr); - spdlog::set_pattern("[%Y-%m-%d %H:%M:%S.%e] [%l] %v"); + spdlog::set_pattern(regular); SPDLOG_INFO("------------------------------------------------"); MIO0Decoder::ClearCache(); |
