aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_server.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp
index 67c31cd4e2a..d9cc9e3aa1f 100644
--- a/src/server/scripts/Commands/cs_server.cpp
+++ b/src/server/scripts/Commands/cs_server.cpp
@@ -426,19 +426,12 @@ public:
}
// Set the level of logging
- static bool HandleServerSetLogLevelCommand(ChatHandler* /*handler*/, char const* args)
+ static bool HandleServerSetLogLevelCommand(ChatHandler* /*handler*/, std::string const& type, std::string const& name, int32 level)
{
- if (!*args)
- return false;
-
- char* type = strtok((char*)args, " ");
- char* name = strtok(nullptr, " ");
- char* level = strtok(nullptr, " ");
-
- if (!type || !name || !level || *name == '\0' || *level == '\0' || (*type != 'a' && *type != 'l'))
+ if (name.empty() || level < 0 || (type != "a" && type != "l"))
return false;
- sLog->SetLogLevel(name, level, *type == 'l');
+ sLog->SetLogLevel(name, level, type == "l");
return true;
}