mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-13 04:58:58 +02:00
BRING BACK OLD LOGS
This commit is contained in:
parent
a57331ddbc
commit
4e96e0a1ff
1 changed files with 6 additions and 0 deletions
|
|
@ -247,6 +247,12 @@ struct ColorConsoleBackend final : public Backend {
|
|||
/// @brief Backend that writes to a file passed into the constructor
|
||||
struct FileBackend final : public Backend {
|
||||
explicit FileBackend(const std::filesystem::path& filename) noexcept {
|
||||
auto old_filename = filename;
|
||||
old_filename += ".old.txt";
|
||||
// Existence checks are done within the functions themselves.
|
||||
// We don't particularly care if these succeed or not.
|
||||
void(FS::RemoveFile(old_filename));
|
||||
void(FS::RenameFile(filename, old_filename));
|
||||
file.emplace(filename, FS::FileAccessMode::Write, FS::FileType::TextFile);
|
||||
}
|
||||
~FileBackend() noexcept override = default;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue