Add filesystem header to select between std::filesystem and std::experimental::filesystem depending on system availability.
Commit amended by Adam Honse <calcprogrammer1@gmail.com>
This commit is contained in:
parent
05d72ba96f
commit
ad2cd89128
6 changed files with 33 additions and 21 deletions
|
|
@ -4,9 +4,7 @@
|
|||
#include <iostream>
|
||||
#include "ResourceManager.h"
|
||||
|
||||
#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#include "filesystem.h"
|
||||
|
||||
static const char* log_codes[] = {"CRITICAL", "ERROR", "Message", "Warning", "Notice", "[verbose]", "Debug"};
|
||||
|
||||
|
|
@ -77,13 +75,13 @@ void LogManager::configure(json config, const std::string &defaultDir)
|
|||
/*-------------------------------------------------*\
|
||||
| If the path is relative, use logs dir |
|
||||
\*-------------------------------------------------*/
|
||||
fs::path p = logname;
|
||||
filesystem::path p = logname;
|
||||
if(p.is_relative())
|
||||
{
|
||||
p = defaultDir + "logs/";
|
||||
p.append(logname);
|
||||
}
|
||||
fs::create_directories(p.parent_path());
|
||||
filesystem::create_directories(p.parent_path());
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Open the logfile |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue