LibTMJ  1.0.0
A library for loading JSON Tiled maps
log.h
Go to the documentation of this file.
1 #ifndef LIBTMJ_LOG
2 #define LIBTMJ_LOG
3 
4 #include <stdbool.h>
5 #include <stdio.h>
6 
7 #include "../include/tmj.h"
8 
22 extern char logmsg_buf[];
23 
33 void logmsg(tmj_log_priority priority, char* msg, ...);
34 
36 // * @ingroup logging
37 // * Processes log messages and passes them to the active logging callback, if
38 // * there is one. This function should not be used directly under normal
39 // * circumstances. Use the logmsg() macro instead, which uses the preprocessor
40 // * to add line/file/function debugging information.
41 // *
42 // * @param loglevel One of the set of log priorities defined in the LOG_PRIORITY enum.
43 // * @param line A source-code line number to report as part of the log message.
44 // * @param file A source-code filename to report as part of the log message.
45 // * @param func A function name to report as part of the log message.
46 // * @param msg A printf-style format string for the message to be logged
47 // * @param ... Format string arguments for the previous argument. See printf() for detail.
48 // */
49 // void log_event(int loglevel, int line, char* file, char* func, char* msg, ...);
50 
52 // * @ingroup logging
53 // * This macro adds line, file, and function name information to logging calls
54 // * to aid in debugging. Use this macro wherever a message needs to be logged.
55 // *
56 // * The expected arguments are identical to that of log_event(). See the
57 // * documentation for log_event() for detail.
58 // */
59 // #define logmsg(loglevel, ...) log_event(loglevel, __LINE__, __FILE__, __func__, msg, __VA_ARGS__);
60 
61 #endif
void logmsg(tmj_log_priority priority, char *msg,...)
Processes log messages and passes them to the active logging callback, if there is one.
Definition: log.c:23
char logmsg_buf[]
Statically-allocated memory to hold log messages which are passed to the logging callback.
Definition: log.c:16
enum TMJ_LOG_PRIORITY tmj_log_priority