51 #define LOG_CATEGORY(category) LOG_ ##category ,
58 #define LOG_TYPE(category, type, enabled, str) category##__##type ,
78 #define is_log_enabled( type ) \
79 ( log_type_info[ ( type ) ].enabled )
93 extern void log_hex(
LogType type,
const void *data,
unsigned long length,
unsigned char padding=4);
94 extern void log_phex(
LogType type,
const void *data,
unsigned long length,
unsigned char padding=4);
96 #if defined ( DISABLE_LOGSYS )
98 # define _log( type, fmt, ... )
99 # define codelog( type, fmt, ... )
100 #elif defined ( NO_VARIADIC_MACROS )
101 inline void _log(
LogType type,
const char* fmt, ... )
104 va_start( args, fmt );
115 va_start( args, fmt );
124 # define _log( type, fmt, ... ) \
125 if ( is_log_enabled( type ) ) \
126 log_message( type, fmt, ##__VA_ARGS__ )
128 # define codelog( type, fmt, ... ) \
129 if ( is_log_enabled( type ) ) \
130 log_message( type, "%s(%s:%d): " fmt, __FUNCTION__, __FILE__, __LINE__, ##__VA_ARGS__ )
133 #define _hex( type, data, len) \
134 if ( is_log_enabled( type ) ) \
135 log_hex( type, (const char*)data, len )
137 #define phex( type, data, len) \
138 if ( is_log_enabled( type ) ) \
139 log_phex( type, (const char*)data, len )
#define _log(type, fmt,...)
void log_messageVA(LogType type, const char *fmt, va_list args)
bool log_open_logfile(const char *filename)
void log_toggle(LogType t)
#define is_log_enabled(type)
void log_enable(LogType t)
#define codelog(type, fmt,...)
const char * display_name
void log_phex(LogType type, const void *data, unsigned long length, unsigned char padding=4)
bool load_log_settings(const char *filename)
const char * log_category_names[NUMBER_OF_LOG_CATEGORIES]
void log_message(LogType type, const char *fmt,...)
const LogTypeStatus * log_type_info
void log_disable(LogType t)
void log_hex(LogType type, const void *data, unsigned long length, unsigned char padding=4)