summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2020-12-04 15:55:28 +0000
committerSadie Powell <sadie@witchery.services>2020-12-04 15:56:59 +0000
commiteda0e5e2f0509a3eea823f64c4acea8ac970b9a4 (patch)
tree3436114da177c740471fc01d60726825a857b658 /src
parent414e65c75b95dd51e226ef9758e9260197c21da6 (diff)
Improve the logging of service adding/deleting.
Diffstat (limited to 'src')
-rw-r--r--src/modules.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/modules.cpp b/src/modules.cpp
index b6a29fcfa..a39fcb6c1 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -167,6 +167,26 @@ void ServiceProvider::DisableAutoRegister()
stdalgo::erase(*ServerInstance->Modules->NewServices, this);
}
+const char* ServiceProvider::GetTypeString() const
+{
+ switch (service)
+ {
+ case SERVICE_COMMAND:
+ return "command";
+ case SERVICE_MODE:
+ return "mode";
+ case SERVICE_METADATA:
+ return "metadata";
+ case SERVICE_IOHOOK:
+ return "iohook";
+ case SERVICE_DATA:
+ return "data service";
+ case SERVICE_CUSTOM:
+ return "module service";
+ }
+ return "unknown service";
+}
+
ModuleManager::ModuleManager()
{
}
@@ -565,6 +585,8 @@ void ModuleManager::AddServices(const ServiceList& list)
void ModuleManager::AddService(ServiceProvider& item)
{
+ ServerInstance->Logs->Log("SERVICE", LOG_DEBUG, "Adding %s %s provided by %s", item.name.c_str(),
+ item.GetTypeString(), item.creator ? item.creator->ModuleSourceFile.c_str() : "the core");
switch (item.service)
{
case SERVICE_DATA:
@@ -592,6 +614,8 @@ void ModuleManager::AddService(ServiceProvider& item)
void ModuleManager::DelService(ServiceProvider& item)
{
+ ServerInstance->Logs->Log("SERVICE", LOG_DEBUG, "Deleting %s %s provided by %s", item.name.c_str(),
+ item.GetTypeString(), item.creator ? item.creator->ModuleSourceFile.c_str() : "the core");
switch (item.service)
{
case SERVICE_MODE: