mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 07:22:28 +00:00
-logfile to let the user change the log file name
This commit is contained in:
parent
1e13604007
commit
d9d13764e6
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…
Reference in a new issue