1
0
mirror of https://github.com/anope/anope.git synced 2026-07-08 21:13:13 +02:00

Convert Anope::Debug to an unsigned value.

This commit is contained in:
Sadie Powell
2025-05-24 16:51:33 +01:00
parent e182519e4d
commit 23e72fc934
5 changed files with 10 additions and 11 deletions
+1 -1
View File
@@ -379,7 +379,7 @@ namespace Anope
/** The debug level we are running at.
*/
extern CoreExport int Debug;
extern CoreExport unsigned Debug;
/** Other command line options.
*/
+3 -3
View File
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Anope\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-05-10 14:34+0100\n"
"PO-Revision-Date: 2025-04-25 13:08+0100\n"
"POT-Creation-Date: 2025-05-24 16:43+0100\n"
"PO-Revision-Date: 2025-05-24 16:44+0100\n"
"Last-Translator: Sadie Powell <sadie@witchery.services>\n"
"Language-Team: English\n"
"Language: en_US\n"
@@ -4555,7 +4555,7 @@ msgid "Services are now at DEFCON %d."
msgstr ""
#, c-format
msgid "Services are now in debug mode (level %d)."
msgid "Services are now in debug mode (level %u)."
msgstr ""
msgid "Services are now in debug mode."
+2 -2
View File
@@ -122,12 +122,12 @@ private:
}
else
{
auto debug = Anope::TryConvert<int>(setting);
auto debug = Anope::TryConvert<unsigned>(setting);
if (debug.has_value())
{
Anope::Debug = debug.value();
Log(LOG_ADMIN, source, this) << "DEBUG " << Anope::Debug;
source.Reply(_("Services are now in \002debug\002 mode (level %d)."), Anope::Debug);
source.Reply(_("Services are now in \002debug\002 mode (level %u)."), Anope::Debug);
return;
}
+3 -4
View File
@@ -390,11 +390,10 @@ bool Anope::Init(int ac, char **av)
{
if (!arg.empty())
{
auto level = Anope::Convert<int>(arg, -1);
if (level > 0)
Anope::Debug = level;
else
auto level = Anope::TryConvert<unsigned>(arg);
if (!level.has_value())
throw CoreException("Invalid option given to --debug");
Anope::Debug = level.value();
}
else
++Anope::Debug;
+1 -1
View File
@@ -23,7 +23,7 @@
#endif
/* Command-line options: */
int Anope::Debug = 0;
unsigned Anope::Debug = 0;
bool Anope::ReadOnly = false, Anope::NoFork = false, Anope::NoThird = false, Anope::NoPID = false, Anope::NoExpire = false, Anope::ProtocolDebug = false;
Anope::string Anope::ServicesDir;
Anope::string Anope::ServicesBin;