Store logs in app data dir
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user