--- deliantra/server/common/logger.C 2008/04/15 03:16:02 1.17 +++ deliantra/server/common/logger.C 2009/10/12 14:00:57 1.20 @@ -1,22 +1,23 @@ /* * This file is part of Deliantra, the Roguelike Realtime MMORPG. * - * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Deliantra team + * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team * Copyright (©) 1992,2007 Frank Tore Johansen * - * Deliantra is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * Deliantra is free software: you can redistribute it and/or modify it under + * the terms of the Affero GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the Affero GNU General Public License + * and the GNU General Public License along with this program. If not, see + * . * * The authors can be reached via e-mail to */ @@ -59,16 +60,18 @@ static void log_sync (logline &line) { - struct tm *lt = localtime (&line.tv.tv_sec); + struct tm lt; char pfx [PREFIX_LEN]; + localtime_r (&line.tv.tv_sec, <); + sprintf (pfx, "%04d-%02d-%02d %02d:%02d:%02d.%04d", - lt->tm_year + 1900, - lt->tm_mon + 1, - lt->tm_mday, - lt->tm_hour, - lt->tm_min, - lt->tm_sec, + lt.tm_year + 1900, + lt.tm_mon + 1, + lt.tm_mday, + lt.tm_hour, + lt.tm_min, + lt.tm_sec, (int)(line.tv.tv_usec / 100) );