Commit 9ef382e5 authored by rswindell's avatar rswindell
Browse files

Changed all lprintf/eprintf/lputs implementations/calls to use a log_level arg.

parent fa309118
......@@ -152,7 +152,7 @@ bool sbbs_t::ansi_getxy(int* x, int* y)
ungetkey(ch);
}
if(time(NULL)-start>TIMEOUT_ANSI_GETXY) {
lprintf("Node %d !TIMEOUT in ansi_getxy", cfg.node_num);
lprintf(LOG_NOTICE,"Node %d !TIMEOUT in ansi_getxy", cfg.node_num);
return(false);
}
}
......
......@@ -98,7 +98,7 @@ bool sbbs_t::answer()
}
terminal[i]=0;
truncstr(terminal,"/");
lprintf("Node %d RLogin: '%s' / '%s / %s'",cfg.node_num,str,str2,terminal);
lprintf(LOG_DEBUG,"Node %d RLogin: '%s' / '%s / %s'",cfg.node_num,str,str2,terminal);
SAFECOPY(rlogin_name
,startup->options&BBS_OPT_USE_2ND_RLOGIN ? str2 : str);
useron.number=userdatdupe(0, U_ALIAS, LEN_ALIAS, rlogin_name, 0);
......@@ -171,7 +171,7 @@ bool sbbs_t::answer()
SAFECOPY(terminal,"ANSI");
autoterm|=(ANSI|COLOR);
rows=atoi(str+2);
lprintf("Node %d ANSI cursor position report: %u rows"
lprintf(LOG_DEBUG,"Node %d ANSI cursor position report: %u rows"
,cfg.node_num, rows);
if(rows<10 || rows>99) rows=24;
}
......@@ -200,7 +200,7 @@ bool sbbs_t::answer()
rioctl(IOFI); /* flush left-over or late response chars */
if(!autoterm && str[0]) {
lputs("Terminal Auto-detect failed, Response: ");
lputs(LOG_DEBUG,"Terminal Auto-detect failed, Response: ");
str2[0]=0;
for(i=0;str[i];i++) {
if(str[i]>=' ' && str[i]<='~')
......@@ -209,7 +209,7 @@ bool sbbs_t::answer()
sprintf(tmp,"<%02X>", (uchar)str[i]);
strcat(str2,tmp);
}
lputs(str2);
lputs(LOG_DEBUG,str2);
}
/* AutoLogon via IP or Caller ID here */
......
......@@ -77,7 +77,7 @@ int sbbs_t::bputs(char *str)
ulong l=0;
if(online==ON_LOCAL && console&CON_L_ECHO) /* script running as event */
return(eprintf("%s",str));
return(eprintf(LOG_INFO,"%s",str));
while(str[l]) {
if(str[l]==CTRL_A /* ctrl-a */
......@@ -120,7 +120,7 @@ int sbbs_t::rputs(char *str)
ulong l=0;
if(online==ON_LOCAL && console&CON_L_ECHO) /* script running as event */
return(eprintf("%s",str));
return(eprintf(LOG_INFO,"%s",str));
while(str[l])
outchar(str[l++]);
......@@ -229,7 +229,7 @@ void sbbs_t::outchar(char ch)
}
if(i==1440) { /* timeout - beep flush outbuf */
i=rioctl(TXBC);
lprintf("timeout(outchar) %04X %04X\r\n",i,rioctl(IOFO));
lprintf(LOG_NOTICE,"timeout(outchar) %04X %04X\r\n",i,rioctl(IOFO));
outcom(BEL);
rioctl(IOCS|PAUSE);
}
......
......@@ -202,7 +202,7 @@ void sbbs_t::gettimeleft(void)
if(event_time && now+(time_t)timeleft>event_time) { /* less time, set flag */
timeleft=event_time-now;
if(!(sys_status&SS_EVENT)) {
lprintf("Node %d Time reduced (to %s) due to upcoming event (%s) on %s"
lprintf(LOG_NOTICE,"Node %d Time reduced (to %s) due to upcoming event (%s) on %s"
,cfg.node_num,sectostr(timeleft,tmp),event_code,timestr(&event_time));
sys_status|=SS_EVENT;
}
......
......@@ -1154,9 +1154,9 @@ int sbbs_t::exec(csi_t *csi)
break;
case CS_PRINT_LOCAL:
if(online==ON_LOCAL)
eprintf("%s",cmdstr((char*)csi->ip,path,csi->str,(char*)buf));
eprintf(LOG_INFO,"%s",cmdstr((char*)csi->ip,path,csi->str,(char*)buf));
else
lputs(cmdstr((char*)csi->ip,path,csi->str,(char*)buf));
lputs(LOG_INFO,cmdstr((char*)csi->ip,path,csi->str,(char*)buf));
break;
case CS_PRINT_REMOTE:
putcom(cmdstr((char*)csi->ip,path,csi->str,(char*)buf));
......
......@@ -86,9 +86,9 @@ int sbbs_t::exec_misc(csi_t* csi, char *path)
putmsg(cmdstr(tmp,path,csi->str,buf),P_SAVEATR|P_NOABORT);
else {
if(online==ON_LOCAL)
eprintf("%s",cmdstr(tmp,path,csi->str,buf));
eprintf(LOG_INFO,"%s",cmdstr(tmp,path,csi->str,buf));
else
lputs(cmdstr(tmp,path,csi->str,buf));
lputs(LOG_INFO,cmdstr(tmp,path,csi->str,buf));
}
return(0);
case SHOW_VARS:
......
......@@ -232,7 +232,7 @@ int sbbs_t::exec_net(csi_t* csi)
if(!rd) {
if(time(NULL)-start>TIMEOUT_SOCK_READLINE) {
lprintf("!socket_readline: timeout (%d) exceeded"
lprintf(LOG_WARNING,"!socket_readline: timeout (%d) exceeded"
,TIMEOUT_SOCK_READLINE);
return(0);
}
......@@ -489,7 +489,7 @@ bool sbbs_t::ftp_cmd(csi_t* csi, SOCKET sock, char* cmdsrc, char* rsp)
if(!data_avail) {
if(time(NULL)-start>TIMEOUT_FTP_RESPONSE) {
lprintf("!ftp_cmd: TIMEOUT_FTP_RESPONSE (%d) exceeded"
lprintf(LOG_WARNING,"!ftp_cmd: TIMEOUT_FTP_RESPONSE (%d) exceeded"
,TIMEOUT_FTP_RESPONSE);
return(FALSE);
}
......
......@@ -298,7 +298,7 @@ char sbbs_t::handle_ctrlkey(char ch, long mode)
if(i && !(useron.rows)) { /* auto-detect rows */
str[i]=0;
rows=atoi(str);
lprintf("Node %d ANSI cursor position report: %u rows"
lprintf(LOG_DEBUG,"Node %d ANSI cursor position report: %u rows"
,cfg.node_num, rows);
if(rows<10 || rows>99) rows=24;
}
......
......@@ -75,7 +75,7 @@ static void dbprintf(BOOL error, private_t* p, char* fmt, ...)
sbuf[sizeof(sbuf)-1]=0;
va_end(argptr);
lprintf("%04u File %s%s",p->fp ? fileno(p->fp) : 0,error ? "ERROR: ":"",sbuf);
lprintf(LOG_DEBUG,"%04u File %s%s",p->fp ? fileno(p->fp) : 0,error ? "ERROR: ":"",sbuf);
}
/* Converts fopen() style 'mode' string into open() style 'flags' integer */
......
......@@ -2015,7 +2015,7 @@ js_socket_select(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
if(select(maxsock+1,rd_set,wr_set,NULL,&tv)<0)
{
lprintf("Error in socket_select() %s (%d)",strerror(errno),errno);
lprintf(LOG_DEBUG,"Error in socket_select() %s (%d)",strerror(errno),errno);
}
for(i=0;i<limit;i++)
......
......@@ -67,7 +67,7 @@ static void dbprintf(BOOL error, private_t* p, char* fmt, ...)
sbuf[sizeof(sbuf)-1]=0;
va_end(argptr);
lprintf("%04d Socket %s%s",p->sock,error ? "ERROR: ":"",sbuf);
lprintf(LOG_DEBUG,"%04d Socket %s%s",p->sock,error ? "ERROR: ":"",sbuf);
}
/* Socket Destructor */
......
......@@ -42,7 +42,7 @@ static void prep_cfg(scfg_t* cfg);
static void free_attr_cfg(scfg_t* cfg);
char * readtext(long *line, FILE *stream);
int lprintf(char *fmt, ...);
/*int lprintf(char *fmt, ...);*/
/****************************************************************************/
/* Initializes system and node configuration information and data variables */
......@@ -322,7 +322,7 @@ BOOL md(char *inpath)
if(dir==NULL) {
/* lprintf("Creating directory: %s",path); */
if(MKDIR(path)) {
lprintf("!ERROR %d creating directory: %s",errno,path);
lprintf(LOG_WARNING,"!ERROR %d creating directory: %s",errno,path);
return(FALSE);
}
}
......@@ -350,7 +350,7 @@ char *readtext(long *line,FILE *stream)
p=strrchr(buf,'"');
if(!p) {
if(line) {
lprintf("No quotation marks in line %d of text.dat",*line);
lprintf(LOG_ERR,"No quotation marks in line %d of text.dat",*line);
return(NULL);
}
return(NULL);
......@@ -435,7 +435,7 @@ char *readtext(long *line,FILE *stream)
}
str[j]=0;
if((p=(char *)calloc(1,j+2))==NULL) { /* +1 for terminator, +1 for YNQX line */
lprintf("Error allocating %u bytes of memory from text.dat",j);
lprintf(LOG_CRIT,"Error allocating %u bytes of memory from text.dat",j);
return(NULL);
}
strcpy(p,str);
......
......@@ -152,7 +152,7 @@ bool sbbs_t::syslog(char* code, char *entry)
sprintf(fname,"%slogs/%2.2d%2.2d%2.2d.log",cfg.logs_dir,tm.tm_mon+1,tm.tm_mday
,TM_YEAR(tm.tm_year));
if((file=nopen(fname,O_WRONLY|O_APPEND|O_CREAT))==-1) {
lprintf("!ERRROR %d opening/creating %s",errno,fname);
lprintf(LOG_ERR,"!ERRROR %d opening/creating %s",errno,fname);
return(false);
}
......@@ -170,9 +170,9 @@ void sbbs_t::logline(char *code, char *str)
{
if(strchr(str,'\n')==NULL) { // Keep the console log pretty
if(online==ON_LOCAL)
eprintf("%s",str);
eprintf(LOG_INFO,"%s",str);
else
lprintf("Node %d %s", cfg.node_num, str);
lprintf(LOG_INFO,"Node %d %s", cfg.node_num, str);
}
if(logfile_fp==NULL || (online==ON_LOCAL && strcmp(code,"!!"))) return;
if(logcol!=1)
......@@ -297,9 +297,9 @@ void sbbs_t::errormsg(int line, const char *source, char action, const char *obj
#endif
,src, line, actstr, object, access);
if(online==ON_LOCAL)
eprintf("%s",str);
eprintf(LOG_ERR,"%s",str);
else {
lprintf("%s",str);
lprintf(LOG_ERR,"%s",str);
bprintf("\7\r\nERROR - action: %s",actstr); /* tell user about error */
bprintf("\7\r\n object: %s",object);
bprintf("\7\r\n access: %ld",access);
......
This diff is collapsed.
......@@ -480,10 +480,10 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
}
if(online==ON_LOCAL) /* event */
eprintf("%s scanned %lu sub-boards for new messages"
eprintf(LOG_INFO,"%s scanned %lu sub-boards for new messages"
,useron.alias,subs_scanned);
else
lprintf("Node %d %s scanned %lu sub-boards for new messages"
lprintf(LOG_INFO,"Node %d %s scanned %lu sub-boards for new messages"
,cfg.node_num,useron.alias,subs_scanned);
if((*msgcnt)+mailmsgs && time(NULL)-start) {
......@@ -499,9 +499,9 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
,(ulong)(time(NULL)-start)
,((*msgcnt)+mailmsgs)/(time(NULL)-start));
if(online==ON_LOCAL) /* event */
eprintf(str);
eprintf(LOG_INFO,"%s",str);
else
lprintf(str);
lprintf(LOG_INFO,"%s",str);
}
fclose(qwk); /* close MESSAGE.DAT */
......@@ -526,9 +526,9 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
sprintf(tmp2,"%s%s",cfg.temp_dir,dirent->d_name);
lncntr=0; /* Default pause */
if(online==ON_LOCAL)
eprintf("Including %s in packet",str);
eprintf(LOG_INFO,"Including %s in packet",str);
else
lprintf("Including %s in packet",str);
lprintf(LOG_INFO,"Including %s in packet",str);
bprintf(text[RetrievingFile],str);
if(!mv(str,tmp2,1))
netfiles++;
......
......@@ -62,10 +62,10 @@ bool sbbs_t::pack_rep(uint hubnum)
delfiles(cfg.temp_dir,ALLFILES);
sprintf(str,"%s%s.rep",cfg.data_dir,cfg.qhub[hubnum]->id);
if(fexist(str)) {
eprintf("Updating %s", str);
eprintf(LOG_INFO,"Updating %s", str);
external(cmdstr(cfg.qhub[hubnum]->unpack,str,ALLFILES,NULL),EX_OFFLINE);
} else
eprintf("Creating %s", str);
eprintf(LOG_INFO,"Creating %s", str);
/*************************************************/
/* Create SYSID.MSG, write header and leave open */
/*************************************************/
......@@ -99,7 +99,7 @@ bool sbbs_t::pack_rep(uint hubnum)
mail=loadmail(&smb,&mailmsgs,0,MAIL_YOUR,0);
packedmail=0;
if(mailmsgs) {
eprintf("Packing NetMail for %s", cfg.qhub[hubnum]->id);
eprintf(LOG_INFO,"Packing NetMail for %s", cfg.qhub[hubnum]->id);
for(l=0;(ulong)l<mailmsgs;l++) {
// bprintf("\b\b\b\b\b%-5lu",l+1);
......@@ -124,7 +124,7 @@ bool sbbs_t::pack_rep(uint hubnum)
smb_freemsgmem(&msg);
YIELD(); /* yield */
}
eprintf("Packed %d NetMail messages",packedmail);
eprintf(LOG_INFO,"Packed %d NetMail messages",packedmail);
}
smb_close(&smb); /* Close the e-mail */
if(mailmsgs)
......@@ -138,7 +138,7 @@ bool sbbs_t::pack_rep(uint hubnum)
if(subscan[j].ptr>last) {
subscan[j].ptr=last;
subscan[j].ptr=last; }
eprintf(remove_ctrl_a(text[NScanStatusFmt],tmp)
eprintf(LOG_INFO,remove_ctrl_a(text[NScanStatusFmt],tmp)
,cfg.grp[cfg.sub[j]->grp]->sname
,cfg.sub[j]->lname,0L,msgs);
continue; }
......@@ -152,7 +152,7 @@ bool sbbs_t::pack_rep(uint hubnum)
continue; }
post=loadposts(&posts,j,subscan[j].ptr,LP_BYSELF|LP_OTHERS|LP_PRIVATE|LP_REP);
eprintf(remove_ctrl_a(text[NScanStatusFmt],tmp)
eprintf(LOG_INFO,remove_ctrl_a(text[NScanStatusFmt],tmp)
,cfg.grp[cfg.sub[j]->grp]->sname
,cfg.sub[j]->lname,posts,msgs);
if(!posts) { /* no new messages */
......@@ -160,7 +160,7 @@ bool sbbs_t::pack_rep(uint hubnum)
continue; }
subscan[j].ptr=last; /* set pointer */
eprintf("%s",remove_ctrl_a(text[QWKPackingSubboard],tmp)); /* ptr to last msg */
eprintf(LOG_INFO,"%s",remove_ctrl_a(text[QWKPackingSubboard],tmp)); /* ptr to last msg */
submsgs=0;
for(l=0;l<posts;l++) {
// bprintf("\b\b\b\b\b%-5lu",l+1);
......@@ -196,7 +196,7 @@ bool sbbs_t::pack_rep(uint hubnum)
if(!(l%50))
YIELD(); /* yield */
}
eprintf(remove_ctrl_a(text[QWKPackedSubboard],tmp),submsgs,msgcnt);
eprintf(LOG_INFO,remove_ctrl_a(text[QWKPackedSubboard],tmp),submsgs,msgcnt);
LFREE(post);
smb_close(&smb);
YIELD(); /* yield */
......@@ -214,7 +214,7 @@ bool sbbs_t::pack_rep(uint hubnum)
if(isdir(str))
continue;
sprintf(tmp2,"%s%s",cfg.temp_dir,dirent->d_name);
eprintf(remove_ctrl_a(text[RetrievingFile],tmp),str);
eprintf(LOG_INFO,remove_ctrl_a(text[RetrievingFile],tmp),str);
if(!mv(str,tmp2,1))
netfiles++;
}
......@@ -224,7 +224,7 @@ bool sbbs_t::pack_rep(uint hubnum)
CRLF;
if(!msgcnt && !netfiles && !packedmail) {
eprintf("%s",remove_ctrl_a(text[QWKNoNewMessages],tmp));
eprintf(LOG_INFO,remove_ctrl_a(text[QWKNoNewMessages],tmp));
return(false);
}
......@@ -236,7 +236,7 @@ bool sbbs_t::pack_rep(uint hubnum)
i=external(cmdstr(cfg.qhub[hubnum]->pack,str,tmp2,NULL)
,EX_OFFLINE|EX_WILDCARD);
if(!fexist(str)) {
eprintf("%s",remove_ctrl_a(text[QWKCompressionFailed],tmp));
eprintf(LOG_WARNING,"%s",remove_ctrl_a(text[QWKCompressionFailed],tmp));
if(i)
errormsg(WHERE,ERR_EXEC,cmdstr(cfg.qhub[hubnum]->pack,str,tmp2,NULL),i);
else
......@@ -303,7 +303,7 @@ bool sbbs_t::pack_rep(uint hubnum)
smb_close(&smb);
if(mailmsgs)
FREE(mail);
eprintf("Deleted %d sent NetMail messages",deleted);
eprintf(LOG_INFO,"Deleted %d sent NetMail messages",deleted);
}
return(true);
......
......@@ -79,7 +79,7 @@ void sbbs_t::printfile(char *str, long mode)
CRLF;
if((stream=fnopen(&file,str,O_RDONLY))==NULL) {
lprintf("File not found: %s",str);
lprintf(LOG_NOTICE,"File not found: %s",str);
bputs(text[FileNotFound]);
if(SYSOP) bputs(str);
CRLF;
......@@ -139,7 +139,7 @@ void sbbs_t::printtail(char *str, int lines, long mode)
CRLF;
}
if((file=nopen(str,O_RDONLY))==-1) {
lprintf("File not found: %s",str);
lprintf(LOG_NOTICE,"File not found: %s",str);
bputs(text[FileNotFound]);
if(SYSOP) bputs(str);
CRLF;
......
......@@ -987,15 +987,15 @@ BOOL md(char *path);
#ifdef SBBS /* These aren't exported */
/* main.c */
int lprintf(char *fmt, ...); /* telnet log */
int lputs(int level, char *); /* telnet log */
int lprintf(int level, char *fmt, ...); /* telnet log */
int eprintf(int level, char *fmt, ...); /* event log */
SOCKET open_socket(int type);
SOCKET accept_socket(SOCKET s, SOCKADDR* addr, socklen_t* addrlen);
int close_socket(SOCKET);
u_long resolve_ip(char *addr);
char * readtext(long *line, FILE *stream);
int eprintf(char *fmt, ...); /* event log */
int lputs(char *); /* telnet log */
/* ver.cpp */
char* socklib_version(char* str);
......
......@@ -66,7 +66,7 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode)
ip_addr=resolve_ip(destaddr);
if(ip_addr==INADDR_NONE) {
lprintf("!TELGATE Failed to resolve address: %s",destaddr);
lprintf(LOG_NOTICE,"!TELGATE Failed to resolve address: %s",destaddr);
bprintf("!Failed to resolve address: %s\r\n",destaddr);
return;
}
......@@ -81,7 +81,7 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode)
addr.sin_family = AF_INET;
if((i=bind(remote_socket, (struct sockaddr *) &addr, sizeof (addr)))!=0) {
lprintf("!TELGATE ERROR %d (%d) binding to socket %d",i, ERROR_VALUE, remote_socket);
lprintf(LOG_NOTICE,"!TELGATE ERROR %d (%d) binding to socket %d",i, ERROR_VALUE, remote_socket);
bprintf("!ERROR %d (%d) binding to socket\r\n",i, ERROR_VALUE);
close_socket(remote_socket);
return;
......@@ -93,7 +93,7 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode)
addr.sin_port = htons(port);
if((i=connect(remote_socket, (struct sockaddr *)&addr, sizeof(addr)))!=0) {
lprintf("!TELGATE ERROR %d (%d) connecting to server: %s"
lprintf(LOG_NOTICE,"!TELGATE ERROR %d (%d) connecting to server: %s"
,i,ERROR_VALUE, destaddr);
bprintf("!ERROR %d (%d) connecting to server: %s\r\n"
,i,ERROR_VALUE, destaddr);
......@@ -104,13 +104,13 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode)
l=1;
if((i = ioctlsocket(remote_socket, FIONBIO, &l))!=0) {
lprintf("!TELGATE ERROR %d (%d) disabling socket blocking"
lprintf(LOG_NOTICE,"!TELGATE ERROR %d (%d) disabling socket blocking"
,i, ERROR_VALUE);
close_socket(remote_socket);
return;
}
lprintf("Node %d %s gate to %s port %d on socket %d"
lprintf(LOG_INFO,"Node %d %s gate to %s port %d on socket %d"
,cfg.node_num
,mode&TG_RLOGIN ? "RLogin" : "Telnet"
,destaddr,port,remote_socket);
......@@ -202,7 +202,7 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode)
mswait(500);
}
if(i<0) {
lprintf("!TELGATE ERROR %d sending on socket %d",ERROR_VALUE,remote_socket);
lprintf(LOG_NOTICE,"!TELGATE ERROR %d sending on socket %d",ERROR_VALUE,remote_socket);
break;
}
}
......@@ -220,11 +220,11 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode)
YIELD();
continue;
}
lprintf("!TELGATE ERROR %d receiving on socket %d",ERROR_VALUE,remote_socket);
lprintf(LOG_NOTICE,"!TELGATE ERROR %d receiving on socket %d",ERROR_VALUE,remote_socket);
break;
}
if(!rd) {
lprintf("Node %d Telnet gate disconnected",cfg.node_num);
lprintf(LOG_INFO,"Node %d Telnet gate disconnected",cfg.node_num);
break;
}
RingBufWrite(&outbuf,buf,rd);
......@@ -237,6 +237,6 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode)
close_socket(remote_socket);
lprintf("Node %d Telnet gate to %s finished",cfg.node_num,destaddr);
lprintf(LOG_INFO,"Node %d Telnet gate to %s finished",cfg.node_num,destaddr);
}
......@@ -86,13 +86,13 @@ bool sbbs_t::unpack_qwk(char *packet,uint hubnum)
/********************/
/* Process messages */
/********************/
eprintf("Importing QWK Network Packet: %s",packet);
eprintf(LOG_INFO,"Importing QWK Network Packet: %s",packet);
for(l=QWK_BLOCK_LEN;l<size;l+=blocks*QWK_BLOCK_LEN) {
fseek(qwk,l,SEEK_SET);
fread(block,QWK_BLOCK_LEN,1,qwk);
if(block[0]<' ' || block[0]&0x80) {
eprintf("!Invalid message status (%02X) at offset %lu in %s"
eprintf(LOG_NOTICE,"!Invalid message status (%02X) at offset %lu in %s"
,block[0], l, packet);
blocks=1;
continue;
......@@ -100,7 +100,7 @@ bool sbbs_t::unpack_qwk(char *packet,uint hubnum)
sprintf(tmp,"%.6s",block+116);
blocks=atoi(tmp); /* i = number of blocks */
if(blocks<2) {
eprintf("!Invalid number of blocks (%d) at offset %lu in %s"
eprintf(LOG_NOTICE,"!Invalid number of blocks (%d) at offset %lu in %s"
,blocks, l+116, packet);
blocks=1;
continue;
......@@ -113,7 +113,7 @@ bool sbbs_t::unpack_qwk(char *packet,uint hubnum)
if(!n) { /* NETMAIL */
sprintf(str,"%25.25s",block+21);
truncsp(str);
eprintf("NetMail from %s to %s", cfg.qhub[hubnum]->id, str);
eprintf(LOG_INFO,"NetMail from %s to %s", cfg.qhub[hubnum]->id, str);
if(!stricmp(str,"NETMAIL")) { /* QWK to FidoNet NetMail */
qwktonetmail(qwk,(char *)block,NULL,hubnum+1);
continue;
......@@ -128,7 +128,7 @@ bool sbbs_t::unpack_qwk(char *packet,uint hubnum)
if(!j)
j=matchuser(&cfg,str,TRUE /* sysop_alias */);
if(!j) {
eprintf("!NetMail from %s to UNKNOWN USER: %s", cfg.qhub[hubnum]->id, str);
eprintf(LOG_NOTICE,"!NetMail from %s to UNKNOWN USER: %s", cfg.qhub[hubnum]->id, str);
continue;
}
......@@ -189,7 +189,7 @@ bool sbbs_t::unpack_qwk(char *packet,uint hubnum)
if(cfg.qhub[hubnum]->conf[j]==n)
break;
if(j>=cfg.qhub[hubnum]->subs) { /* ignore messages for subs not in config */
eprintf("!Message from %s on UNKNOWN CONFERENCE NUMBER: %u"
eprintf(LOG_NOTICE,"!Message from %s on UNKNOWN CONFERENCE NUMBER: %u"
,cfg.qhub[hubnum]->id, n);
continue;
}
......@@ -204,7 +204,7 @@ bool sbbs_t::unpack_qwk(char *packet,uint hubnum)
truncsp(str);
if(findstr(str,fname)) {
eprintf("!Filtering post from twit (%s) on %s %s"
eprintf(LOG_NOTICE,"!Filtering post from twit (%s) on %s %s"
,str
,cfg.grp[cfg.sub[j]->grp]->sname,cfg.sub[j]->lname);
continue;
......@@ -213,7 +213,7 @@ bool sbbs_t::unpack_qwk(char *packet,uint hubnum)
if(j!=lastsub) {
eprintf("Importing messages from %s into %s %s"
eprintf(LOG_INFO,"Importing messages from %s into %s %s"
,cfg.qhub[hubnum]->id, cfg.grp[cfg.sub[j]->grp]->sname,cfg.sub[j]->lname);
if(lastsub!=INVALID_SUB)
......@@ -295,14 +295,14 @@ bool sbbs_t::unpack_qwk(char *packet,uint hubnum)
mv(str,fname,1 /* overwrite */);
sprintf(str,text[ReceivedFileViaQWK],dirent->d_name,cfg.qhub[hubnum]->id);
putsmsg(&cfg,1,str);
eprintf("Received %s from %s", dirent->d_name, cfg.qhub[hubnum]->id);
eprintf(LOG_INFO,"Received %s from %s", dirent->d_name, cfg.qhub[hubnum]->id);
}
if(dir!=NULL)
closedir(dir);
t=time(NULL)-start;
if(t) {
eprintf("Finished Importing QWK Network Packet from %s: "
eprintf(LOG_INFO,"Finished Importing QWK Network Packet from %s: "
"(%lu msgs) in %lu seconds (%lu msgs/sec)"
,cfg.qhub[hubnum]->id, msgs, t, msgs/t);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment