]>
jfr.im git - irc/gameservirc.git/blob - gameserv/log.cpp
6 void log(const char *fmt
, ...)
16 output
= new char[4096];
18 outfile
.open(logfile
, ios::out
| ios::app
);
22 cerr
<< "Error opening " << logfile
<< endl
;
30 strftime(ts
, 32, "%Y%m%d", tm
);
32 sprintf(output
, "[%s]: ", ts
);
42 case 'd': sprintf(output
, "%s%d", output
, va_arg(args
, int)); break;
43 case 's': sprintf(output
, "%s%s", output
, va_arg(args
, char *)); break;
44 case 'S': sprintf(output
, "%s%s", output
, s_GameServ
); break;
47 sprintf(output
, "%s%ld", output
, va_arg(args
, long int)); break;
52 sprintf(output
, "%s%c", output
, *t
);
57 outfile
<< output
<< endl
;