mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-30 05:00:46 +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;
|
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…
Reference in a new issue