Syslog support functions for Asterisk logging.
More...
Go to the source code of this file.
|
#define | ASTNUMLOGLEVELS 32 |
|
Syslog support functions for Asterisk logging.
Definition in file syslog.h.
int ast_syslog_facility |
( |
const char * |
facility | ) |
|
Maps a syslog facility name from a string to a syslog facility constant.
- Since
- 1.8
- Parameters
-
facility | Facility name to map (i.e. "daemon") |
- Return values
-
syslog | facility constant (i.e. LOG_DAEMON) if found |
-1 | if facility is not found |
Definition at line 85 of file syslog.c.
89 for (index = 0; index < ARRAY_LEN(facility_map); index++) {
90 if (!strcasecmp(facility_map[index].name, facility)) {
91 return facility_map[index].value;
const char* ast_syslog_facility_name |
( |
int |
facility | ) |
|
Maps a syslog facility constant to a string.
- Since
- 1.8
- Parameters
-
facility | syslog facility constant to map (i.e. LOG_DAEMON) |
- Return values
-
facility | name (i.e. "daemon") if found |
NULL | if facility is not found |
Definition at line 98 of file syslog.c.
102 for (index = 0; index < ARRAY_LEN(facility_map); index++) {
103 if (facility_map[index].value == facility) {
104 return facility_map[index].name;
int ast_syslog_priority |
( |
const char * |
priority | ) |
|
Maps a syslog priority name from a string to a syslog priority constant.
- Since
- 1.8
- Parameters
-
priority | Priority name to map (i.e. "notice") |
- Return values
-
syslog | priority constant (i.e. LOG_NOTICE) if found |
-1 | if priority is not found |
Definition at line 126 of file syslog.c.
130 for (index = 0; index < ARRAY_LEN(priority_map); index++) {
131 if (!strcasecmp(priority_map[index].name, priority)) {
132 return priority_map[index].value;
int ast_syslog_priority_from_loglevel |
( |
int |
level | ) |
|
Maps an Asterisk log level (i.e. LOG_ERROR) to a syslog priority constant.
- Since
- 1.8
- Parameters
-
level | Asterisk log level constant (i.e. LOG_ERROR) |
- Return values
-
syslog | priority constant (i.e. LOG_ERR) if found |
-1 | if priority is not found |
Definition at line 162 of file syslog.c.
Referenced by logger_print_normal().
167 if (level >= 16 && level < ASTNUMLOGLEVELS) {
171 if (level < 0 || level >= ARRAY_LEN(logger_level_to_syslog_map)) {
175 return logger_level_to_syslog_map[level];
const char* ast_syslog_priority_name |
( |
int |
priority | ) |
|
Maps a syslog priority constant to a string.
- Since
- 1.8
- Parameters
-
priority | syslog priority constant to map (i.e. LOG_NOTICE) |
- Return values
-
priority | name (i.e. "notice") if found |
NULL | if priority is not found |
Definition at line 139 of file syslog.c.
143 for (index = 0; index < ARRAY_LEN(priority_map); index++) {
144 if (priority_map[index].value == priority) {
145 return priority_map[index].name;