A lot of updates
This commit is contained in:
+11
-2
@@ -3,6 +3,7 @@
|
||||
#include <iomanip>
|
||||
#include <fstream>
|
||||
#include <map>
|
||||
#include <CXXTerminal/Terminal.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
#include <experimental/filesystem>
|
||||
#include <StringVariable.h>
|
||||
@@ -66,8 +67,15 @@ namespace logger {
|
||||
if(!logFile.parent_path().empty())
|
||||
fs::create_directories(logFile.parent_path());
|
||||
|
||||
auto fileSink = make_shared<ColoredFileSink>(logFile.string(), 1024 * 1024 * 50, 12);
|
||||
sinks.push_back(fileSink);
|
||||
try {
|
||||
auto fileSink = make_shared<ColoredFileSink>(logFile.string(), 1024 * 1024 * 50, 12);
|
||||
sinks.push_back(fileSink);
|
||||
} catch(std::exception& ex) {
|
||||
if(group != 0 && group != -1)
|
||||
logger(0)->critical("Failed to create file for new log group: {}", ex.what());
|
||||
else
|
||||
terminal::instance()->writeMessage("§4[CRITICAL] §eFailed to create main log file: " + string{ex.what()}, false);
|
||||
}
|
||||
} else {
|
||||
path = "/dev/null (" + to_string(serverId) + ")";
|
||||
}
|
||||
@@ -140,6 +148,7 @@ namespace logger {
|
||||
loggerEntry.second.reset();
|
||||
}
|
||||
loggers.clear();
|
||||
spdlog::drop_all();
|
||||
|
||||
logConfig = nullptr;
|
||||
terminalSink = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user