15#define LOG(str, args...) (logprintf(stdout, 1, str, ## args))
16#define LOGERR(str, args...) (logprintf(stderr, 1, str, ## args))
18#define WARN(str, args...) (logprintf(stderr, 0, _("WARNING %s:%d [%s]: "), __FILE__, __LINE__, __func__), logprintf( stderr, 1, str, ## args), raise(SIGINT))
20#define WARN(str, args...) (logprintf(stderr, 0, _("Warning: [%s] "), __func__), logprintf( stderr, 1, str, ## args))
22#define ERR(str, args...) (logprintf(stderr, 0, _("ERROR %s:%d [%s]: "), __FILE__, __LINE__, __func__), logprintf( stderr, 1, str, ## args), abort())
25# define DEBUG(str, args...) LOG(str, ## args)
30# define DEBUG(str, args...) do {;} while (0)
32#define DEBUG_BLANK() DEBUG("%s", "")
34PRINTF_FORMAT( 3, 4 ) NONNULL(3)
int logprintf( FILE *stream,
int newline, const
char *fmt, ... );
void log_clean(void)
Deletes useless (empty) log files from the current session.
int logprintf(FILE *stream, int newline, const char *fmt,...)
Like fprintf, but automatically teed to log files (and line-terminated if newline is true).
void log_init(void)
Sets up the logging subsystem. (Calling this ensures logging output is preserved until we have a plac...
void log_redirect(void)
Sets up redirection of stdout and stderr to files. PhysicsFS must be initialized for this to work.