a few more tidy ups for debug messages

This commit is contained in:
Mark 2004-01-14 22:50:24 +00:00
parent 7feccba8d3
commit d1e50721a1
8 changed files with 38 additions and 44 deletions

View file

@ -395,7 +395,6 @@ static void
Usr_Mode (char *origin, char **argv, int argc)
{
if (!strchr (argv[0], '#')) {
nlog (LOG_DEBUG1, LOG_CORE, "Mode: UserMode: %s", argv[0]);
UserMode (argv[0], argv[1]);
} else {
ChanMode (origin, argv, argc);
@ -512,7 +511,6 @@ Srv_Nick (char *origin, char **argv, int argc)
realname = joinbuf (argv, argc, 9);
AddUser (argv[0], argv[4], argv[5], realname, argv[6], strtoul (argv[8], NULL, 10), strtoul (argv[2], NULL, 10));
free (realname);
nlog (LOG_DEBUG1, LOG_CORE, "Mode: UserMode: %s", argv[3]);
UserMode (argv[0], argv[3]);
}

View file

@ -633,9 +633,7 @@ Srv_Client (char *origin, char **argv, int argc)
realname = joinbuf (argv, argc, 11);
AddUser (argv[0], argv[5], argv[6], realname, argv[8], strtoul (argv[10], NULL, 10), strtoul (argv[2], NULL, 10));
free (realname);
nlog (LOG_DEBUG1, LOG_CORE, "Mode: UserMode: %s", argv[3]);
UserMode (argv[0], argv[3]);
nlog (LOG_DEBUG1, LOG_CORE, "Smode: SMode: %s", argv[4]);
UserSMode (argv[0], argv[4]);
}

View file

@ -759,9 +759,7 @@ Srv_Client (char *origin, char **argv, int argc)
AddUser (argv[0], argv[5], argv[6], realname, argv[8], strtoul (argv[10], NULL, 10), strtoul (argv[2], NULL, 10));
SetUserVhost(argv[0], argv[7]);
free (realname);
nlog (LOG_DEBUG1, LOG_CORE, "Mode: UserMode: %s", argv[3]);
UserMode (argv[0], argv[3]);
nlog (LOG_DEBUG1, LOG_CORE, "Smode: SMode: %s", argv[4]);
UserSMode (argv[0], argv[4]);
}

View file

