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

Facility codes for classifying log entries. 更多...

浏览该文件的源代码.

宏定义

#define STUMPLESS_FACILITY_KERN_VALUE   LOG_KERN
 Kernel message facility code value.
 
#define STUMPLESS_FACILITY_USER_VALUE   LOG_USER
 User-level message facility code value.
 
#define STUMPLESS_FACILITY_MAIL_VALUE   LOG_MAIL
 Mail system facility code value.
 
#define STUMPLESS_FACILITY_DAEMON_VALUE   LOG_DAEMON
 System daemons facility code value.
 
#define STUMPLESS_FACILITY_AUTH_VALUE   LOG_AUTH
 Facility code value for security/authorization messages.
 
#define STUMPLESS_FACILITY_SYSLOG_VALUE   ( 5 << 3 )
 Facility code value for messages generated internally by the logging daemon as defined by RFC 5424.
 
#define STUMPLESS_FACILITY_LPR_VALUE   LOG_LPR
 Line printer subsystem facility code value.
 
#define STUMPLESS_FACILITY_NEWS_VALUE   LOG_NEWS
 Network news subsystem facility code value.
 
#define STUMPLESS_FACILITY_UUCP_VALUE   LOG_UUCP
 UUCP subsystem facility code value.
 
#define STUMPLESS_FACILITY_CRON_VALUE   LOG_CRON
 Clock daemon facility code value.
 
#define STUMPLESS_FACILITY_AUTH2_VALUE   ( 10 << 3 )
 Security/authorization messages facility code value as defined by RFC 5424.
 
#define STUMPLESS_FACILITY_FTP_VALUE   ( 11 << 3 )
 FTP daemon facility code value as defined by RFC 5424.
 
#define STUMPLESS_FACILITY_NTP_VALUE   ( 12 << 3 )
 NTP subsystem facility code value as defined by RFC 5424.
 
#define STUMPLESS_FACILITY_AUDIT_VALUE   ( 13 << 3 )
 Log audit facility code value as defined by RFC 5424.
 
#define STUMPLESS_FACILITY_ALERT_VALUE   ( 14 << 3 )
 Log alert facility code value as defined by RFC 5424.
 
#define STUMPLESS_FACILITY_CRON2_VALUE   ( 15 << 3 )
 Clock daemon facility code value as defined by RFC 5424.
 
#define STUMPLESS_FACILITY_LOCAL0_VALUE   LOG_LOCAL0
 Local use 0 facility code value.
 
#define STUMPLESS_FACILITY_LOCAL1_VALUE   LOG_LOCAL1
 Local use 1 facility code value.
 
#define STUMPLESS_FACILITY_LOCAL2_VALUE   LOG_LOCAL2
 Local use 2 facility code value.
 
#define STUMPLESS_FACILITY_LOCAL3_VALUE   LOG_LOCAL3
 Local use 3 facility code value.
 
#define STUMPLESS_FACILITY_LOCAL4_VALUE   LOG_LOCAL4
 Local use 4 facility code value.
 
#define STUMPLESS_FACILITY_LOCAL5_VALUE   LOG_LOCAL5
 Local use 5 facility code value.
 
#define STUMPLESS_FACILITY_LOCAL6_VALUE   LOG_LOCAL6
 Local use 6 facility code value.
 
#define STUMPLESS_FACILITY_LOCAL7_VALUE   LOG_LOCAL7
 Local use 7 facility code value.
 
#define STUMPLESS_FOREACH_FACILITY(ACTION)
 A macro function that runs the provided action once for each facility, providing the symbol and value.
 

枚举

