]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/command_parse.cpp
Make error messages on failure to load command more useful
[user/henk/code/inspircd.git] / src / command_parse.cpp
index e0085f9d7b3f1d91d22bf4da9abd6908bf07590a..e751db6d338e55dcdd74950b9a1827ca8d5a2112 100644 (file)
@@ -425,7 +425,7 @@ void CommandParser::ProcessBuffer(std::string &buffer,userrec *user)
        {
                if (!user->muted)
                {
-                       ServerInstance->Log(DEBUG,"C[%d] -> :%s %s",user->GetFd(), user->nick, buffer.c_str());
+                       ServerInstance->Log(DEBUG,"C[%d] I :%s %s",user->GetFd(), user->nick, buffer.c_str());
                        this->ProcessCommand(user,buffer);
                }
        }
@@ -458,13 +458,13 @@ CommandParser::CommandParser(InspIRCd* Instance) : ServerInstance(Instance)
        para.resize(128);
 }
 
-bool CommandParser::FindSym(void** v, void* h)
+bool CommandParser::FindSym(void** v, void* h, const std::string &name)
 {
        *v = dlsym(h, "init_command");
        const char* err = dlerror();
        if (err && !(*v))
        {
-               ServerInstance->Log(SPARSE, "Error loading core command: %s\n", err);
+               ServerInstance->Log(SPARSE, "Error loading core command %s: %s\n", name, err);
                return false;
        }
        return true;
@@ -546,11 +546,11 @@ const char* CommandParser::LoadCommand(const char* name)
        if (!h)
        {
                const char* n = dlerror();
-               ServerInstance->Log(SPARSE, "Error loading core command: %s", n);
+               ServerInstance->Log(SPARSE, "Error loading core command %s: %s", name, n);
                return n;
        }
 
-       if (this->FindSym((void **)&cmd_factory_func, h))
+       if (this->FindSym((void **)&cmd_factory_func, h, name))
        {
                command_t* newcommand = cmd_factory_func(ServerInstance);
                this->CreateCommand(newcommand, h);