common: create logprint_silent to replace qbsp's msgFile

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
Kevin Shanahan 2013-04-23 14:59:37 +09:30
parent b1650d0036
commit 75666712e7
2 changed files with 21 additions and 2 deletions

View File

@ -80,6 +80,17 @@ logprint_locked__(const char *fmt, ...)
va_end(args);
}
void logprint_silent(const char *fmt, ...)
{
va_list args;
ThreadLock();
va_start(args, fmt);
vfprintf(logfile, fmt, args);
va_end(args);
ThreadUnlock();
}
void
logprint(const char *fmt, ...)
{

View File

@ -31,8 +31,16 @@
void init_log(const char *filename);
void close_log();
void logprint(const char *fmt, ...) __attribute__((format(printf,1,2)));
void logvprint(const char *fmt, va_list args) __attribute__((format(printf,1,0)));
/* Print to screen and to log file */
void logprint(const char *fmt, ...)
__attribute__((format(printf,1,2)));
void logvprint(const char *fmt, va_list args)
__attribute__((format(printf,1,0)));
/* Print only into log file */
void logprint_silent(const char *fmt, ...)
__attribute__((format(printf,1,2)));
/* Only called from the threads code */
void logprint_locked__(const char *fmt, ...)