#include "inspircd.h"
#include "exitcodes.h"
+#include <iostream>
#ifdef PURE_STATIC
Modules[name] = mod;
if (defer)
{
- ServerInstance->Logs->Log("MODULE", DEFAULT,"New module introduced: %s", name.c_str());
+ ServerInstance->Logs->Log("MODULE", LOG_DEFAULT,"New module introduced: %s", name.c_str());
return true;
}
else
{
if (mod)
DoSafeUnload(mod);
- ServerInstance->Logs->Log("MODULE", DEFAULT, "Unable to load " + name + ": " + modexcept.GetReason());
+ ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, "Unable to load " + name + ": " + modexcept.GetReason());
return false;
}
FOREACH_MOD(I_OnLoadModule,OnLoadModule(mod));
if (prioritizationState == PRIO_STATE_LAST)
break;
if (tries == 19)
- ServerInstance->Logs->Log("MODULE", DEFAULT, "Hook priority dependency loop detected while loading " + name);
+ ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, "Hook priority dependency loop detected while loading " + name);
}
- ServerInstance->BuildISupport();
+ ServerInstance->ISupport.Build();
return true;
}
{
ConfigTag* tag = i->second;
std::string name = tag->getString("name");
- printf_c("[\033[1;32m*\033[0m] Loading module:\t\033[1;32m%s\033[0m\n",name.c_str());
+ std::cout << "[" << con_green << "*" << con_reset << "] Loading module:\t" << con_green << name << con_reset << std::endl;
if (!this->Load(name, true))
{
- ServerInstance->Logs->Log("MODULE", DEFAULT, this->LastError());
- printf_c("\n[\033[1;31m*\033[0m] %s\n\n", this->LastError().c_str());
+ ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, this->LastError());
+ std::cout << std::endl << "[" << con_red << "*" << con_reset << "] " << this->LastError() << std::endl << std::endl;
ServerInstance->Exit(EXIT_STATUS_MODULE);
}
}
for(std::map<std::string, Module*>::iterator i = Modules.begin(); i != Modules.end(); i++)
{
Module* mod = i->second;
- try
+ try
{
mod->init();
}
catch (CoreException& modexcept)
{
LastModuleError = "Unable to initialize " + mod->ModuleSourceFile + ": " + modexcept.GetReason();
- ServerInstance->Logs->Log("MODULE", DEFAULT, LastModuleError);
- printf_c("\n[\033[1;31m*\033[0m] %s\n\n", LastModuleError.c_str());
+ ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, LastModuleError);
+ std::cout << std::endl << "[" << con_red << "*" << con_reset << "] " << LastModuleError << std::endl << std::endl;
ServerInstance->Exit(EXIT_STATUS_MODULE);
}
}
break;
if (tries == 19)
{
- ServerInstance->Logs->Log("MODULE", DEFAULT, "Hook priority dependency loop detected");
+ ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, "Hook priority dependency loop detected");
ServerInstance->Exit(EXIT_STATUS_MODULE);
}
}