mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
-logfile to let the user change the log file name
(cherry picked from commit d9d13764e6840e036c095c6d87838a4dfede80f4)
This commit is contained in:
parent
c79ceca65e
commit
ccde660cdf
1 changed files with 7 additions and 3 deletions
|
|
@ -133,15 +133,19 @@ int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
time_t my_time;
|
time_t my_time;
|
||||||
struct tm * timeinfo;
|
struct tm * timeinfo;
|
||||||
char buf[26];
|
const char *format;
|
||||||
|
|
||||||
logdir = D_Home();
|
logdir = D_Home();
|
||||||
|
|
||||||
my_time = time(NULL);
|
my_time = time(NULL);
|
||||||
timeinfo = localtime(&my_time);
|
timeinfo = localtime(&my_time);
|
||||||
|
|
||||||
strftime(buf, 26, "%Y-%m-%d %H-%M-%S", timeinfo);
|
if (M_CheckParm("-logfile") && M_IsNextParm())
|
||||||
strcpy(logfile, va("log-%s.txt", buf));
|
format = M_GetNextParm();
|
||||||
|
else
|
||||||
|
format = "log-%Y-%m-%d %H-%M-%S.txt";
|
||||||
|
|
||||||
|
strftime(logfile, sizeof logfile, format, timeinfo);
|
||||||
|
|
||||||
#ifdef DEFAULTDIR
|
#ifdef DEFAULTDIR
|
||||||
if (logdir)
|
if (logdir)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue