A lot of changes to 1.4.17
This commit is contained in:
parent
a4d7c90945
commit
b1f5620760
@ -67,7 +67,7 @@ namespace ts {
|
||||
auto permission_manager = this->permissions(); /* copy the manager */
|
||||
assert(permission_manager);
|
||||
const auto data = permission_manager->permission_value_flagged(permission);
|
||||
return BasicChannel::permission_granted(data,granted_value, require_granted_value);
|
||||
return BasicChannel::permission_granted(data, granted_value, require_granted_value);
|
||||
}
|
||||
|
||||
ts_always_inline bool talk_power_granted(const permission::v2::PermissionFlaggedValue& granted_value) {
|
||||
|
@ -110,30 +110,25 @@ namespace logger {
|
||||
logger(0)->debug("Creating new grouped logger for group {}", group);
|
||||
|
||||
vector<spdlog::sink_ptr> sinks;
|
||||
string path;
|
||||
if(logConfig->logfileLevel != spdlog::level::off) {
|
||||
path = generate_log_file(group);
|
||||
auto path = generate_log_file(group);
|
||||
|
||||
auto logFile = fs::u8path(path);
|
||||
if(!logFile.parent_path().empty())
|
||||
fs::create_directories(logFile.parent_path());
|
||||
auto logFile = fs::u8path(path);
|
||||
if(!logFile.parent_path().empty())
|
||||
fs::create_directories(logFile.parent_path());
|
||||
|
||||
try {
|
||||
auto sink = make_shared<spdlog::sinks::rotating_file_sink_mt>(logFile.string(), 1024 * 1024 * 50, 12);
|
||||
sink->set_formatter(std::make_unique<LogFormatter>(::logger::currentConfig()->file_colored));
|
||||
sinks.push_back(sink);
|
||||
} catch(std::exception& ex) {
|
||||
if(group != 0 && group != -1)
|
||||
logger(0)->critical("Failed to create file for new log group: {}", ex.what());
|
||||
else
|
||||
try {
|
||||
auto sink = make_shared<spdlog::sinks::rotating_file_sink_mt>(logFile.string(), 1024 * 1024 * 50, 12);
|
||||
sink->set_formatter(std::make_unique<LogFormatter>(::logger::currentConfig()->file_colored));
|
||||
sinks.push_back(sink);
|
||||
} catch(std::exception& ex) {
|
||||
if(group != 0 && group != -1)
|
||||
logger(0)->critical("Failed to create file for new log group: {}", ex.what());
|
||||
else
|
||||
#ifdef HAVE_CXX_TERMINAL
|
||||
terminal::instance()->writeMessage("§4[CRITICAL] §eFailed to create main log file: " + string{ex.what()}, false);
|
||||
terminal::instance()->writeMessage("§4[CRITICAL] §eFailed to create main log file: " + string{ex.what()}, false);
|
||||
#else
|
||||
std::cout << "[CRITICAL] Failed to create main log file: " << ex.what() << "\n";
|
||||
std::cout << "[CRITICAL] Failed to create main log file: " << ex.what() << "\n";
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
path = "/dev/null (" + to_string(group) + ")";
|
||||
}
|
||||
sinks.push_back(terminalSink);
|
||||
|
||||
@ -143,6 +138,7 @@ namespace logger {
|
||||
std::shared_ptr<spdlog::logger> logger;
|
||||
if(!logConfig->sync) {
|
||||
logger = std::make_shared<spdlog::async_logger>("Logger (" + path + ")", sinks.begin(), sinks.end(), logging_threads, async_overflow_policy::block);
|
||||
logger->flush_on(level::debug);
|
||||
} else {
|
||||
logger = std::make_shared<spdlog::logger>("Logger (" + path + ")", sinks.begin(), sinks.end());
|
||||
logger->flush_on(level::trace);
|
||||
|
Loading…
Reference in New Issue
Block a user