Go to the documentation of this file.
37 #define PRINT_FORMAT_ATTRIBUTE
38 #define PRINT_FORMAT_ATTRIBUTE_WC
40 #define PRINT_FORMAT_ATTRIBUTE __attribute__ ((format(printf,4,5)))
41 #define PRINT_FORMAT_ATTRIBUTE_WC __attribute__ ((format(printf,5,6)))
61 const char *log_program_name
78 const char *format, ...
87 const char *format, ...
92 #define IAS_LOG_DEBUG_ENABLED() \
93 (((IAS_LOG_LEVEL_DEBUG) >= (ias_log_message_level)) ? (1) : (0))
96 #define IAS_LOG_ERROR(format,...) \
97 ias_log_message(IAS_LOG_LEVEL_ERROR,__FILE__,__LINE__,format,##__VA_ARGS__)
100 #define IAS_LOG_WARNING(format,...) \
101 if (IAS_LOG_LEVEL_WARN >= ias_log_message_level) \
102 ias_log_message(IAS_LOG_LEVEL_WARN,__FILE__,__LINE__, \
103 format,##__VA_ARGS__)
106 #define IAS_LOG_INFO(format,...) \
107 if (IAS_LOG_LEVEL_INFO >= ias_log_message_level) \
108 ias_log_message(IAS_LOG_LEVEL_INFO,__FILE__,__LINE__, \
109 format,##__VA_ARGS__)
112 #ifndef IAS_LOG_CHANNEL
113 #define IAS_LOG_DEBUG(format,...) \
114 if (IAS_LOG_LEVEL_DEBUG >= ias_log_message_level) \
115 ias_log_message(IAS_LOG_LEVEL_DEBUG,__FILE__,__LINE__, \
116 format,##__VA_ARGS__)
118 #define IAS_LOG_DEBUG(format,...) \
119 if (IAS_LOG_LEVEL_DEBUG >= ias_log_message_level) \
120 ias_log_message_with_channel(IAS_LOG_LEVEL_DEBUG, IAS_LOG_CHANNEL, \
121 __FILE__,__LINE__, format,##__VA_ARGS__)
125 #define IAS_LOG_DEBUG_TO_CHANNEL(channel,format,...) \
126 if (IAS_LOG_LEVEL_DEBUG >= ias_log_message_level) \
127 ias_log_message_with_channel(IAS_LOG_LEVEL_DEBUG, channel, \
128 __FILE__, __LINE__, format, ##__VA_ARGS__)
132 #undef PRINT_FORMAT_ATTRIBUTE
133 #undef PRINT_FORMAT_ATTRIBUTE_WC
enum IAS_LOG_MESSAGE_LEVEL ias_log_message_level
int ias_log_initialize(const char *log_program_name)
char filename[FILENAME_MAX]
void ias_log_message_with_channel(int log_level, const char *channel, const char *filename, int line_number, const char *format,...) PRINT_FORMAT_ATTRIBUTE_WC
IAS_LOG_MESSAGE_LEVEL ias_log_set_output_level(int new_level)
#define PRINT_FORMAT_ATTRIBUTE_WC
int ias_log_set_output_target(FILE *new_fp)
#define PRINT_FORMAT_ATTRIBUTE
void ias_log_message(int log_level, const char *filename, int line_number, const char *format,...) PRINT_FORMAT_ATTRIBUTE