-/* EventLogger.c - NeonServ v5.3
- * Copyright (C) 2011 Philipp Kreil (pk910)
+/* EventLogger.c - NeonServ v5.6
+ * Copyright (C) 2011-2012 Philipp Kreil (pk910)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "UserNode.h"
#include "ChanNode.h"
#include "DBHelper.h"
+#include "log.h"
static struct Event *first_event = NULL, *last_event = NULL;
struct Event *event = malloc(sizeof(*event));
if (!event)
{
- perror("malloc() failed");
+ printf_log("main", LOG_ERROR, "%s:%d malloc() failed", __FILE__, __LINE__);
return NULL;
}
event->client = client;
if((event->chan->flags & CHANFLAG_CHAN_REGISTERED))
printf_mysql_query("INSERT INTO `godlog` (`godlog_cid`, `godlog_uid`, `godlog_time`, `godlog_cmd`) VALUES ('%d', '%d', UNIX_TIMESTAMP(), '%s')", event->chan->channel_id, userid, escape_string(fullcmd));
}
+ printf_log("main", LOG_OVERRIDE, "[%s:%s (%s)] %s", (event->chan ? event->chan->name : "*"), event->user->nick, auth, fullcmd);
}
}