+void Log_info_client(client_t *client, const char *logstring, ...)
+{
+ va_list argp;
+ char buf[STRSIZE + 2];
+ int offset = 0;
+
+ va_start(argp, logstring);
+ offset = sprintf(buf, "INFO: ");
+ offset += vsnprintf(&buf[offset], STRSIZE - offset, logstring, argp);
+ va_end(argp);
+ 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));
+ strcat(buf, "\n");
+ if (termprint)
+ fprintf(stderr, "%s", buf);
+ else
+ syslog(LOG_INFO, buf);
+
+}