mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 11:10:47 +00:00
- added 'logfile' CCMD.
This commit is contained in:
parent
2997bb6292
commit
39df3d0560
2 changed files with 31 additions and 1 deletions
|
@ -1 +0,0 @@
|
||||||
|
|
|
@ -1064,3 +1064,34 @@ CCMD (exit)
|
||||||
{
|
{
|
||||||
throw ExitEvent(0);
|
throw ExitEvent(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern FILE* Logfile;
|
||||||
|
void execLogfile(const char* fn, bool append)
|
||||||
|
{
|
||||||
|
if ((Logfile = fopen(fn, append ? "a" : "w")))
|
||||||
|
{
|
||||||
|
//const char* timestr = myasctime();
|
||||||
|
Printf("Log started\n");// , timestr);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Printf("Could not start log\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CCMD(logfile)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (Logfile)
|
||||||
|
{
|
||||||
|
//const char* timestr = myasctime();
|
||||||
|
Printf("Log stopped: %s\n");// , timestr);
|
||||||
|
fclose(Logfile);
|
||||||
|
Logfile = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (argv.argc() >= 2)
|
||||||
|
{
|
||||||
|
execLogfile(argv[1], argv.argc() >= 3 ? !!argv[2] : false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue