central nginx manager

This commit is contained in:
Ned Wright
2025-01-13 12:35:42 +00:00
parent 35b2df729f
commit 6db87fc7fe
45 changed files with 390 additions and 130 deletions

View File

@@ -27,6 +27,7 @@
#include "i_instance_awareness.h"
#include "i_signal_handler.h"
#include "hash_combine.h"
#include "version.h"
using namespace std;
@@ -298,14 +299,19 @@ AlertInfo::evalParams()
Debug::Debug(
const string &file_name,
const string &func_name,
const uint &line)
const uint &line,
bool force_assert)
{
if (Singleton::exists<Config::I_Config>()) {
do_assert = getConfigurationWithDefault<bool>(true, "Debug I/S", "Abort on assertion");
if (!force_assert && !should_assert_optional) {
do_assert = false;
} else {
do_assert = true;
}
if (Singleton::exists<Config::I_Config>()) {
do_assert = getConfigurationWithDefault<bool>(do_assert, "Debug I/S", "Abort on assertion");
}
auto current_configuration =
Singleton::exists<Config::I_Config>() ? getConfigurationWithDefault(default_config, "Debug") : default_config;
@@ -519,6 +525,13 @@ Debug::preload()
active_streams["STDOUT"] = make_shared<Debug::DebugStream>(&cout);
active_streams["FOG"] = make_shared<DebugFogStream>();
string branch = Version::getBranch();
if (branch == "master" || branch.substr(0, 6) == "hotfix") {
should_assert_optional = false;
} else {
should_assert_optional = true;
}
}
void
@@ -844,3 +857,4 @@ bool Debug::is_fail_open_mode = false;
bool Debug::debug_override_exist = false;
string Debug::default_debug_file_stream_path = "";
vector<string> Debug::streams_from_mgmt;
bool Debug::should_assert_optional = true;

View File

@@ -396,14 +396,18 @@ LogLevel
DebugFogStream::getLogLevel() const
{
switch (level) {
case Debug::DebugLevel::NOISE: dbgAssert(false) << alert << "Impossible LogLevel 'Noise'"; break;
case Debug::DebugLevel::NOISE:
dbgAssertOpt(false) << alert << "Impossible LogLevel 'Noise'";
return LogLevel::TRACE;
case Debug::DebugLevel::TRACE: return LogLevel::TRACE;
case Debug::DebugLevel::DEBUG: return LogLevel::DEBUG;
case Debug::DebugLevel::WARNING: return LogLevel::WARNING;
case Debug::DebugLevel::INFO: return LogLevel::INFO;
case Debug::DebugLevel::ERROR: return LogLevel::ERROR;
case Debug::DebugLevel::ASSERTION: return LogLevel::ERROR;
case Debug::DebugLevel::NONE: dbgAssert(false) << alert << "Impossible LogLevel 'None'"; break;
case Debug::DebugLevel::NONE:
dbgAssertOpt(false) << alert << "Impossible LogLevel 'None'";
return LogLevel::ERROR;
}
return LogLevel::INFO;