aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar Sadie Powell2023-08-11 12:39:49 +0100
committerGravatar Sadie Powell2023-08-11 12:39:49 +0100
commitf73e9e606b61324f4ac34d3f506b7cbaf87713c7 (patch)
tree1ca0ac7ed371483bd1d9a3fbec3959af61067dbb /src/modules
parentMake the linkdata host/unix cloaks longer to test suffix truncation. (diff)
Rename the error log level to critical.
"ERROR" is apparently defined by more than just Windows. Let's pick a different name which is less likely to cause collisions.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/extra/m_log_syslog.cpp2
-rw-r--r--src/modules/extra/m_mysql.cpp6
-rw-r--r--src/modules/extra/m_pgsql.cpp2
-rw-r--r--src/modules/extra/m_sqlite3.cpp2
-rw-r--r--src/modules/m_permchannels.cpp8
-rw-r--r--src/modules/m_xline_db.cpp10
6 files changed, 15 insertions, 15 deletions
diff --git a/src/modules/extra/m_log_syslog.cpp b/src/modules/extra/m_log_syslog.cpp
index 5feba1957..ec5e8c47b 100644
--- a/src/modules/extra/m_log_syslog.cpp
+++ b/src/modules/extra/m_log_syslog.cpp
@@ -30,7 +30,7 @@ private:
{
switch (level)
{
- case Log::Level::ERROR:
+ case Log::Level::CRITICAL:
return LOG_ERR;
case Log::Level::WARNING:
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp
index e063185ae..ffb6cf0e9 100644
--- a/src/modules/extra/m_mysql.cpp
+++ b/src/modules/extra/m_mysql.cpp
@@ -337,7 +337,7 @@ public:
unsigned int port = config->getNum<unsigned int>("port", 3306, 1, 65535);
if (!mysql_real_connect(connection, host.c_str(), user.c_str(), pass.c_str(), dbname.c_str(), port, nullptr, CLIENT_IGNORE_SIGPIPE))
{
- ServerInstance->Logs.Error(MODNAME, "Unable to connect to the {} MySQL server: {}",
+ ServerInstance->Logs.Critical(MODNAME, "Unable to connect to the {} MySQL server: {}",
GetId(), mysql_error(connection));
return false;
}
@@ -346,7 +346,7 @@ public:
const std::string charset = config->getString("charset");
if (!charset.empty() && mysql_set_character_set(connection, charset.c_str()))
{
- ServerInstance->Logs.Error(MODNAME, "Could not set character set for {} to \"{}\": {}",
+ ServerInstance->Logs.Critical(MODNAME, "Could not set character set for {} to \"{}\": {}",
GetId(), charset, mysql_error(connection));
return false;
}
@@ -355,7 +355,7 @@ public:
const std::string initialquery = config->getString("initialquery");
if (!initialquery.empty() && mysql_real_query(connection, initialquery.data(), initialquery.length()))
{
- ServerInstance->Logs.Error(MODNAME, "Could not execute initial query \"{}\" for {}: {}",
+ ServerInstance->Logs.Critical(MODNAME, "Could not execute initial query \"{}\" for {}: {}",
initialquery, name, mysql_error(connection));
return false;
}
diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp
index 97476d2d5..5205a402b 100644
--- a/src/modules/extra/m_pgsql.cpp
+++ b/src/modules/extra/m_pgsql.cpp
@@ -308,7 +308,7 @@ public:
bool HandleConnectError(const char* reason)
{
- ServerInstance->Logs.Error(MODNAME, "Could not connect to the \"{}\" database: {}",
+ ServerInstance->Logs.Critical(MODNAME, "Could not connect to the \"{}\" database: {}",
GetId(), reason);
return false;
}
diff --git a/src/modules/extra/m_sqlite3.cpp b/src/modules/extra/m_sqlite3.cpp
index b98e4bc9c..919876b6e 100644
--- a/src/modules/extra/m_sqlite3.cpp
+++ b/src/modules/extra/m_sqlite3.cpp
@@ -113,7 +113,7 @@ public:
// Even in case of an error conn must be closed
sqlite3_close(conn);
conn = nullptr;
- ServerInstance->Logs.Error(MODNAME, "WARNING: Could not open DB with id: " + tag->getString("id"));
+ ServerInstance->Logs.Critical(MODNAME, "WARNING: Could not open DB with id: " + tag->getString("id"));
}
}
diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp
index 37e11fa55..5e404ab9c 100644
--- a/src/modules/m_permchannels.cpp
+++ b/src/modules/m_permchannels.cpp
@@ -79,7 +79,7 @@ static bool WriteDatabase(PermChannel& permchanmode, bool save_listmodes)
std::ofstream stream(permchannelsnewconf);
if (!stream.is_open())
{
- ServerInstance->Logs.Error(MODNAME, "Cannot create database \"{}\"! {} ({})", permchannelsnewconf, strerror(errno), errno);
+ ServerInstance->Logs.Critical(MODNAME, "Cannot create database \"{}\"! {} ({})", permchannelsnewconf, strerror(errno), errno);
ServerInstance->SNO.WriteToSnoMask('a', "database: cannot create new permchan db \"{}\": {} ({})", permchannelsnewconf, strerror(errno), errno);
return false;
}
@@ -151,7 +151,7 @@ static bool WriteDatabase(PermChannel& permchanmode, bool save_listmodes)
if (stream.fail())
{
- ServerInstance->Logs.Error(MODNAME, "Cannot write to new database \"{}\"! {} ({})", permchannelsnewconf, strerror(errno), errno);
+ ServerInstance->Logs.Critical(MODNAME, "Cannot write to new database \"{}\"! {} ({})", permchannelsnewconf, strerror(errno), errno);
ServerInstance->SNO.WriteToSnoMask('a', "database: cannot write to new permchan db \"{}\": {} ({})", permchannelsnewconf, strerror(errno), errno);
return false;
}
@@ -163,7 +163,7 @@ static bool WriteDatabase(PermChannel& permchanmode, bool save_listmodes)
// Use rename to move temporary to new db - this is guaranteed not to fuck up, even in case of a crash.
if (rename(permchannelsnewconf.c_str(), permchannelsconf.c_str()) < 0)
{
- ServerInstance->Logs.Error(MODNAME, "Cannot replace old database \"{}\" with new database \"{}\"! {} ({})", permchannelsconf, permchannelsnewconf, strerror(errno), errno);
+ ServerInstance->Logs.Critical(MODNAME, "Cannot replace old database \"{}\" with new database \"{}\"! {} ({})", permchannelsconf, permchannelsnewconf, strerror(errno), errno);
ServerInstance->SNO.WriteToSnoMask('a', "database: cannot replace old permchan db \"{}\" with new db \"{}\": {} ({})", permchannelsconf, permchannelsnewconf, strerror(errno), errno);
return false;
}
@@ -342,7 +342,7 @@ public:
}
catch (const CoreException& e)
{
- ServerInstance->Logs.Error(MODNAME, "Error loading permchannels database: {}", e.what());
+ ServerInstance->Logs.Critical(MODNAME, "Error loading permchannels database: {}", e.what());
}
}
}
diff --git a/src/modules/m_xline_db.cpp b/src/modules/m_xline_db.cpp
index aa79e1e10..a387caefc 100644
--- a/src/modules/m_xline_db.cpp
+++ b/src/modules/m_xline_db.cpp
@@ -128,7 +128,7 @@ public:
std::ofstream stream(xlinenewdbpath);
if (!stream.is_open())
{
- ServerInstance->Logs.Error(MODNAME, "Cannot create database \"{}\"! {} ({})", xlinenewdbpath, strerror(errno), errno);
+ ServerInstance->Logs.Critical(MODNAME, "Cannot create database \"{}\"! {} ({})", xlinenewdbpath, strerror(errno), errno);
ServerInstance->SNO.WriteToSnoMask('x', "database: cannot create new xline db \"{}\": {} ({})", xlinenewdbpath, strerror(errno), errno);
return false;
}
@@ -166,7 +166,7 @@ public:
if (stream.fail())
{
- ServerInstance->Logs.Error(MODNAME, "Cannot write to new database \"{}\"! {} ({})", xlinenewdbpath, strerror(errno), errno);
+ ServerInstance->Logs.Critical(MODNAME, "Cannot write to new database \"{}\"! {} ({})", xlinenewdbpath, strerror(errno), errno);
ServerInstance->SNO.WriteToSnoMask('x', "database: cannot write to new xline db \"{}\": {} ({})", xlinenewdbpath, strerror(errno), errno);
return false;
}
@@ -178,7 +178,7 @@ public:
// Use rename to move temporary to new db - this is guaranteed not to fuck up, even in case of a crash.
if (rename(xlinenewdbpath.c_str(), xlinedbpath.c_str()) < 0)
{
- ServerInstance->Logs.Error(MODNAME, "Cannot replace old database \"{}\" with new database \"{}\"! {} ({})", xlinedbpath, xlinenewdbpath, strerror(errno), errno);
+ ServerInstance->Logs.Critical(MODNAME, "Cannot replace old database \"{}\" with new database \"{}\"! {} ({})", xlinedbpath, xlinenewdbpath, strerror(errno), errno);
ServerInstance->SNO.WriteToSnoMask('x', "database: cannot replace old xline db \"{}\" with new db \"{}\": {} ({})", xlinedbpath, xlinenewdbpath, strerror(errno), errno);
return false;
}
@@ -196,7 +196,7 @@ public:
std::ifstream stream(xlinedbpath);
if (!stream.is_open())
{
- ServerInstance->Logs.Error(MODNAME, "Cannot read database \"{}\"! {} ({})", xlinedbpath, strerror(errno), errno);
+ ServerInstance->Logs.Critical(MODNAME, "Cannot read database \"{}\"! {} ({})", xlinedbpath, strerror(errno), errno);
ServerInstance->SNO.WriteToSnoMask('x', "database: cannot read xline db \"{}\": {} ({})", xlinedbpath, strerror(errno), errno);
return false;
}
@@ -223,7 +223,7 @@ public:
if (command_p[1] != "1")
{
stream.close();
- ServerInstance->Logs.Error(MODNAME, "I got database version {} - I don't understand it", command_p[1]);
+ ServerInstance->Logs.Critical(MODNAME, "I got database version {} - I don't understand it", command_p[1]);
ServerInstance->SNO.WriteToSnoMask('x', "database: I got a database version ({}) I don't understand", command_p[1]);
return false;
}