X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=blobdiff_plain;f=src%2FEventLogger.c;h=e131478b54bc8d8379e2dcb54ae947c224a455ec;hp=691f314479b6548e957824b4edf07db823f2ae5b;hb=HEAD;hpb=4d078d69cd2308cc835d7d8f1117e9b18ec37b61 diff --git a/src/EventLogger.c b/src/EventLogger.c index 691f314..e131478 100644 --- a/src/EventLogger.c +++ b/src/EventLogger.c @@ -1,4 +1,4 @@ -/* EventLogger.c - NeonServ v5.5 +/* EventLogger.c - NeonServ v5.6 * Copyright (C) 2011-2012 Philipp Kreil (pk910) * * This program is free software: you can redistribute it and/or modify @@ -21,6 +21,7 @@ #include "UserNode.h" #include "ChanNode.h" #include "DBHelper.h" +#include "log.h" static struct Event *first_event = NULL, *last_event = NULL; @@ -28,7 +29,7 @@ struct Event *createEvent(struct ClientSocket *client, struct UserNode *user, st 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; @@ -80,6 +81,7 @@ void logEvent(struct Event *event) { 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); } }