enum  stumpless_facility { STUMPLESS_GENERATE_ENUM =( STUMPLESS_FACILITY_KERN, LOG_KERN ) STUMPLESS_GENERATE_ENUM( STUMPLESS_FACILITY_USER, LOG_USER ) STUMPLESS_GENERATE_ENUM( STUMPLESS_FACILITY_MAIL, LOG_MAIL ) STUMPLESS_GENERATE_ENUM( STUMPLESS_FACILITY_DAEMON, LOG_DAEMON ) STUMPLESS_GENERATE_ENUM( STUMPLESS_FACILITY_AUTH, LOG_AUTH ) STUMPLESS_GENERATE_ENUM( STUMPLESS_FACILITY_SYSLOG, ( 5 << 3 ) ) STUMPLESS_GENERATE_ENUM( STUMPLESS_FACILITY_LPR, LOG_LPR ) STUMPLESS_GENERATE_ENUM( STUMPLESS_FACILITY_NEWS, LOG_NEWS ) STUMPLESS_GENERATE_ENUM( STUMPLESS_FACILITY_UUCP, LOG_UUCP ) STUMPLESS_GENERATE_ENUM( STUMPLESS_FACILITY_CRON, LOG_CRON ) STUMPLESS_GENERATE_ENUM( STUMPLESS_FACILITY_AUTH2, ( 10 << 3 ) ) STUMPLESS_GENERATE_ENUM( STUMPLESS_FACILITY_FTP, ( 11 << 3 ) ) STUMPLESS_GENERATE_ENUM( STUMPLESS_FACILITY_NTP, ( 12 << 3 ) ) STUMPLESS_GENERATE_ENUM( STUMPLESS_FACILITY_AUDIT, ( 13 << 3 ) ) STUMPLESS_GENERATE_ENUM( STUMPLESS_FACILITY_ALERT, ( 14 << 3 ) ) STUMPLESS_GENERATE_ENUM( STUMPLESS_FACILITY_CRON2, ( 15 << 3 ) ) STUMPLESS_GENERATE_ENUM( STUMPLESS_FACILITY_LOCAL0, LOG_LOCAL0 ) STUMPLESS_GENERATE_ENUM( STUMPLESS_FACILITY_LOCAL1, LOG_LOCAL1 ) STUMPLESS_GENERATE_ENUM( STUMPLESS_FACILITY_LOCAL2, LOG_LOCAL2 ) STUMPLESS_GENERATE_ENUM( STUMPLESS_FACILITY_LOCAL3, LOG_LOCAL3 ) STUMPLESS_GENERATE_ENUM( STUMPLESS_FACILITY_LOCAL4, LOG_LOCAL4 ) STUMPLESS_GENERATE_ENUM( STUMPLESS_FACILITY_LOCAL5, LOG_LOCAL5 ) STUMPLESS_GENERATE_ENUM( STUMPLESS_FACILITY_LOCAL6, LOG_LOCAL6 ) STUMPLESS_GENERATE_ENUM( STUMPLESS_FACILITY_LOCAL7, LOG_LOCAL7 ) }
 All possible facility codes available to log entries. 更多...
 

函数

const char * stumpless_get_facility_string (enum stumpless_facility facility)
 Gets the string representation of the given facility.
 
enum stumpless_facility stumpless_get_facility_enum (const char *facility_string)
 Gets the enum value corresponding to the given facility string.
 
enum stumpless_facility stumpless_get_facility_enum_from_buffer (const char *facility_string, size_t facility_buffer_length)
 Gets the enum value corresponding to the given facility string.
 

详细描述

Facility codes for classifying log entries.

See RFC 5424 section 6.2.1 for details on these values. The underlying values of facilities 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 5425 specification. Some facilities do not exist in the syslog.h header and as such are always defined according to the RFC.

宏定义说明

◆ STUMPLESS_FACILITY_ALERT_VALUE

#define STUMPLESS_FACILITY_ALERT_VALUE   ( 14 << 3 )

Log alert facility code value as defined by RFC 5424.

自从
release v2.0.0.

◆ STUMPLESS_FACILITY_AUDIT_VALUE

#define STUMPLESS_FACILITY_AUDIT_VALUE   ( 13 << 3 )

Log audit facility code value as defined by RFC 5424.

自从
release v2.0.0.

◆ STUMPLESS_FACILITY_AUTH2_VALUE

#define STUMPLESS_FACILITY_AUTH2_VALUE   ( 10 << 3 )

Security/authorization messages facility code value as defined by RFC 5424.

自从
release v2.0.0.

◆ STUMPLESS_FACILITY_AUTH_VALUE

#define STUMPLESS_FACILITY_AUTH_VALUE   LOG_AUTH

Facility code value for security/authorization messages.

自从
release v2.0.0.

◆ STUMPLESS_FACILITY_CRON2_VALUE

#define STUMPLESS_FACILITY_CRON2_VALUE   ( 15 << 3 )

Clock daemon facility code value as defined by RFC 5424.

自从
release v2.0.0.

◆ STUMPLESS_FACILITY_CRON_VALUE

#define STUMPLESS_FACILITY_CRON_VALUE   LOG_CRON

Clock daemon facility code value.

自从
release v2.0.0.

◆ STUMPLESS_FACILITY_DAEMON_VALUE

#define STUMPLESS_FACILITY_DAEMON_VALUE   LOG_DAEMON

System daemons facility code value.

自从
release v2.0.0.

◆ STUMPLESS_FACILITY_FTP_VALUE

#define STUMPLESS_FACILITY_FTP_VALUE   ( 11 << 3 )

FTP daemon facility code value as defined by RFC 5424.

自从
release v2.0.0.

◆ STUMPLESS_FACILITY_KERN_VALUE

#define STUMPLESS_FACILITY_KERN_VALUE   LOG_KERN

Kernel message facility code value.

自从
release v2.0.0.

◆ STUMPLESS_FACILITY_LOCAL0_VALUE

#define STUMPLESS_FACILITY_LOCAL0_VALUE   LOG_LOCAL0

