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

Add llprintf() to log a formatted line to the node.log and term server log

There's a whole lotta calls to sprintf() then logline() that could be reduced
with this function.
parent 984c371a
No related branches found
No related tags found
No related merge requests found
......@@ -217,6 +217,21 @@ void sbbs_t::logline(int level, const char *code, const char *str)
fflush(logfile_fp);
}
/****************************************************************************/
/* Writes formatted string on it's own line in node.log */
/****************************************************************************/
void sbbs_t::llprintf(int level, const char* code, const char *fmt, ...)
{
va_list argptr;
char sbuf[1024];
va_start(argptr,fmt);
vsnprintf(sbuf, sizeof sbuf, fmt, argptr);
TERMINATE(sbuf);
va_end(argptr);
logline(level, code, sbuf);
}
/****************************************************************************/
/* Writes a comma then 'ch' to log, tracking column. */
/****************************************************************************/
......
......@@ -1244,6 +1244,8 @@ public:
void logch(char ch, bool comma); /* Writes 'ch' to node log */
void logline(const char *code,const char *str); /* Writes 'str' on it's own line in log (LOG_INFO level) */
void logline(int level, const char *code,const char *str);
void llprintf(int level, const char* code, const char *fmt, ...);
bool logofflist(void); /* List of users logon activity */
bool errormsg_inside = false;
void errormsg(int line, const char* function, const char *source, const char* action, const char *object
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment