stumpless 2.2.0
载入中...
搜索中...
未找到
severity.h 文件参考

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.

宏定义说明

◆ STUMPLESS_FOREACH_SEVERITY

#define STUMPLESS_FOREACH_SEVERITY ( ACTION)
值:
\
ACTION( STUMPLESS_SEVERITY_EMERG, STUMPLESS_SEVERITY_EMERG_VALUE ) \
\
ACTION( STUMPLESS_SEVERITY_ALERT, STUMPLESS_SEVERITY_ALERT_VALUE ) \
\
ACTION( STUMPLESS_SEVERITY_CRIT, STUMPLESS_SEVERITY_CRIT_VALUE ) \
\
ACTION( STUMPLESS_SEVERITY_ERR, STUMPLESS_SEVERITY_ERR_VALUE ) \
\
ACTION( STUMPLESS_SEVERITY_WARNING, STUMPLESS_SEVERITY_WARNING_VALUE ) \
\
ACTION( STUMPLESS_SEVERITY_NOTICE, STUMPLESS_SEVERITY_NOTICE_VALUE ) \
\
ACTION( STUMPLESS_SEVERITY_INFO, STUMPLESS_SEVERITY_INFO_VALUE ) \
\
ACTION( STUMPLESS_SEVERITY_DEBUG, STUMPLESS_SEVERITY_DEBUG_VALUE )
#define STUMPLESS_SEVERITY_INFO_VALUE
Severity code value for INFO log entries.
定义 severity.h:124
#define STUMPLESS_SEVERITY_WARNING_VALUE
Severity code value for WARNING log entries.
定义 severity.h:102
#define STUMPLESS_SEVERITY_NOTICE_VALUE
Severity code value for NOTICE log entries.
定义 severity.h:113
#define STUMPLESS_SEVERITY_EMERG_VALUE
Severity code value for EMERG log entries.
定义 severity.h:58
#define STUMPLESS_SEVERITY_DEBUG_VALUE
Severity code value for DEBUG log entries.
定义 severity.h:135
#define STUMPLESS_SEVERITY_ERR_VALUE
Severity code value for ERR log entries.
定义 severity.h:91
#define STUMPLESS_SEVERITY_ALERT_VALUE
Severity code value for ALERT log entries.
定义 severity.h:69
#define STUMPLESS_SEVERITY_CRIT_VALUE
Severity code value for CRIT log entries.
定义 severity.h:80

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.

自从
release v2.0.0.

◆ STUMPLESS_SEVERITY_ALERT_VALUE

#define STUMPLESS_SEVERITY_ALERT_VALUE   LOG_ALERT

Severity code value for ALERT log entries.

自从
release v2.0.0.

◆ STUMPLESS_SEVERITY_CRIT_VALUE

#define STUMPLESS_SEVERITY_CRIT_VALUE   LOG_CRIT

Severity code value for CRIT log entries.

自从
release v2.0.0.

◆ STUMPLESS_SEVERITY_DEBUG_VALUE

#define STUMPLESS_SEVERITY_DEBUG_VALUE   LOG_DEBUG

Severity code value for DEBUG log entries.

自从
release v2.0.0.

◆ STUMPLESS_SEVERITY_EMERG_VALUE

#define STUMPLESS_SEVERITY_EMERG_VALUE   LOG_EMERG

Severity code value for EMERG log entries.

自从
release v2.0.0.

◆ STUMPLESS_SEVERITY_ERR_VALUE

#define STUMPLESS_SEVERITY_ERR_VALUE   LOG_ERR

Severity code value for ERR log entries.

自从
release v2.0.0.

◆ STUMPLESS_SEVERITY_INFO_VALUE

#define STUMPLESS_SEVERITY_INFO_VALUE   LOG_INFO

Severity code value for INFO log entries.

自从
release v2.0.0.

◆ STUMPLESS_SEVERITY_MASK

#define STUMPLESS_SEVERITY_MASK ( SEVERITY)    ( LOG_MASK( SEVERITY ) )

Creates a severity mask for the provided severity.

◆ STUMPLESS_SEVERITY_MASK_UPTO

#define STUMPLESS_SEVERITY_MASK_UPTO ( SEVERITY)    ( LOG_UPTO( SEVERITY ) )

Creates a severity mask from EMERG up to the provided severity.

◆ STUMPLESS_SEVERITY_NOTICE_VALUE

#define STUMPLESS_SEVERITY_NOTICE_VALUE   LOG_NOTICE

Severity code value for NOTICE log entries.

自从
release v2.0.0.

◆ STUMPLESS_SEVERITY_TRACE

#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.

自从
release v2.1.0

◆ STUMPLESS_SEVERITY_TRACE_VALUE

#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.

自从
release v2.1.0

◆ STUMPLESS_SEVERITY_WARNING_VALUE

#define STUMPLESS_SEVERITY_WARNING_VALUE   LOG_WARNING

Severity code value for WARNING log entries.

自从
release v2.0.0.

枚举类型说明

◆ 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.

自从
release v2.0.0.
枚举值
STUMPLESS_GENERATE_ENUM 

Emergency: system is unusable.

函数说明

◆ stumpless_get_severity_enum()

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.

自从
release v2.1.0.
参数
severity_stringThe severity name to get the enum from.
返回
The enum integer corresponding to the given severity or -1 if the string is not a valid severity name.

◆ stumpless_get_severity_enum_from_buffer()

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.

自从
release v2.2.0.
参数
bufferThe buffer containing the severity name to get the enum from.
lengthThe length of the buffer.
返回
The enum integer corresponding to the given severity or -1 if the string is not a valid severity name.

◆ stumpless_get_severity_string()

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.

参数
severityThe severity to get the string from.
返回
The string representation of the given severity.