Local use 0 facility code value.

自从
release v2.0.0.

◆ STUMPLESS_FACILITY_LOCAL1_VALUE

#define STUMPLESS_FACILITY_LOCAL1_VALUE   LOG_LOCAL1

Local use 1 facility code value.

自从
release v2.0.0.

◆ STUMPLESS_FACILITY_LOCAL2_VALUE

#define STUMPLESS_FACILITY_LOCAL2_VALUE   LOG_LOCAL2

Local use 2 facility code value.

自从
release v2.0.0.

◆ STUMPLESS_FACILITY_LOCAL3_VALUE

#define STUMPLESS_FACILITY_LOCAL3_VALUE   LOG_LOCAL3

Local use 3 facility code value.

自从
release v2.0.0.

◆ STUMPLESS_FACILITY_LOCAL4_VALUE

#define STUMPLESS_FACILITY_LOCAL4_VALUE   LOG_LOCAL4

Local use 4 facility code value.

自从
release v2.0.0.

◆ STUMPLESS_FACILITY_LOCAL5_VALUE

#define STUMPLESS_FACILITY_LOCAL5_VALUE   LOG_LOCAL5

Local use 5 facility code value.

自从
release v2.0.0.

◆ STUMPLESS_FACILITY_LOCAL6_VALUE

#define STUMPLESS_FACILITY_LOCAL6_VALUE   LOG_LOCAL6

Local use 6 facility code value.

自从
release v2.0.0.

◆ STUMPLESS_FACILITY_LOCAL7_VALUE

#define STUMPLESS_FACILITY_LOCAL7_VALUE   LOG_LOCAL7

Local use 7 facility code value.

自从
release v2.0.0.

◆ STUMPLESS_FACILITY_LPR_VALUE

#define STUMPLESS_FACILITY_LPR_VALUE   LOG_LPR

Line printer subsystem facility code value.

自从
release v2.0.0.

◆ STUMPLESS_FACILITY_MAIL_VALUE

#define STUMPLESS_FACILITY_MAIL_VALUE   LOG_MAIL

Mail system facility code value.

自从
release v2.0.0.

◆ STUMPLESS_FACILITY_NEWS_VALUE

#define STUMPLESS_FACILITY_NEWS_VALUE   LOG_NEWS

Network news subsystem facility code value.

自从
release v2.0.0.

◆ STUMPLESS_FACILITY_NTP_VALUE

#define STUMPLESS_FACILITY_NTP_VALUE   ( 12 << 3 )

NTP subsystem facility code value as defined by RFC 5424.

自从
release v2.0.0.

◆ STUMPLESS_FACILITY_SYSLOG_VALUE

#define STUMPLESS_FACILITY_SYSLOG_VALUE   ( 5 << 3 )

Facility code value for messages generated internally by the logging daemon as defined by RFC 5424.

自从
release v2.0.0.

◆ STUMPLESS_FACILITY_USER_VALUE

#define STUMPLESS_FACILITY_USER_VALUE   LOG_USER

User-level message facility code value.

自从
release v2.0.0.

◆ STUMPLESS_FACILITY_UUCP_VALUE

#define STUMPLESS_FACILITY_UUCP_VALUE   LOG_UUCP

UUCP subsystem facility code value.

自从
release v2.0.0.

◆ STUMPLESS_FOREACH_FACILITY

#define STUMPLESS_FOREACH_FACILITY ( ACTION)

A macro function that runs the provided action once for each facility, providing the symbol and value.

The action must take two arguments, the first being the symbol name of the facility, and the second the numeric value of the facility.

自从
release v2.0.0.

枚举类型说明

◆ stumpless_facility

All possible facility 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.

自从
release v2.0.0.
枚举值
STUMPLESS_GENERATE_ENUM 

Kernel messages.

函数说明

◆ stumpless_get_facility_enum()

enum stumpless_facility stumpless_get_facility_enum ( const char * facility_string)

Gets the enum value corresponding to the given facility 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.
参数
facility_stringThe facility name to get the enum from.
返回
The enum integer corresponding to the given facility or -1 if the string is not a valid facility name.

◆ stumpless_get_facility_enum_from_buffer()

enum stumpless_facility stumpless_get_facility_enum_from_buffer ( const char * facility_string,
size_t facility_buffer_length )

Gets the enum value corresponding to the given facility 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.2.0.
参数
facility_stringThe facility name to get the enum from.
facility_buffer_lengthThe length of the buffer
返回
The enum integer corresponding to the given facility or -1 if the string is not a valid facility name.

◆ stumpless_get_facility_string()

const char * stumpless_get_facility_string ( enum stumpless_facility facility)

Gets the string representation of the given facility.

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.

自从
release v2.1.0.
参数
facilityThe facility to get the string from.
返回
The string representation of the given facility.