Store logs in app data dir

This commit is contained in:
2021-03-27 11:12:13 +01:00
parent 01a8f837b7
commit 69775368ee
2 changed files with 4 additions and 2 deletions

View File

@@ -6,6 +6,7 @@
#include "Math/ByteSize.hpp"
#include "Logger.hpp"
#include "IO/AppFolders.hpp"
#include <iostream>
#include <filesystem>
#include <spdlog/sinks/rotating_file_sink.h>
@@ -37,8 +38,9 @@ namespace openVulkanoCpp
Logger::Ptr Logger::AR = nullptr;
Logger::Ptr Logger::PERF = nullptr;
void Logger::SetupLogger(const std::string& logFolder, const std::string& logFile)
void Logger::SetupLogger(std::string logFolder, const std::string& logFile)
{
if (logFolder.empty()) logFolder = (AppFolders::GetAppDataHomeDir() / "logs").string();
if (!SINKS.empty()) return;
try
{