diff options
author | Attila Molnar <attilamolnar@hush.com> | 2012-10-14 12:40:52 -0700 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2012-10-14 12:40:52 -0700 |
commit | 336e30f61f9cb04620f5be46189753636f4f9d49 (patch) | |
tree | 944335aad069ebf520772a6a46268bce1879c23b /src/modmanager_dynamic.cpp | |
parent | 81e644a40b7eead5402fe38ccb7f076b54344911 (diff) | |
parent | ebdaf368e137fc933e648ee88a08a4f83e796f87 (diff) |
Merge pull request #338 from ChrisTX/insp20+iostream
Replace printf(_c) with iostream
Diffstat (limited to 'src/modmanager_dynamic.cpp')
-rw-r--r-- | src/modmanager_dynamic.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/modmanager_dynamic.cpp b/src/modmanager_dynamic.cpp index 0e90a9ae5..27da56c69 100644 --- a/src/modmanager_dynamic.cpp +++ b/src/modmanager_dynamic.cpp @@ -24,6 +24,7 @@ #include "command_parse.h" #include "dns.h" #include "exitcodes.h" +#include <iostream> #ifndef _WIN32 #include <dirent.h> @@ -183,7 +184,7 @@ void ModuleManager::LoadAll() { ModCount = 0; - printf("\nLoading core commands"); + std::cout << std::endl << "Loading core commands"; fflush(stdout); DIR* library = opendir(ServerInstance->Config->ModPath.c_str()); @@ -194,19 +195,19 @@ void ModuleManager::LoadAll() { if (InspIRCd::Match(entry->d_name, "cmd_*.so", ascii_case_insensitive_map)) { - printf("."); + std::cout << "."; fflush(stdout); if (!Load(entry->d_name, true)) { ServerInstance->Logs->Log("MODULE", DEFAULT, this->LastError()); - printf_c("\n[\033[1;31m*\033[0m] %s\n\n", this->LastError().c_str()); + std::cout << std::endl << "[" << con_red << "*" << con_reset << "]" << this->LastError() << std::endl << std::endl; ServerInstance->Exit(EXIT_STATUS_MODULE); } } } closedir(library); - printf("\n"); + std::cout << std::endl; } ConfigTagList tags = ServerInstance->Config->ConfTags("module"); @@ -214,12 +215,12 @@ void ModuleManager::LoadAll() { 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()); + std::cout << std::endl << "[" << con_red << "*" << con_reset << "]" << this->LastError() << std::endl << std::endl; ServerInstance->Exit(EXIT_STATUS_MODULE); } } @@ -236,7 +237,7 @@ void ModuleManager::LoadAll() { 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()); + std::cout << std::endl << "[" << con_red << "*" << con_reset << "]" << LastModuleError << std::endl << std::endl; ServerInstance->Exit(EXIT_STATUS_MODULE); } } |