97 #define QOF_MOD_ENGINE "qof.engine"
99 #define LOG_LEVEL_LIST(_) \
100 _(QOF_LOG_FATAL, = G_LOG_LEVEL_ERROR) \
101 _(QOF_LOG_ERROR, = G_LOG_LEVEL_CRITICAL) \
102 _(QOF_LOG_WARNING, = G_LOG_LEVEL_WARNING) \
103 _(QOF_LOG_MESSAGE, = G_LOG_LEVEL_MESSAGE) \
104 _(QOF_LOG_INFO, = G_LOG_LEVEL_INFO) \
105 _(QOF_LOG_DEBUG, = G_LOG_LEVEL_DEBUG)
107 DEFINE_ENUM (QofLogLevel, LOG_LEVEL_LIST)
109 const
char* qof_log_level_to_string(QofLogLevel lvl);
110 QofLogLevel qof_log_level_from_string(const
char *str);
174 #define PRETTY_FUNC_NAME qof_log_prettify(G_STRFUNC)
181 #define FATAL(format, ...) do { \
182 g_log (log_module, G_LOG_LEVEL_ERROR, \
183 "[%s()] " format, PRETTY_FUNC_NAME , __VA_ARGS__); \
187 #define PERR(format, ...) do { \
188 g_log (log_module, G_LOG_LEVEL_CRITICAL, \
189 "[%s()] " format, PRETTY_FUNC_NAME , __VA_ARGS__); \
193 #define PWARN(format, ...) do { \
194 g_log (log_module, G_LOG_LEVEL_WARNING, \
195 "[%s()] " format, PRETTY_FUNC_NAME , __VA_ARGS__); \
199 #define PINFO(format, ...) do { \
200 g_log (log_module, G_LOG_LEVEL_INFO, \
201 "[%s] " format, PRETTY_FUNC_NAME , __VA_ARGS__); \
205 #define DEBUG(format, ...) do { \
206 g_log (log_module, G_LOG_LEVEL_DEBUG, \
207 "[%s] " format, PRETTY_FUNC_NAME , __VA_ARGS__); \
211 #define ENTER(format, ...) do { \
212 if (qof_log_check(log_module, (QofLogLevel)G_LOG_LEVEL_DEBUG)) { \
213 g_log (log_module, G_LOG_LEVEL_DEBUG, \
214 "[enter %s:%s()] " format, __FILE__, \
215 PRETTY_FUNC_NAME , __VA_ARGS__); \
221 #define LEAVE(format, ...) do { \
222 if (qof_log_check(log_module, (QofLogLevel)G_LOG_LEVEL_DEBUG)) { \
224 g_log (log_module, G_LOG_LEVEL_DEBUG, \
225 "[leave %s()] " format, \
226 PRETTY_FUNC_NAME , __VA_ARGS__); \
233 #define FATAL(format, args...) do { \
234 g_log (log_module, G_LOG_LEVEL_ERROR, \
235 "[%s()] " format, PRETTY_FUNC_NAME , ## args); \
239 #define PERR(format, args...) do { \
240 g_log (log_module, G_LOG_LEVEL_CRITICAL, \
241 "[%s()] " format, PRETTY_FUNC_NAME , ## args); \
245 #define PWARN(format, args...) do { \
246 g_log (log_module, G_LOG_LEVEL_WARNING, \
247 "[%s()] " format, PRETTY_FUNC_NAME , ## args); \
251 #define PINFO(format, args...) do { \
252 g_log (log_module, G_LOG_LEVEL_INFO, \
253 "[%s] " format, PRETTY_FUNC_NAME , ## args); \
257 #define DEBUG(format, args...) do { \
258 g_log (log_module, G_LOG_LEVEL_DEBUG, \
259 "[%s] " format, PRETTY_FUNC_NAME , ## args); \
263 #define ENTER(format, args...) do { \
264 if (qof_log_check(log_module, (QofLogLevel)G_LOG_LEVEL_DEBUG)) { \
265 g_log (log_module, G_LOG_LEVEL_DEBUG, \
266 "[enter %s:%s()] " format, __FILE__, \
267 PRETTY_FUNC_NAME , ## args); \
273 #define LEAVE(format, args...) do { \
274 if (qof_log_check(log_module, (QofLogLevel)G_LOG_LEVEL_DEBUG)) { \
276 g_log (log_module, G_LOG_LEVEL_DEBUG, \
277 "[leave %s()] " format, \
278 PRETTY_FUNC_NAME , ## args); \
285 #define gnc_leave_return_val_if_fail(test, val) do { \
286 if (! (test)) { LEAVE(""); } \
287 g_return_val_if_fail(test, val); \
291 #define gnc_leave_return_if_fail(test) do { \
292 if (! (test)) { LEAVE(""); } \
293 g_return_if_fail(test); \
void qof_log_set_level(QofLogModule module, QofLogLevel level)
void qof_log_dedent(void)
void qof_log_set_default(QofLogLevel log_level)
void qof_log_shutdown(void)
void qof_log_init_filename_special(const char *log_to_filename)
gboolean qof_log_check(QofLogModule log_module, QofLogLevel log_level)
const gchar * qof_log_prettify(const gchar *name)
void qof_log_init_filename(const gchar *logfilename)
void qof_log_indent(void)
void qof_log_parse_log_config(const char *filename)
void qof_log_set_file(FILE *outfile)
const gchar * QofLogModule