
Go to the source code of this file.
Defines | |
| #define | NMXP_LOG_H 1 |
| #define | NMXP_LOG_SET -1 |
| #define | NMXP_LOG_NORM 0 |
| #define | NMXP_LOG_ERR 1 |
| #define | NMXP_LOG_WARN 2 |
| #define | NMXP_LOG_NORM_NO 3 |
| #define | NMXP_LOG_NORM_PKG 4 |
| #define | NMXP_LOG_STR(s) (s == NULL)? "<null>" : s |
| #define | NMXP_LOG_D_NULL 0 |
| #define | NMXP_LOG_D_CHANSTATE 1 |
| #define | NMXP_LOG_D_CHANNEL NMXP_LOG_D_CHANSTATE << 1 |
| #define | NMXP_LOG_D_RAWSTREAM NMXP_LOG_D_CHANSTATE << 2 |
| #define | NMXP_LOG_D_CRC NMXP_LOG_D_CHANSTATE << 3 |
| #define | NMXP_LOG_D_CONNFLOW NMXP_LOG_D_CHANSTATE << 4 |
| #define | NMXP_LOG_D_PACKETMAN NMXP_LOG_D_CHANSTATE << 5 |
| #define | NMXP_LOG_D_EXTRA NMXP_LOG_D_CHANSTATE << 6 |
| #define | NMXP_LOG_D_DATE NMXP_LOG_D_CHANSTATE << 7 |
| #define | NMXP_LOG_D_GAP NMXP_LOG_D_CHANSTATE << 8 |
| #define | NMXP_LOG_D_DOD NMXP_LOG_D_CHANSTATE << 9 |
| #define | NMXP_LOG_D_ANY |
Functions | |
| void | nmxp_log_set_prefix (char *prefix) |
| Add prefix string for logging. | |
| const char * | nmxp_log_version () |
| Print value of PACKAGE_NAME and PACKAGE_VERSION. | |
| void | nmxp_log_init (int(*func_log)(char *), int(*func_log_err)(char *)) |
| Set function pointers for "normal logging" and "error logging". | |
| void | nmxp_log_add (int(*func_log)(char *), int(*func_log_err)(char *)) |
| Add function pointers to "normal logging" and "error_logging". | |
| void | nmxp_log_rem (int(*func_log)(char *), int(*func_log_err)(char *)) |
| Remove function pointers from "normal logging" and "error_logging". | |
| int | nmxp_log_stdout (char *msg) |
| Wrapper for fprintf to stdout and flushing. | |
| int | nmxp_log_stderr (char *msg) |
| Wrapper for fprintf to stderror and flushing. | |
| int | nmxp_log (int level, int verb,...) |
| A generic logging/printing routine. | |
Author: Matteo Quintiliani Istituto Nazionale di Geofisica e Vulcanologia - Italy quintiliani@ingv.it
| #define NMXP_LOG_H 1 |
| #define NMXP_LOG_SET -1 |
normal output with time and package name
| #define NMXP_LOG_NORM 0 |
normal output with time and package name
| #define NMXP_LOG_ERR 1 |
error output with time and package name
| #define NMXP_LOG_WARN 2 |
warning output with time and package name
| #define NMXP_LOG_NORM_NO 3 |
normal output without time and package name
| #define NMXP_LOG_NORM_PKG 4 |
normal output with only package name
| #define NMXP_LOG_STR | ( | s | ) | (s == NULL)? "<null>" : s |
If s is NULL return "<null>", otherwise value of s
| #define NMXP_LOG_D_NULL 0 |
kind of log message
| #define NMXP_LOG_D_CHANSTATE 1 |
| #define NMXP_LOG_D_CHANNEL NMXP_LOG_D_CHANSTATE << 1 |
| #define NMXP_LOG_D_RAWSTREAM NMXP_LOG_D_CHANSTATE << 2 |
| #define NMXP_LOG_D_CRC NMXP_LOG_D_CHANSTATE << 3 |
| #define NMXP_LOG_D_CONNFLOW NMXP_LOG_D_CHANSTATE << 4 |
| #define NMXP_LOG_D_PACKETMAN NMXP_LOG_D_CHANSTATE << 5 |
| #define NMXP_LOG_D_EXTRA NMXP_LOG_D_CHANSTATE << 6 |
| #define NMXP_LOG_D_DATE NMXP_LOG_D_CHANSTATE << 7 |
| #define NMXP_LOG_D_GAP NMXP_LOG_D_CHANSTATE << 8 |
| #define NMXP_LOG_D_DOD NMXP_LOG_D_CHANSTATE << 9 |
| #define NMXP_LOG_D_ANY |
| void nmxp_log_set_prefix | ( | char * | prefix | ) |
Add prefix string for logging.
| prefix | string message |
| const char* nmxp_log_version | ( | ) |
Print value of PACKAGE_NAME and PACKAGE_VERSION.
| void nmxp_log_init | ( | int(*)(char *) | func_log, | |
| int(*)(char *) | func_log_err | |||
| ) |
Set function pointers for "normal logging" and "error logging".
| func_log | Function pointer to the the function for "normal logging" | |
| func_log_err | Function pointer to the the function for "error logging" |
| void nmxp_log_add | ( | int(*)(char *) | func_log, | |
| int(*)(char *) | func_log_err | |||
| ) |
Add function pointers to "normal logging" and "error_logging".
| func_log | Function pointer to the the function for "normal logging" | |
| func_log_err | Function pointer to the the function for "error logging" |
| void nmxp_log_rem | ( | int(*)(char *) | func_log, | |
| int(*)(char *) | func_log_err | |||
| ) |
Remove function pointers from "normal logging" and "error_logging".
| func_log | Function pointer to the the function for "normal logging" | |
| func_log_err | Function pointer to the the function for "error logging" |
| int nmxp_log_stdout | ( | char * | msg | ) |
Wrapper for fprintf to stdout and flushing.
| msg | String message |
| int nmxp_log_stderr | ( | char * | msg | ) |
Wrapper for fprintf to stderror and flushing.
| msg | String message |
| int nmxp_log | ( | int | level, | |
| int | verb, | |||
| ... | ||||
| ) |
A generic logging/printing routine.
This function works in two modes:
| new_verbosity | if using mode 1. | |
| n | the number of characters formatted on success, and a a negative value on error if using mode 2. |
| level | ||
| verb | ||
| ... |
1.5.3