Skip to content
Snippets Groups Projects
Commit 16ffc140 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Add "Printing file" and "Printing tail" debug-level log messages

In printfile() and printtail() which are used by menu() and many other
functions.

These should be helpful to sysops that just want to know what file is being
displayed under what conditions (e.g. for trouble-shooting or customization
reasons).
parent 37126d82
Branches
Tags
No related merge requests found
...@@ -88,6 +88,7 @@ bool sbbs_t::printfile(const char* fname, int mode, int org_cols, JSObject* obj) ...@@ -88,6 +88,7 @@ bool sbbs_t::printfile(const char* fname, int mode, int org_cols, JSObject* obj)
return true; return true;
} }
lprintf(LOG_DEBUG, "Printing file: %s", fpath);
if(!(mode&P_NOCRLF) && row > 0 && !rip) { if(!(mode&P_NOCRLF) && row > 0 && !rip) {
newline(); newline();
} }
...@@ -197,15 +198,18 @@ bool sbbs_t::printtail(const char* fname, int lines, int mode, int org_cols, JSO ...@@ -197,15 +198,18 @@ bool sbbs_t::printtail(const char* fname, int lines, int mode, int org_cols, JSO
} }
return false; return false;
} }
if(!(mode&P_NOCRLF) && row > 0) {
newline();
}
length=(int)filelength(file); length=(int)filelength(file);
if(length<0) { if(length<0) {
fclose(fp); fclose(fp);
errormsg(WHERE,ERR_CHK,fpath,length); errormsg(WHERE,ERR_CHK,fpath,length);
return false; return false;
} }
lprintf(LOG_DEBUG, "Printing tail: %s", fpath);
if(!(mode&P_NOCRLF) && row > 0) {
newline();
}
if(length > lines * PRINTFILE_MAX_LINE_LEN) { if(length > lines * PRINTFILE_MAX_LINE_LEN) {
length = lines * PRINTFILE_MAX_LINE_LEN; length = lines * PRINTFILE_MAX_LINE_LEN;
(void)fseek(fp, -length, SEEK_END); (void)fseek(fp, -length, SEEK_END);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment