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
{

View File

@@ -33,7 +33,7 @@ namespace openVulkanoCpp
static Ptr AR;
static Ptr PERF;
static void SetupLogger(const std::string& logFolder = "logs", const std::string& logFile = "openVulkano.log");
static void SetupLogger(std::string logFolder = "", const std::string& logFile = "openVulkano.log");
/**
* \brief Creates a new custom logger that writes to the main log file.