|
Error.hh File Reference#include <stdio.h>
#include <errno.h>
Go to the source code of this file.
|
Defines |
#define | GZ_ERR_ERR 0 |
#define | GZ_ERR_WARN 1 |
#define | GZ_ERR_MSG 2 |
#define | GZ_ERR_DBG 2 |
#define | PRINT_ERR(msg) ErrorPrint(GZ_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n") |
| Error message macros.
|
#define | PRINT_ERR1(msg, a) ErrorPrint(GZ_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n", a) |
#define | PRINT_ERR2(msg, a, b) ErrorPrint(GZ_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n", a, b) |
#define | PRINT_ERR3(msg, a, b, c) ErrorPrint(GZ_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n", a, b, c) |
#define | PRINT_WARN(msg) ErrorPrint(GZ_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n") |
| Warning message macros.
|
#define | PRINT_WARN1(msg, a) ErrorPrint(GZ_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a) |
#define | PRINT_WARN2(msg, a, b) ErrorPrint(GZ_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a, b) |
#define | PRINT_WARN3(msg, a, b, c) ErrorPrint(GZ_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a, b, c) |
#define | PRINT_MSG0(level, msg) ErrorPrint(GZ_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n") |
#define | PRINT_MSG1(level, msg, a) ErrorPrint(GZ_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a) |
#define | PRINT_MSG2(level, msg, a, b) ErrorPrint(GZ_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b) |
#define | PRINT_MSG3(level, msg, a, b, c) ErrorPrint(GZ_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c) |
#define | PRINT_MSG4(level, msg, a, b, c, d) ErrorPrint(GZ_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c, d) |
#define | PRINT_MSG5(level, msg, a, b, c, d, e) ErrorPrint(GZ_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c, d, e) |
#define | PRINT_MSG6(level, msg, a, b, c, d, e, f) ErrorPrint(GZ_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c, d, e, f) |
#define | PRINT_MSG7(level, msg, a, b, c, d, e, f, g) ErrorPrint(GZ_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c, d, e, f, g) |
#define | PRINT_GL_ERR() ErrorPrintGL(__FILE__, __LINE__) |
Functions |
void | ErrorInit (int msgLevel, const char *logFile=NULL) |
| Initialize error logging.
|
void | ErrorFini () |
| Finalize error logging.
|
int | ErrorPrint (int msgType, int level, const char *file, int line, const char *fmt,...) |
| Function for print and logging errors.
|
int | ErrorPrintGL (const char *file, int line) |
| Print GL error messages.
|
Define Documentation
|
For internal use only.
Message types (internal use only; code should use the macros)
|
#define PRINT_ERR |
( |
msg |
|
) |
ErrorPrint(GZ_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n") |
|
#define PRINT_ERR1 |
( |
msg, |
|
|
a |
|
) |
ErrorPrint(GZ_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n", a) |
|
#define PRINT_ERR2 |
( |
msg, |
|
|
a, |
|
|
b |
|
) |
ErrorPrint(GZ_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n", a, b) |
|
#define PRINT_ERR3 |
( |
msg, |
|
|
a, |
|
|
b, |
|
|
c |
|
) |
ErrorPrint(GZ_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n", a, b, c) |
|
#define PRINT_WARN |
( |
msg |
|
) |
ErrorPrint(GZ_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n") |
|
#define PRINT_WARN1 |
( |
msg, |
|
|
a |
|
) |
ErrorPrint(GZ_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a) |
|
#define PRINT_WARN2 |
( |
msg, |
|
|
a, |
|
|
b |
|
) |
ErrorPrint(GZ_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a, b) |
|
#define PRINT_WARN3 |
( |
msg, |
|
|
a, |
|
|
b, |
|
|
c |
|
) |
ErrorPrint(GZ_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a, b, c) |
|
#define PRINT_MSG0 |
( |
level, |
|
|
msg |
|
) |
ErrorPrint(GZ_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n") |
|
|
General messages. Use level to indicate the message importance
- 0 : important
- 1 : informative
- 2+ : diagnostic All messages are recorded in the log file, but only the more important messages are printed on the console. Use the command line option to dictate which messages will be printed.
|
#define PRINT_MSG1 |
( |
level, |
|
|
msg, |
|
|
a |
|
) |
ErrorPrint(GZ_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a) |
|
#define PRINT_MSG2 |
( |
level, |
|
|
msg, |
|
|
a, |
|
|
b |
|
) |
ErrorPrint(GZ_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b) |
|
#define PRINT_MSG3 |
( |
level, |
|
|
msg, |
|
|
a, |
|
|
b, |
|
|
c |
|
) |
ErrorPrint(GZ_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c) |
|
#define PRINT_MSG4 |
( |
level, |
|
|
msg, |
|
|
a, |
|
|
b, |
|
|
c, |
|
|
d |
|
) |
ErrorPrint(GZ_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c, d) |
|
#define PRINT_MSG5 |
( |
level, |
|
|
msg, |
|
|
a, |
|
|
b, |
|
|
c, |
|
|
d, |
|
|
e |
|
) |
ErrorPrint(GZ_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c, d, e) |
|
#define PRINT_MSG6 |
( |
level, |
|
|
msg, |
|
|
a, |
|
|
b, |
|
|
c, |
|
|
d, |
|
|
e, |
|
|
f |
|
) |
ErrorPrint(GZ_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c, d, e, f) |
|
#define PRINT_MSG7 |
( |
level, |
|
|
msg, |
|
|
a, |
|
|
b, |
|
|
c, |
|
|
d, |
|
|
e, |
|
|
f, |
|
|
g |
|
) |
ErrorPrint(GZ_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c, d, e, f, g) |
|
#define PRINT_GL_ERR |
( |
|
) |
ErrorPrintGL(__FILE__, __LINE__) |
|
Function Documentation
void ErrorInit |
( |
int |
msgLevel, |
|
|
const char * |
logFile = NULL |
|
) |
|
|
|
Initialize error logging.
|
int ErrorPrint |
( |
int |
msgType, |
|
|
int |
level, |
|
|
const char * |
file, |
|
|
int |
line, |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
|
|
|
Function for print and logging errors.
Do not call this function directly; use the macros below. For internal use only.
|
int ErrorPrintGL |
( |
const char * |
file, |
|
|
int |
line |
|
) |
|
|
|
Print GL error messages.
Do not call this function directly; use the macros below. For internal use only.
|
|