X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Flog.c;h=91ec5b023ed40e0de5d8e407553114fc0f9d78f7;hb=HEAD;hp=ebb5cd1c0ae1e4b4965da971df41a3484f538928;hpb=a0f585591388e8245bd14f4d37ef7b667f036672;p=umurmur.git diff --git a/src/log.c b/src/log.c index ebb5cd1..91ec5b0 100644 --- a/src/log.c +++ b/src/log.c @@ -39,6 +39,7 @@ #include "log.h" #include "conf.h" +#include "util.h" #define STRSIZE 254 @@ -190,11 +191,14 @@ void Log_info_client(client_t *client, const char *logstring, ...) offset += vsnprintf(&buf[offset], STRSIZE - offset, logstring, argp); va_end(argp); + char *clientAddressString = Util_clientAddressToString(client); offset += snprintf(&buf[offset], STRSIZE - offset, " - [%d] %s@%s:%d", - client->sessionId, - client->username == NULL ? "" : client->username, - inet_ntoa(client->remote_tcp.sin_addr), - ntohs(client->remote_tcp.sin_port)); + client->sessionId, + client->username == NULL ? "" : client->username, + clientAddressString, + Util_clientAddressToPortTCP(client)); + free(clientAddressString); + if (termprint) fprintf(stderr, "%s\n", buf); else if (logfile)