80 time_t now = time((time_t *)NULL);
82 time_tmp = localtime(&now);
83 if (time_tmp != NULL) {
90 vsnprintf(buf,
sizeof(buf), format, ap);
92 if (time_buf[0] != 0) {
100 if (time_buf[0] != 0) {
101 fputs(time_buf, stderr);
114 perror(
"tried to close log file after SIGHUP in logger.c:LOG()");
119 perror(
"tried to open log file after SIGHUP in logger.c:LOG()");
124 setvbuf(
logfile, NULL, _IOLBF, 0);
128 if (time_buf[0] != 0) {
void clean_tmp_files(void)
Save unique maps and clean up temporary map files unless recycling temporary maps.
FILE * logfile
Used by server/daemon.c.
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
long nroferrors
If it exceeds MAX_ERRORS, call fatal()
long trying_emergency_save
True when emergency_save() is reached.
LogLevel debug
Default debugging level.
Global type definitions and header inclusions.
const char * logfilename
Logfile to use.
char * log_timestamp_format
Format for timestap, if log_timestamp is set.
int exiting
True if the game is about to exit.
struct Settings settings
Global settings.
const char *const loglevel_names[]
Human-readable name of log levels.
void emergency_save(int flag)
Save all players.
LogLevel
Log levels for the LOG() function.
logHook log_callback
Log hook, to intercept log messages.
int log_timestamp
If set, log will comport a timestamp.
#define MAX_ERRORS
Bail out if more are received during tick.