@ -121,7 +121,7 @@ CheckChanMode (Chans * c, long mode)
ModesParm *m;
lnode_t *mn;
if (!c) {
nlog (LOG_WARNING, LOG_CORE, "Warning, CheckChanMode Called with empty channel");
nlog (LOG_WARNING, LOG_CORE, "CheckChanMode: tied to check modes of empty channel");
return -1;
}
if (c->modes & mode) {
@ -235,7 +235,7 @@ ChanMode (char *origin, char **av, int ac)
modeexists = 1;
break;
} else if (((int *) m->mode == (int *) chan_modes[i].mode) && !strcasecmp (m->param, av[j])) {
nlog (LOG_INFO, LOG_CORE, "Mode %c (%s) already exists, not adding again", chan_modes[i].flag, av[j]);
nlog (LOG_INFO, LOG_CORE, "ChanMode: Mode %c (%s) already exists, not adding again", chan_modes[i].flag, av[j]);
j++;
modeexists = 1;
break;
@ -248,7 +248,7 @@ ChanMode (char *origin, char **av, int ac)
strlcpy (m->param, av[j], PARAMSIZE);
mn = lnode_create (m);
if (list_isfull (c->modeparms)) {
nlog (LOG_CRITICAL, LOG_CORE, "Eeek, Can't add additional Modes to Channel %s. Modelist is full", c->name);
nlog (LOG_CRITICAL, LOG_CORE, "ChanMode: modelist is full adding to channel %s", c->name);
do_exit (NS_EXIT_ERROR, "List full - see log file");
} else {
list_append (c->modeparms, mn);
@ -490,7 +490,7 @@ kick_chan (const char *chan, const char *kicked, const char *kickby, char *kickr
} else {
lnode_destroy (list_delete (u->chans, un));
}
nlog (LOG_DEBUG3, LOG_CORE, "Cur Users %s %ld (list %d)", c->name, c->cur_users, (int)list_count (c->chanmembers));
nlog (LOG_DEBUG3, LOG_CORE, "kick_chan: cur users %s %ld (list %d)", c->name, c->cur_users, (int)list_count (c->chanmembers));
if (c->cur_users <= 0) {
AddStringToList (&av, c->name, &ac);
ModuleEvent (EVENT_DELCHAN, av, ac);

View file

@ -134,12 +134,12 @@ add_bot_cmd(hash_t* cmd_hash, bot_cmd* cmd_ptr)
* For now we verify help during processing since it is not critical. */
/* No command, we cannot recover from this */
if(!cmd_ptr->cmd) {
nlog (LOG_ERROR, LOG_MOD, "Missing command, command (unknown) not added");
nlog (LOG_ERROR, LOG_MOD, "add_bot_cmd: missing command, command (unknown) not added");
return NS_FAILURE;
}
/* No handler, we cannot recover from this */
if(!cmd_ptr->handler) {
nlog (LOG_ERROR, LOG_MOD, "Missing command handler, command %s not added",
nlog (LOG_ERROR, LOG_MOD, "add_bot_cmd: missing command handler, command %s not added",
cmd_ptr->cmd);
return NS_FAILURE;
}
@ -147,7 +147,7 @@ add_bot_cmd(hash_t* cmd_hash, bot_cmd* cmd_ptr)
cmdnode = hnode_create(cmd_ptr);
if (cmdnode) {
hash_insert(cmd_hash, cmdnode, cmd_ptr->cmd);
nlog(LOG_DEBUG2, LOG_MOD, "Added a new command %s to Services Bot", cmd_ptr->cmd);
nlog(LOG_DEBUG2, LOG_MOD, "add_bot_cmd: added a new command %s to services bot", cmd_ptr->cmd);
return NS_SUCCESS;
}
return NS_FAILURE;
@ -307,7 +307,7 @@ servicesbot (char *nick, char **av, int ac)
SET_SEGV_LOCATION();
u = finduser (nick);
if (!u) {
nlog (LOG_WARNING, LOG_CORE, "Unable to finduser %s (%s)", nick, s_Services);
nlog (LOG_WARNING, LOG_CORE, "servicesbot: unable to find user %s (%s)", nick, s_Services);
return;
}
me.requests++;

4
conf.c
View file

@ -202,12 +202,12 @@ ConfLoadModules ()
SET_SEGV_LOCATION();
if(load_mods[1] == 0) {
nlog (LOG_NORMAL, LOG_CORE, "No modules configured for loading");
nlog (LOG_NORMAL, LOG_CORE, "No modules configured for loading");
return NS_SUCCESS;
}
nlog (LOG_NORMAL, LOG_CORE, "Loading configured modules");
for (i = 1; (i < NUM_MODULES) && (load_mods[i] != 0); i++) {
nlog (LOG_DEBUG1, LOG_CORE, "Loading Module %s", (char *)load_mods[i]);
nlog (LOG_DEBUG1, LOG_CORE, "ConfLoadModules: Loading Module %s", (char *)load_mods[i]);
rval = load_module (load_mods[i], NULL);
if (rval == NS_SUCCESS) {
nlog (LOG_NORMAL, LOG_CORE, "Successfully Loaded Module %s", (char *)load_mods[i]);

44
dl.c
View file

@ -254,12 +254,12 @@ new_timer (char *timer_name)
hnode_t *tn;
SET_SEGV_LOCATION();
nlog (LOG_DEBUG2, LOG_CORE, "New Timer: %s", timer_name);
nlog (LOG_DEBUG2, LOG_CORE, "new_timer: %s", timer_name);
mod_tmr = malloc (sizeof (ModTimer));
strlcpy (mod_tmr->timername, timer_name, MAX_MOD_NAME);
tn = hnode_create (mod_tmr);
if (hash_isfull (th)) {
nlog (LOG_WARNING, LOG_CORE, "new_timer(): Couldn't add new Timer, Hash is Full!");
nlog (LOG_WARNING, LOG_CORE, "new_timer: couldn't add new timer, hash is full!");
return NULL;
}
hash_insert (th, tn, timer_name);
@ -312,7 +312,7 @@ add_mod_timer (char *func_name, char *timer_name, char *mod_name, int interval)
mod_tmr->lastrun = me.now;
strlcpy (mod_tmr->modname, mod_name, MAX_MOD_NAME);
mod_tmr->function = dlsym ((int *) get_dl_handle (mod_name), func_name);
nlog (LOG_DEBUG2, LOG_CORE, "Registered Module %s with timer for Function %s", mod_name, func_name);
nlog (LOG_DEBUG2, LOG_CORE, "add_mod_timer: Registered Module %s with timer for Function %s", mod_name, func_name);
return NS_SUCCESS;
}
return NS_FAILURE;
@ -336,7 +336,7 @@ del_mod_timer (char *timer_name)
tn = hash_lookup (th, timer_name);
if (tn) {
mod_tmr = hnode_get (tn);
nlog (LOG_DEBUG2, LOG_CORE, "Unregistered Timer function %s from Module %s", timer_name, mod_tmr->modname);
nlog (LOG_DEBUG2, LOG_CORE, "del_mod_timer: Unregistered Timer function %s from Module %s", timer_name, mod_tmr->modname);
hash_delete (th, tn);
hnode_destroy (tn);
free (mod_tmr);
@ -364,7 +364,7 @@ del_mod_timers (char *module_name)
while ((modnode = hash_scan_next (&hscan)) != NULL) {
mod_tmr = hnode_get (modnode);
if (!strcasecmp (mod_tmr->modname, module_name)) {
nlog (LOG_DEBUG1, LOG_CORE, "Module %s has timer %s Registered. Deleting..", module_name, mod_tmr->timername);
nlog (LOG_DEBUG1, LOG_CORE, "del_mod_timers: Module %s has timer %s Registered. Deleting..", module_name, mod_tmr->timername);
del_mod_timer (mod_tmr->timername);
}
}
@ -390,7 +390,7 @@ change_mod_timer_interval (char *timer_name, int interval)
if (tn) {
mod_tmr = hnode_get (tn);
mod_tmr->interval = interval;
nlog (LOG_DEBUG2, LOG_CORE, "Changing timer interval for %s from Module %s", timer_name, mod_tmr->modname);
nlog (LOG_DEBUG2, LOG_CORE, "change_mod_timer_interval: Changing timer interval for %s from Module %s", timer_name, mod_tmr->modname);
return NS_SUCCESS;
}
return NS_FAILURE;
@ -450,7 +450,7 @@ run_mod_timers (void)
SET_SEGV_INMODULE(mod_tmr->modname);
if (setjmp (sigvbuf) == 0) {
if (mod_tmr->function () < 0) {
nlog(LOG_DEBUG2, LOG_CORE, "Deleting Timer %s for Module %s as requested", mod_tmr->timername, mod_tmr->modname);
nlog(LOG_DEBUG2, LOG_CORE, "run_mod_timers: Deleting Timer %s for Module %s as requested", mod_tmr->timername, mod_tmr->modname);
hash_scan_delete(th, tn);
hnode_destroy(tn);
free(mod_tmr);
@ -458,7 +458,7 @@ run_mod_timers (void)
mod_tmr->lastrun = (int) me.now;
}
} else {
nlog (LOG_CRITICAL, LOG_CORE, "setjmp() Failed, Can't call Module %s\n", mod_tmr->modname);
nlog (LOG_CRITICAL, LOG_CORE, "run_mod_timers: setjmp() failed, can't call module %s\n", mod_tmr->modname);
}
CLEAR_SEGV_INMODULE();
}
@ -480,12 +480,12 @@ new_sock (char *sock_name)
hnode_t *sn;
SET_SEGV_LOCATION();
nlog (LOG_DEBUG2, LOG_CORE, "New Socket: %s", sock_name);
nlog (LOG_DEBUG2, LOG_CORE, "new_sock: %s", sock_name);
mod_sock = smalloc (sizeof (ModSock));
strlcpy (mod_sock->sockname, sock_name, MAX_MOD_NAME);
sn = hnode_create (mod_sock);
if (hash_isfull (sockh)) {
nlog (LOG_CRITICAL, LOG_CORE, "Eeek, SocketHash is full, can not add a new socket");
nlog (LOG_CRITICAL, LOG_CORE, "new_sock: socket hash is full, can't add a new socket");
return NULL;
}
hash_insert (sockh, sn, mod_sock->sockname);
@ -532,19 +532,19 @@ add_socket (char *readfunc, char *writefunc, char *errfunc, char *sock_name, int
SET_SEGV_LOCATION();
if (readfunc) {
if (dlsym ((int *) get_dl_handle (mod_name), readfunc) == NULL) {
nlog (LOG_WARNING, LOG_CORE, "oh oh, the Read socket function doesn't exist = %s (%s)", readfunc, mod_name);
nlog (LOG_WARNING, LOG_CORE, "add_socket: read socket function doesn't exist = %s (%s)", readfunc, mod_name);
return NS_FAILURE;
}
}
if (writefunc) {
if (dlsym ((int *) get_dl_handle (mod_name), writefunc) == NULL) {
nlog (LOG_WARNING, LOG_CORE, "oh oh, the Write socket function doesn't exist = %s (%s)", writefunc, mod_name);
nlog (LOG_WARNING, LOG_CORE, "add_socket: write socket function doesn't exist = %s (%s)", writefunc, mod_name);
return NS_FAILURE;
}
}
if (errfunc) {
if (dlsym ((int *) get_dl_handle (mod_name), errfunc) == NULL) {
nlog (LOG_WARNING, LOG_CORE, "oh oh, the Error socket function doesn't exist = %s (%s)", errfunc, mod_name);
nlog (LOG_WARNING, LOG_CORE, "add_socket: error socket function doesn't exist = %s (%s)", errfunc, mod_name);
return NS_FAILURE;
}
}
@ -556,7 +556,7 @@ add_socket (char *readfunc, char *writefunc, char *errfunc, char *sock_name, int
mod_sock->errfnc = dlsym ((int *) get_dl_handle (mod_name), errfunc);
mod_sock->socktype = SOCK_STANDARD;
nlog (LOG_DEBUG2, LOG_CORE, "Registered Module %s with Standard Socket functions %s", mod_name, mod_sock->sockname);
nlog (LOG_DEBUG2, LOG_CORE, "add_socket: Registered Module %s with Standard Socket functions %s", mod_name, mod_sock->sockname);
return NS_SUCCESS;
}
@ -579,13 +579,13 @@ add_sockpoll (char *beforepoll, char *afterpoll, char *sock_name, char *mod_name
SET_SEGV_LOCATION();
if (beforepoll) {
if (dlsym ((int *) get_dl_handle (mod_name), beforepoll) == NULL) {
nlog (LOG_WARNING, LOG_CORE, "oh oh, the Read socket function doesn't exist = %s (%s)", beforepoll, mod_name);
nlog (LOG_WARNING, LOG_CORE, "add_sockpoll: read socket function doesn't exist = %s (%s)", beforepoll, mod_name);
return NS_FAILURE;
}
}
if (afterpoll) {
if (dlsym ((int *) get_dl_handle (mod_name), afterpoll) == NULL) {
nlog (LOG_WARNING, LOG_CORE, "oh oh, the Write socket function doesn't exist = %s (%s)", afterpoll, mod_name);
nlog (LOG_WARNING, LOG_CORE, "add_sockpoll: write socket function doesn't exist = %s (%s)", afterpoll, mod_name);
return NS_FAILURE;
}
}
@ -595,7 +595,7 @@ add_sockpoll (char *beforepoll, char *afterpoll, char *sock_name, char *mod_name
mod_sock->beforepoll = dlsym ((int *) get_dl_handle (mod_name), beforepoll);
mod_sock->afterpoll = dlsym ((int *) get_dl_handle (mod_name), afterpoll);
mod_sock->data = data;
nlog (LOG_DEBUG2, LOG_CORE, "Registered Module %s with Poll Socket functions %s", mod_name, mod_sock->sockname);
nlog (LOG_DEBUG2, LOG_CORE, "add_sockpoll: Registered Module %s with Poll Socket functions %s", mod_name, mod_sock->sockname);
return NS_SUCCESS;
}
@ -617,7 +617,7 @@ del_socket (char *sock_name)
sn = hash_lookup (sockh, sock_name);
if (sn) {
mod_sock = hnode_get (sn);
nlog (LOG_DEBUG2, LOG_CORE, "Unregistered Socket function %s from Module %s", sock_name, mod_sock->modname);
nlog (LOG_DEBUG2, LOG_CORE, "del_socket: Unregistered Socket function %s from Module %s", sock_name, mod_sock->modname);
hash_scan_delete (sockh, sn);
hnode_destroy (sn);
free (mod_sock);
@ -645,7 +645,7 @@ del_sockets (char *module_name)
while ((modnode = hash_scan_next (&hscan)) != NULL) {
mod_sock = hnode_get (modnode);
if (!strcasecmp (mod_sock->modname, module_name)) {
nlog (LOG_DEBUG1, LOG_CORE, "Module %s had Socket %s Registered. Deleting..", module_name, mod_sock->sockname);
nlog (LOG_DEBUG1, LOG_CORE, "del_sockets: Module %s had Socket %s Registered. Deleting..", module_name, mod_sock->sockname);
del_socket (mod_sock->sockname);
}
}
@ -714,7 +714,7 @@ add_bot_to_chan (char *bot, char *chan)
mod_chan_bot = hnode_get (cbn);
}
if (list_isfull (mod_chan_bot->bots)) {
nlog (LOG_CRITICAL, LOG_CORE, "Eeek, Bot Channel List is full for Chan %s", chan);
nlog (LOG_CRITICAL, LOG_CORE, "add_bot_to_chan: bot channel list is full adding channel %s", chan);
return;
}
botname = sstrdup (bot);
@ -837,7 +837,7 @@ new_bot (char *bot_name)
hnode_t *bn;
SET_SEGV_LOCATION();
nlog (LOG_DEBUG2, LOG_CORE, "New Bot: %s", bot_name);
nlog (LOG_DEBUG2, LOG_CORE, "new_bot: %s", bot_name);
mod_usr = malloc (sizeof (ModUser));
strlcpy (mod_usr->nick, bot_name, MAXNICK);
bn = hnode_create (mod_usr);
@ -878,7 +878,7 @@ add_mod_user (char *nick, char *mod_name)
}
}
}
nlog (LOG_WARNING, LOG_CORE, "add_mod_user(): Couldn't Add ModuleBot to List");
nlog (LOG_WARNING, LOG_CORE, "add_mod_user: Couldn't Add ModuleBot to List");
return NULL;
}

12
users.c
View file

@ -620,10 +620,10 @@ UserMode (const char *nick, const char *modes)
int ac = 0;
SET_SEGV_LOCATION();
nlog (LOG_DEBUG1, LOG_CORE, "UserMode: user %s modes %s", nick, modes);
u = finduser (nick);
if (!u) {
nlog (LOG_WARNING, LOG_CORE, "UserMode: modes change for unknown user %s", nick);
nlog (LOG_DEBUG1, LOG_CORE, "Recbuf: %s", recbuf);
nlog (LOG_WARNING, LOG_CORE, "UserMode: mode change for unknown user %s %s", nick, modes);
return;
}
nlog (LOG_DEBUG1, LOG_CORE, "Modes: %s", modes);
@ -633,7 +633,7 @@ UserMode (const char *nick, const char *modes)
ModuleEvent (EVENT_UMODE, av, ac);
free (av);
u->Umode = UmodeStringToMask(modes, u->Umode);
nlog (LOG_DEBUG1, LOG_CORE, "UserMode: Modes for %s are now %p", u->nick, (int *)u->Umode);
nlog (LOG_DEBUG1, LOG_CORE, "UserMode: modes for %s is now %p", u->nick, (int *)u->Umode);
}
#ifdef GOTUSERSMODES
@ -645,10 +645,10 @@ UserSMode (const char *nick, const char *modes)
int ac = 0;
SET_SEGV_LOCATION();
nlog (LOG_DEBUG1, LOG_CORE, "UserSMode: user %s modes %s", nick, modes);
u = finduser (nick);
if (!u) {
nlog (LOG_WARNING, LOG_CORE, "UserSMode: modes change for unknown user %s", nick);
nlog (LOG_DEBUG1, LOG_CORE, "Recbuf: %s", recbuf);
nlog (LOG_WARNING, LOG_CORE, "UserSMode: smode change for unknown user %s %s", nick, modes);
return;
}
nlog (LOG_DEBUG1, LOG_CORE, "Smodes: %s", modes);
@ -657,6 +657,6 @@ UserSMode (const char *nick, const char *modes)
ModuleEvent (EVENT_SMODE, av, ac);
free (av);
u->Smode = SmodeStringToMask(modes, u->Smode);
nlog (LOG_DEBUG1, LOG_CORE, "UserSMode: SMODE for %s is are now %p", u->nick, (int *)u->Smode);
nlog (LOG_DEBUG1, LOG_CORE, "UserSMode: smode for %s is now %p", u->nick, (int *)u->Smode);
}
#endif