]>
jfr.im git - irc/gameservirc.git/blob - gameserv/log.cpp
11 void log(const char *fmt
, ...)
21 output
= new char[4096];
23 outfile
.open("gameserv.log", ios::out
| ios::app
);
27 cerr
<< "Error opening gameserv.log" << endl
;
35 strftime(ts
, 32, "%Y%m%d", tm
);
37 sprintf(output
, "[%s]: ", ts
);
47 case 'd': sprintf(output
, "%s%d", output
, va_arg(args
, int)); break;
48 case 's': sprintf(output
, "%s%s", output
, va_arg(args
, char *)); break;
49 case 'S': sprintf(output
, "%s%s", output
, s_GameServ
); break;
52 sprintf(output
, "%s%ld", output
, va_arg(args
, long int)); break;
57 sprintf(output
, "%s%c", output
, *t
);
62 outfile
<< output
<< endl
;