Browse Source

BRING BACK OLD LOGS

pull/3688/head
lizzie 7 days ago
committed by crueter
parent
commit
4e96e0a1ff
  1. 6
      src/common/logging.cpp

6
src/common/logging.cpp

@ -247,6 +247,12 @@ struct ColorConsoleBackend final : public Backend {
/// @brief Backend that writes to a file passed into the constructor /// @brief Backend that writes to a file passed into the constructor
struct FileBackend final : public Backend { struct FileBackend final : public Backend {
explicit FileBackend(const std::filesystem::path& filename) noexcept { 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); file.emplace(filename, FS::FileAccessMode::Write, FS::FileType::TextFile);
} }
~FileBackend() noexcept override = default; ~FileBackend() noexcept override = default;

Loading…
Cancel
Save