15#define LOG( str, ... ) logprintf( stdout, 1, str, ##__VA_ARGS__ )
16#define LOGERR( str, ... ) logprintf( stderr, 1, str, ##__VA_ARGS__ )
17#define WARN( str, ... ) \
18 log_warn( __FILE__, __LINE__, __func__, str, ##__VA_ARGS__ )
19#define ERR( str, ... ) \
20 ( logprintf( stderr, 0, _( "ERROR %s:%d [%s]: " ), __FILE__, __LINE__, \
22 logprintf( stderr, 1, str, ##__VA_ARGS__ ), abort() )
25#define DEBUG( str, ... ) LOG( str, ##__VA_ARGS__ )
30#define DEBUG( str, ... ) \
34#define DEBUG_BLANK() DEBUG( "%s", "" )
37NONNULL( 3 )
int logprintf( FILE *stream,
int newline, const
char *fmt, ... );
41int log_warn( const
char *file,
size_t line, const
char *func, 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.
int log_warn(const char *file, size_t line, const char *func, const char *fmt,...)
Prints warnings, but skips if they are repeated too much.