Defines | |
| #define | LOG_FTP (11 << 3) |
| #define | LOG_MASK(pri) (1 << (pri)) |
| Converts a priority definition for use in setlogmask(). | |
Priorities for syslog(), log_team() and log_thread() | |
| #define | LOG_ALERT 1 |
| A condition to that should be corrected immediately. | |
| #define | LOG_CRIT 2 |
| Critical conditions like hard drive errors. | |
| #define | LOG_DEBUG 7 |
| Debug information. | |
| #define | LOG_EMERG 0 |
| A panic condition. | |
| #define | LOG_ERR 3 |
| Errors. | |
| #define | LOG_INFO 6 |
| Information, like versions and so. | |
| #define | LOG_NOTICE 5 |
| Notices, instructions on how to use certain configuration options. | |
| #define | LOG_PANIC LOG_EMERG |
| An alias for LOG_EMERG. | |
| #define | LOG_WARNING 4 |
| Warnings. | |
Facilities for openlog() | |
| #define | LOG_AUTH (4 << 3) |
| Standard POSIX facility(?) for messages by the authentication services. | |
| #define | LOG_AUTHPRIV (10 << 3) |
| Reserved for private (?) messages that relate to authentication. | |
| #define | LOG_CRON (9 << 3) |
| Reserved for messages generated by the CRON daemon. | |
| #define | LOG_DAEMON (3 << 3) |
| Standard POSIX (?) facility for messages by daemons (and Haiku servers). | |
| #define | LOG_KERN (0 << 3) |
| Reserved for messages generated by the kernel. | |
| #define | LOG_LOCAL0 (16 << 3) |
| Use this for local use. | |
| #define | LOG_LOCAL1 (17 << 3) |
| Use this for local use. | |
| #define | LOG_LOCAL2 (18 << 3) |
| Use this for local use. | |
| #define | LOG_LOCAL3 (19 << 3) |
| Use this for local use. | |
| #define | LOG_LOCAL4 (20 << 3) |
| Use this for local use. | |
| #define | LOG_LOCAL5 (21 << 3) |
| Use this for local use. | |
| #define | LOG_LOCAL6 (22 << 3) |
| Use this for local use. | |
| #define | LOG_LOCAL7 (23 << 3) |
| Use this for local use. | |
| #define | LOG_LPR (6 << 3) |
| Reserved for messages generated by the UNIX lpr printing tool. | |
| #define | LOG_MAIL (2 << 3) |
| Standard (?) POSIX facility for messages by the mailing daemon. | |
| #define | LOG_NEWS (7 << 3) |
| Reserved for messages generated by something UNIXy that does something with NEWS. | |
| #define | LOG_SYSLOG (5 << 3) |
| Reserved for messages generated by the syslog daemon. | |
| #define | LOG_USER (1 << 3) |
| Reserved for messages generated by user processes. | |
| #define | LOG_UUCP (8 << 3) |
| Reserved for messages generated by UUCP. | |
Options for openlog() | |
| #define | LOG_CONS (2 << 12) |
| Log to the system console on error. | |
| #define | LOG_NDELAY (8 << 12) |
| Connect to the syslog daemon immediately. | |
| #define | LOG_NOWAIT (64 << 12) |
| Do not wait for child processes. | |
| #define | LOG_ODELAY (4 << 12) |
| Delay open until syslog() is called. | |
| #define | LOG_PERROR (32 << 12) |
| Dump to stderr as well. | |
| #define | LOG_PID (1 << 12) |
| Log the process (thread/team) ID with each message. | |
| #define | LOG_SERIAL (16 << 12) |
| Dump to serial output as well. | |
Functions | |
| void | closelog (void) |
| Closes the current log session. | |
| void | closelog_team (void) |
| Closes the log. | |
| void | closelog_thread (void) |
| Closes the log. | |
| void | log_team (int priority, const char *message,...) |
| sends a message to the system log | |
| void | log_thread (int priority, const char *message,...) |
| sends a message to the system log | |
| void | openlog (const char *ident, int options, int facility) |
| Starts a log session, and sets some output options. | |
| void | openlog_team (const char *ident, int logopt, int facility) |
| Starts a log session, and sets some output options. | |
| void | openlog_thread (const char *ident, int logopt, int facility) |
| Starts a log session, and sets some output options. | |
| int | setlogmask (int priorityMask) |
| sets the logging priority mask | |
| int | setlogmask_team (int priorityMask) |
| sets the logging priority mask | |
| int | setlogmask_thread (int priorityMask) |
| sets the logging priority mask | |
| void | syslog (int priority, const char *message,...) |
| sends a message to the system log | |
| void | vsyslog (int priority, const char *message, va_list args) |
The functions described here are interacting with the syslog_daemon, a server that provides the system logging capabilities. The log can be found in /var/log/syslog.
| #define LOG_SERIAL (16 << 12) |
Dump to serial output as well.
| void openlog | ( | const char * | ident, | |
| int | options, | |||
| int | facility | |||
| ) |
Starts a log session, and sets some output options.
Like openlog_thread() this function defines the log session in thread context; the global options set by openlog_team() are not affected by this function.
| void openlog_team | ( | const char * | ident, | |
| int | logopt, | |||
| int | facility | |||
| ) |
Starts a log session, and sets some output options.
This function defines the team-wide logging options. Thread local sessions started with openlog() or openlog_thread() will inherit the options of the global session.