aboutsummaryrefslogtreecommitdiff
path: root/src/configparser.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-01-18 03:30:22 +0000
committerGravatar Sadie Powell2022-05-01 22:07:14 +0100
commite23ee3fde17a6bb17a9e56c7105f4bbceb36391f (patch)
treeb5117aa2cc0fe2bee18df3a5dabf0ecc49dbd30e /src/configparser.cpp
parentRewrite the entire logging system. (diff)
Rewrite logging calls to use the new APIs.
Diffstat (limited to 'src/configparser.cpp')
-rw-r--r--src/configparser.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/configparser.cpp b/src/configparser.cpp
index d7c0f54ca..23995d825 100644
--- a/src/configparser.cpp
+++ b/src/configparser.cpp
@@ -418,9 +418,7 @@ void ParseStack::DoInclude(std::shared_ptr<ConfigTag> tag, int flags)
FilePtr ParseStack::DoOpenFile(const std::string& name, bool isexec)
{
- ServerInstance->Logs.Log("CONFIG", LOG_DEBUG, "Opening %s: %s",
- isexec ? "file" : "executable", name.c_str());
-
+ ServerInstance->Logs.Debug("CONFIG", "Opening %s: %s", isexec ? "file" : "executable", name.c_str());
if (isexec)
return FilePtr(popen(name.c_str(), "r"), pclose);
else
@@ -532,7 +530,7 @@ bool ConfigTag::readString(const std::string& key, std::string& value, bool allo
value = ivalue;
if (!allow_lf && (value.find('\n') != std::string::npos))
{
- ServerInstance->Logs.Log("CONFIG", LOG_DEFAULT, "Value of <" + name + ":" + key + "> at " + source.str() +
+ ServerInstance->Logs.Normal("CONFIG", "Value of <" + name + ":" + key + "> at " + source.str() +
" contains a linefeed, and linefeeds in this value are not permitted -- stripped to spaces.");
for (auto& chr : value)
@@ -554,7 +552,7 @@ std::string ConfigTag::getString(const std::string& key, const std::string& def,
if (!validator(res))
{
- ServerInstance->Logs.Log("CONFIG", LOG_DEFAULT, "WARNING: The value of <%s:%s> is not valid; value set to %s.",
+ ServerInstance->Logs.Normal("CONFIG", "WARNING: The value of <%s:%s> is not valid; value set to %s.",
name.c_str(), key.c_str(), def.c_str());
return def;
}
@@ -569,7 +567,7 @@ std::string ConfigTag::getString(const std::string& key, const std::string& def,
if (res.length() < minlen || res.length() > maxlen)
{
- ServerInstance->Logs.Log("CONFIG", LOG_DEFAULT, "WARNING: The length of <%s:%s> is not between %ld and %ld; value set to %s.",
+ ServerInstance->Logs.Normal("CONFIG", "WARNING: The length of <%s:%s> is not between %ld and %ld; value set to %s.",
name.c_str(), key.c_str(), minlen, maxlen, def.c_str());
return def;
}
@@ -612,7 +610,7 @@ namespace
const std::string message = "WARNING: <" + tag + ":" + key + "> value of " + val + " contains an invalid magnitude specifier '"
+ tail + "'; value set to " + ConvToStr(def) + ".";
- ServerInstance->Logs.Log("CONFIG", LOG_DEFAULT, message);
+ ServerInstance->Logs.Normal("CONFIG", message);
num = def;
}
@@ -633,7 +631,7 @@ namespace
const std::string message = "WARNING: <" + tag + ":" + key + "> value of " + ConvToStr(num) + " is not between "
+ ConvToStr(min) + " and " + ConvToStr(max) + "; value set to " + ConvToStr(def) + ".";
- ServerInstance->Logs.Log("CONFIG", LOG_DEFAULT, message);
+ ServerInstance->Logs.Normal("CONFIG", message);
num = def;
}
}
@@ -681,7 +679,7 @@ unsigned long ConfigTag::getDuration(const std::string& key, unsigned long def,
unsigned long ret;
if (!InspIRCd::Duration(duration, ret))
{
- ServerInstance->Logs.Log("CONFIG", LOG_DEFAULT, "Value of <" + name + ":" + key + "> at " + source.str() +
+ ServerInstance->Logs.Normal("CONFIG", "Value of <" + name + ":" + key + "> at " + source.str() +
" is not a duration; value set to " + ConvToStr(def) + ".");
return def;
}
@@ -713,7 +711,7 @@ bool ConfigTag::getBool(const std::string& key, bool def) const
if (stdalgo::string::equalsci(result, "no") || stdalgo::string::equalsci(result, "false") || stdalgo::string::equalsci(result, "off"))
return false;
- ServerInstance->Logs.Log("CONFIG", LOG_DEFAULT, "Value of <" + name + ":" + key + "> at " + source.str() +
+ ServerInstance->Logs.Normal("CONFIG", "Value of <" + name + ":" + key + "> at " + source.str() +
" is not valid, ignoring");
return def;
}