38 #ifndef _LIBUTIL_ERR_H_
39 #define _LIBUTIL_ERR_H_
48 #include <sphinxbase/sphinxbase_export.h>
76 void _E__pr_header(
char const *file,
long line,
char const *msg);
78 void _E__pr_debug_header(
char const *file,
long line,
int level);
80 void _E__pr_info_header(
char const *file,
long line,
char const *tag);
82 void _E__pr_info_header_wofn(
char const *msg);
84 void _E__pr_warn(
char const *fmt, ...);
86 void _E__pr_info(
char const *fmt, ...);
88 void _E__die_error(
char const *fmt, ...);
90 void _E__abort_error(
char const *fmt, ...);
92 void _E__sys_error(
char const *fmt, ...);
94 void _E__fatal_sys_error(
char const *fmt, ...);
127 #define E_FATAL _E__pr_header(__FILE__, __LINE__, "FATAL_ERROR"),_E__die_error
132 #define E_FATAL_SYSTEM _E__pr_header(__FILE__, __LINE__, "SYSTEM_ERROR"),_E__fatal_sys_error
137 #define E_WARN_SYSTEM _E__pr_header(__FILE__, __LINE__, "SYSTEM_ERROR"),_E__sys_error
142 #define E_ERROR_SYSTEM _E__pr_header(__FILE__, __LINE__, "SYSTEM_ERROR"),_E__sys_error
147 #define E_INFO _E__pr_info_header(__FILE__, __LINE__, "INFO"),_E__pr_info
153 #define E_INFOCONT _E__pr_info
158 #define E_INFO_NOFN _E__pr_info_header_wofn("INFO"),_E__pr_info
164 #define E_WARN _E__pr_header(__FILE__, __LINE__, "WARNING"),_E__pr_warn
169 #define E_ERROR _E__pr_header(__FILE__, __LINE__, "ERROR"),_E__pr_warn
200 #define E_DEBUG(level,x) { \
201 if (err_get_debug_level() >= level) { \
202 _E__pr_header(__FILE__, __LINE__, "DEBUG"); \
206 #define E_DEBUGCONT(level,x) { \
207 if (err_get_debug_level() >= level) { \
212 #define E_DEBUG(level,x)
213 #define E_DEBUGCONT(level,x)
SPHINXBASE_EXPORT FILE * err_get_logfp(void)
Get the current logging filehandle.
SPHINXBASE_EXPORT int err_set_debug_level(int level)
Set debugging verbosity level.
SPHINXBASE_EXPORT int err_get_debug_level(void)
Get debugging verbosity level.
SPHINXBASE_EXPORT int err_set_logfile(char const *file)
Append all log messages to a given file.
SPHINXBASE_EXPORT FILE * err_set_logfp(FILE *logfp)
Direct all logging to a given filehandle.