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