stumpless 2.2.0
|
Severity codes for classifying log entries. 更多...
宏定义 | |
#define | STUMPLESS_SEVERITY_MASK(SEVERITY) ( LOG_MASK( SEVERITY ) ) |
Creates a severity mask for the provided severity. | |
#define | STUMPLESS_SEVERITY_MASK_UPTO(SEVERITY) ( LOG_UPTO( SEVERITY ) ) |
Creates a severity mask from EMERG up to the provided severity. | |
#define | STUMPLESS_SEVERITY_EMERG_VALUE LOG_EMERG |
Severity code value for EMERG log entries. | |
#define | STUMPLESS_SEVERITY_ALERT_VALUE LOG_ALERT |
Severity code value for ALERT log entries. | |
#define | STUMPLESS_SEVERITY_CRIT_VALUE LOG_CRIT |
Severity code value for CRIT log entries. | |
#define | STUMPLESS_SEVERITY_ERR_VALUE LOG_ERR |
Severity code value for ERR log entries. | |
#define | STUMPLESS_SEVERITY_WARNING_VALUE LOG_WARNING |
Severity code value for WARNING log entries. | |
#define | STUMPLESS_SEVERITY_NOTICE_VALUE LOG_NOTICE |
Severity code value for NOTICE log entries. | |
#define | STUMPLESS_SEVERITY_INFO_VALUE LOG_INFO |
Severity code value for INFO log entries. | |
#define | STUMPLESS_SEVERITY_DEBUG_VALUE LOG_DEBUG |
Severity code value for DEBUG log entries. | |
#define | STUMPLESS_SEVERITY_TRACE_VALUE STUMPLESS_SEVERITY_DEBUG_VALUE |
Equivalent to the DEBUG severity code value. | |
#define | STUMPLESS_FOREACH_SEVERITY(ACTION) |
A macro function that runs the provided action once for each severity, providing the symbol and value. | |
#define | STUMPLESS_SEVERITY_TRACE STUMPLESS_SEVERITY_DEBUG |
Equivalent to the DEBUG severity. | |
枚举 | |
enum | stumpless_severity { STUMPLESS_GENERATE_ENUM =( STUMPLESS_SEVERITY_EMERG, LOG_EMERG ) STUMPLESS_GENERATE_ENUM( STUMPLESS_SEVERITY_ALERT, LOG_ALERT ) STUMPLESS_GENERATE_ENUM( STUMPLESS_SEVERITY_CRIT, LOG_CRIT ) STUMPLESS_GENERATE_ENUM( STUMPLESS_SEVERITY_ERR, LOG_ERR ) STUMPLESS_GENERATE_ENUM( STUMPLESS_SEVERITY_WARNING, LOG_WARNING ) STUMPLESS_GENERATE_ENUM( STUMPLESS_SEVERITY_NOTICE, LOG_NOTICE ) STUMPLESS_GENERATE_ENUM( STUMPLESS_SEVERITY_INFO, LOG_INFO ) STUMPLESS_GENERATE_ENUM( STUMPLESS_SEVERITY_DEBUG, LOG_DEBUG ) } |
All possible severity codes available to log entries. 更多... | |
函数 | |
const char * | stumpless_get_severity_string (enum stumpless_severity severity) |
Gets the string representation of the given severity. | |
enum stumpless_severity | stumpless_get_severity_enum (const char *severity_string) |
Gets the enum value corresponding to the given severity string. | |
enum stumpless_severity | stumpless_get_severity_enum_from_buffer (const char *buffer, size_t length) |
Gets the enum value corresponding to the given severity string in a buffer. | |
Severity codes for classifying log entries.
See RFC 5424 section 6.2.1 for details on these values. Severities are defined to be compatible with the syslog.h header if it is found on the system. Otherwise, they are defined as closely as possible to the RFC 5424 specification.
#define STUMPLESS_FOREACH_SEVERITY | ( | ACTION | ) |
A macro function that runs the provided action once for each severity, providing the symbol and value.
The action must take two arguments, the first being the symbol name of the severity, and the second the numeric value of the severity.
#define STUMPLESS_SEVERITY_ALERT_VALUE LOG_ALERT |
Severity code value for ALERT log entries.
#define STUMPLESS_SEVERITY_CRIT_VALUE LOG_CRIT |
Severity code value for CRIT log entries.
#define STUMPLESS_SEVERITY_DEBUG_VALUE LOG_DEBUG |
Severity code value for DEBUG log entries.
#define STUMPLESS_SEVERITY_EMERG_VALUE LOG_EMERG |
Severity code value for EMERG log entries.
#define STUMPLESS_SEVERITY_ERR_VALUE LOG_ERR |
Severity code value for ERR log entries.
#define STUMPLESS_SEVERITY_INFO_VALUE LOG_INFO |
Severity code value for INFO log entries.
#define STUMPLESS_SEVERITY_MASK | ( | SEVERITY | ) | ( LOG_MASK( SEVERITY ) ) |
Creates a severity mask for the provided severity.
#define STUMPLESS_SEVERITY_MASK_UPTO | ( | SEVERITY | ) | ( LOG_UPTO( SEVERITY ) ) |
Creates a severity mask from EMERG up to the provided severity.
#define STUMPLESS_SEVERITY_NOTICE_VALUE LOG_NOTICE |
Severity code value for NOTICE log entries.
#define STUMPLESS_SEVERITY_TRACE STUMPLESS_SEVERITY_DEBUG |
Equivalent to the DEBUG severity.
Trace level messages include extra information, but do not have a distinct severity value in log entries.
#define STUMPLESS_SEVERITY_TRACE_VALUE STUMPLESS_SEVERITY_DEBUG_VALUE |
Equivalent to the DEBUG severity code value.
Trace level messages include extra information, but do not have a distinct severity value in log entries.
#define STUMPLESS_SEVERITY_WARNING_VALUE LOG_WARNING |
Severity code value for WARNING log entries.
enum stumpless_severity |
All possible severity codes available to log entries.
In versions prior to 2.0.0, these values were simply #define symbols. They have been changed to an enum to clearly convey proper usage.
See STUMPLESS_FOREACH_SEVERITY() and STUMPLESS_GENERATE_ENUM() for how the enumeration is actually defined.
枚举值 | |
---|---|
STUMPLESS_GENERATE_ENUM | Emergency: system is unusable. |
enum stumpless_severity stumpless_get_severity_enum | ( | const char * | severity_string | ) |
Gets the enum value corresponding to the given severity string.
Thread Safety: MT-Safe This function is thread safe.
Async Signal Safety: AS-Safe This function is safe to call from signal handlers.
Async Cancel Safety: AC-Safe This function is safe to call from threads that may be asynchronously cancelled.
severity_string | The severity name to get the enum from. |
enum stumpless_severity stumpless_get_severity_enum_from_buffer | ( | const char * | buffer, |
size_t | length ) |
Gets the enum value corresponding to the given severity string in a buffer.
Thread Safety: MT-Safe This function is thread safe.
Async Signal Safety: AS-Safe This function is safe to call from signal handlers.
Async Cancel Safety: AC-Safe This function is safe to call from threads that may be asynchronously cancelled.
buffer | The buffer containing the severity name to get the enum from. |
length | The length of the buffer. |
const char * stumpless_get_severity_string | ( | enum stumpless_severity | severity | ) |
Gets the string representation of the given severity.
This is a string literal that should not be modified or freed by the caller.
Thread Safety: MT-Safe This function is thread safe.
Async Signal Safety: AS-Safe This function is safe to call from signal handlers.
Async Cancel Safety: AC-Safe This function is safe to call from threads that may be asynchronously cancelled.
severity | The severity to get the string from. |