diff --git a/src/syncterm/syncterm.c b/src/syncterm/syncterm.c index e76c115c07a8c9a7cfc106ee6504b6070cb7c3c5..60a9826f71d3d15c4bad2fb0b1b951fa10902367 100644 --- a/src/syncterm/syncterm.c +++ b/src/syncterm/syncterm.c @@ -1223,6 +1223,7 @@ int main(int argc, char **argv) if(log_fp!=NULL) { time_t now=time(NULL); fprintf(log_fp,"%.15s Log closed\n", ctime(&now)+4); + fprintf(log_fp,"---------------\n"); fclose(log_fp); log_fp=NULL; } diff --git a/src/syncterm/telnet_io.c b/src/syncterm/telnet_io.c index 59b20732f32abf93f53815037832d080916505f7..89887b7f3e726727e7ade16253b2c2c62d21e4a1 100644 --- a/src/syncterm/telnet_io.c +++ b/src/syncterm/telnet_io.c @@ -24,6 +24,7 @@ char terminal[TELNET_TERM_MAXLEN+1]; uchar telnet_local_option[0x100]; uchar telnet_remote_option[0x100]; +extern char *log_levels[]; extern FILE* log_fp; int telnet_log_level; @@ -39,7 +40,7 @@ static int lprintf(int level, const char *fmt, ...) vsnprintf(sbuf,sizeof(sbuf),fmt,argptr); sbuf[sizeof(sbuf)-1]=0; va_end(argptr); - return(fprintf(log_fp, "%s\n", sbuf)); + return(fprintf(log_fp, "Telnet %s %s\n", log_levels[level], sbuf)); } void putcom(BYTE* buf, size_t len) @@ -60,12 +61,12 @@ static void send_telnet_cmd(uchar cmd, uchar opt) char buf[16]; if(cmd<TELNET_WILL) { - lprintf(LOG_INFO,"TX Telnet command: %s" + lprintf(LOG_INFO,"TX: %s" ,telnet_cmd_desc(cmd)); sprintf(buf,"%c%c",TELNET_IAC,cmd); putcom(buf,2); } else { - lprintf(LOG_INFO,"TX Telnet command: %s %s" + lprintf(LOG_INFO,"TX: %s %s" ,telnet_cmd_desc(cmd), telnet_opt_desc(opt)); sprintf(buf,"%c%c%c",TELNET_IAC,cmd,opt); putcom(buf,3); @@ -135,7 +136,7 @@ BYTE* telnet_interpret(BYTE* inbuf, int inlen, BYTE* outbuf, int *outlen) ,TELNET_IAC,TELNET_SB ,TELNET_TERM_TYPE,TELNET_TERM_IS ,TELNET_IAC,TELNET_SE); - lprintf(LOG_INFO,"TX Telnet command: Terminal Type is ANSI"); + lprintf(LOG_INFO,"TX: Terminal Type is ANSI"); putcom(buf,len); request_telnet_opt(TELNET_WILL, TELNET_NEGOTIATE_WINDOW_SIZE); } @@ -147,7 +148,7 @@ BYTE* telnet_interpret(BYTE* inbuf, int inlen, BYTE* outbuf, int *outlen) } else if(telnet_cmdlen>=3) { /* telnet option negotiation */ - lprintf(LOG_INFO,"RX Telnet command: %s %s" + lprintf(LOG_INFO,"RX: %s %s" ,telnet_cmd_desc(command),telnet_opt_desc(option)); if(command==TELNET_DO || command==TELNET_DONT) { /* local options */ @@ -179,7 +180,7 @@ BYTE* telnet_interpret(BYTE* inbuf, int inlen, BYTE* outbuf, int *outlen) buf[6]=term.height&0xff; buf[7]=TELNET_IAC; buf[8]=TELNET_SE; - lprintf(LOG_INFO,"TX Telnet command: Window Size is %u x %u" + lprintf(LOG_INFO,"TX: Window Size is %u x %u" ,term.width, term.height); putcom(buf,9); } diff --git a/src/syncterm/term.c b/src/syncterm/term.c index 581ec58f44d18c85a878c9f29af59177f2773993..363a612230419e95f289f723785f8771ee633a3b 100644 --- a/src/syncterm/term.c +++ b/src/syncterm/term.c @@ -254,7 +254,7 @@ static int lputs(void* cbdata, int level, const char* str) #endif if(log_fp!=NULL && level <= log_level) - fprintf(log_fp,"%s: %s\n",log_levels[level], str); + fprintf(log_fp,"Xfer %s: %s\n",log_levels[level], str); if(level > LOG_INFO) return 0;