mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
[qwaq] Use a log file instead of stderr
Now I don't have to worry about remembering to redirect the output, but debugging is still easy.
This commit is contained in:
parent
b8b74fc074
commit
1250fe7446
1 changed files with 5 additions and 2 deletions
|
@ -1630,11 +1630,13 @@ static builtin_t builtins[] = {
|
|||
{0}
|
||||
};
|
||||
|
||||
static FILE *logfile;
|
||||
|
||||
static __attribute__((format(printf, 1, 0))) void
|
||||
qwaq_print (const char *fmt, va_list args)
|
||||
{
|
||||
vfprintf (stderr, fmt, args);
|
||||
fflush (stderr);
|
||||
vfprintf (logfile, fmt, args);
|
||||
fflush (logfile);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1650,5 +1652,6 @@ BI_Init (progs_t *pr)
|
|||
PR_Resources_Register (pr, "qwaq", res, bi_qwaq_clear);
|
||||
PR_RegisterBuiltins (pr, builtins);
|
||||
Sys_RegisterShutdown (bi_shutdown);
|
||||
logfile = fopen ("qwaq-curses.log", "wt");
|
||||
Sys_SetStdPrintf (qwaq_print);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue