Back to index

glibc  2.9
Defines | Functions
syslog.h File Reference
#include <features.h>
#include <stdarg.h>
#include <bits/syslog-path.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define __need___va_list
#define LOG_EMERG   0 /* system is unusable */
#define LOG_ALERT   1 /* action must be taken immediately */
#define LOG_CRIT   2 /* critical conditions */
#define LOG_ERR   3 /* error conditions */
#define LOG_WARNING   4 /* warning conditions */
#define LOG_NOTICE   5 /* normal but significant condition */
#define LOG_INFO   6 /* informational */
#define LOG_DEBUG   7 /* debug-level messages */
#define LOG_PRIMASK   0x07 /* mask to extract priority part (internal) */
#define LOG_PRI(p)   ((p) & LOG_PRIMASK)
#define LOG_MAKEPRI(fac, pri)   (((fac) << 3) | (pri))
#define LOG_KERN   (0<<3) /* kernel messages */
#define LOG_USER   (1<<3) /* random user-level messages */
#define LOG_MAIL   (2<<3) /* mail system */
#define LOG_DAEMON   (3<<3) /* system daemons */
#define LOG_AUTH   (4<<3) /* security/authorization messages */
#define LOG_SYSLOG   (5<<3) /* messages generated internally by syslogd */
#define LOG_LPR   (6<<3) /* line printer subsystem */
#define LOG_NEWS   (7<<3) /* network news subsystem */
#define LOG_UUCP   (8<<3) /* UUCP subsystem */
#define LOG_CRON   (9<<3) /* clock daemon */
#define LOG_AUTHPRIV   (10<<3) /* security/authorization messages (private) */
#define LOG_FTP   (11<<3) /* ftp daemon */
#define LOG_LOCAL0   (16<<3) /* reserved for local use */
#define LOG_LOCAL1   (17<<3) /* reserved for local use */
#define LOG_LOCAL2   (18<<3) /* reserved for local use */
#define LOG_LOCAL3   (19<<3) /* reserved for local use */
#define LOG_LOCAL4   (20<<3) /* reserved for local use */
#define LOG_LOCAL5   (21<<3) /* reserved for local use */
#define LOG_LOCAL6   (22<<3) /* reserved for local use */
#define LOG_LOCAL7   (23<<3) /* reserved for local use */
#define LOG_NFACILITIES   24 /* current number of facilities */
#define LOG_FACMASK   0x03f8 /* mask to extract facility part */
#define LOG_FAC(p)   (((p) & LOG_FACMASK) >> 3)
#define LOG_MASK(pri)   (1 << (pri)) /* mask for one priority */
#define LOG_UPTO(pri)   ((1 << ((pri)+1)) - 1) /* all priorities through pri */
#define LOG_PID   0x01 /* log the pid with each message */
#define LOG_CONS   0x02 /* log on the console if errors in sending */
#define LOG_ODELAY   0x04 /* delay open until first syslog() (default) */
#define LOG_NDELAY   0x08 /* don't delay open */
#define LOG_NOWAIT   0x10 /* don't wait for console forks: DEPRECATED */
#define LOG_PERROR   0x20 /* log to stderr as well */

Functions

__BEGIN_DECLS void closelog (void)
void openlog (__const char *__ident, int __option, int __facility)
int setlogmask (int __mask) __THROW
void syslog (int __pri, __const char *__fmt,...) __attribute__((__format__(__printf__

Define Documentation

Definition at line 36 of file syslog.h.

#define LOG_ALERT   1 /* action must be taken immediately */

Definition at line 52 of file syslog.h.

#define LOG_AUTH   (4<<3) /* security/authorization messages */

Definition at line 97 of file syslog.h.

#define LOG_AUTHPRIV   (10<<3) /* security/authorization messages (private) */

Definition at line 103 of file syslog.h.

#define LOG_CONS   0x02 /* log on the console if errors in sending */

Definition at line 163 of file syslog.h.

#define LOG_CRIT   2 /* critical conditions */

Definition at line 53 of file syslog.h.

#define LOG_CRON   (9<<3) /* clock daemon */

Definition at line 102 of file syslog.h.

#define LOG_DAEMON   (3<<3) /* system daemons */

Definition at line 96 of file syslog.h.

#define LOG_DEBUG   7 /* debug-level messages */

Definition at line 58 of file syslog.h.

#define LOG_EMERG   0 /* system is unusable */

Definition at line 51 of file syslog.h.

#define LOG_ERR   3 /* error conditions */

Definition at line 54 of file syslog.h.

#define LOG_FAC (   p)    (((p) & LOG_FACMASK) >> 3)

Definition at line 119 of file syslog.h.

#define LOG_FACMASK   0x03f8 /* mask to extract facility part */

Definition at line 117 of file syslog.h.

#define LOG_FTP   (11<<3) /* ftp daemon */

Definition at line 104 of file syslog.h.

#define LOG_INFO   6 /* informational */

Definition at line 57 of file syslog.h.

#define LOG_KERN   (0<<3) /* kernel messages */

Definition at line 93 of file syslog.h.

#define LOG_LOCAL0   (16<<3) /* reserved for local use */

Definition at line 107 of file syslog.h.

#define LOG_LOCAL1   (17<<3) /* reserved for local use */

Definition at line 108 of file syslog.h.

#define LOG_LOCAL2   (18<<3) /* reserved for local use */

Definition at line 109 of file syslog.h.

#define LOG_LOCAL3   (19<<3) /* reserved for local use */

Definition at line 110 of file syslog.h.

#define LOG_LOCAL4   (20<<3) /* reserved for local use */

Definition at line 111 of file syslog.h.

#define LOG_LOCAL5   (21<<3) /* reserved for local use */

Definition at line 112 of file syslog.h.

#define LOG_LOCAL6   (22<<3) /* reserved for local use */

Definition at line 113 of file syslog.h.

#define LOG_LOCAL7   (23<<3) /* reserved for local use */

Definition at line 114 of file syslog.h.

#define LOG_LPR   (6<<3) /* line printer subsystem */

Definition at line 99 of file syslog.h.

#define LOG_MAIL   (2<<3) /* mail system */

Definition at line 95 of file syslog.h.

#define LOG_MAKEPRI (   fac,
  pri 
)    (((fac) << 3) | (pri))

Definition at line 63 of file syslog.h.

#define LOG_MASK (   pri)    (1 << (pri)) /* mask for one priority */

Definition at line 153 of file syslog.h.

#define LOG_NDELAY   0x08 /* don't delay open */

Definition at line 165 of file syslog.h.

#define LOG_NEWS   (7<<3) /* network news subsystem */

Definition at line 100 of file syslog.h.

#define LOG_NFACILITIES   24 /* current number of facilities */

Definition at line 116 of file syslog.h.

#define LOG_NOTICE   5 /* normal but significant condition */

Definition at line 56 of file syslog.h.

#define LOG_NOWAIT   0x10 /* don't wait for console forks: DEPRECATED */

Definition at line 166 of file syslog.h.

#define LOG_ODELAY   0x04 /* delay open until first syslog() (default) */

Definition at line 164 of file syslog.h.

#define LOG_PERROR   0x20 /* log to stderr as well */

Definition at line 167 of file syslog.h.

#define LOG_PID   0x01 /* log the pid with each message */

Definition at line 162 of file syslog.h.

#define LOG_PRI (   p)    ((p) & LOG_PRIMASK)

Definition at line 62 of file syslog.h.

#define LOG_PRIMASK   0x07 /* mask to extract priority part (internal) */

Definition at line 60 of file syslog.h.

#define LOG_SYSLOG   (5<<3) /* messages generated internally by syslogd */

Definition at line 98 of file syslog.h.

#define LOG_UPTO (   pri)    ((1 << ((pri)+1)) - 1) /* all priorities through pri */

Definition at line 154 of file syslog.h.

#define LOG_USER   (1<<3) /* random user-level messages */

Definition at line 94 of file syslog.h.

#define LOG_UUCP   (8<<3) /* UUCP subsystem */

Definition at line 101 of file syslog.h.

#define LOG_WARNING   4 /* warning conditions */

Definition at line 55 of file syslog.h.


Function Documentation

__BEGIN_DECLS void closelog ( void  )

Definition at line 441 of file syslog.c.

{
  /* Protect against multiple users and cancellation.  */
  __libc_cleanup_push (cancel_handler, NULL);
  __libc_lock_lock (syslog_lock);

  closelog_internal ();
  LogTag = NULL;
  LogType = SOCK_DGRAM; /* this is the default */

  /* Free the lock.  */
  __libc_cleanup_pop (1);
}

Here is the call graph for this function:

void openlog ( __const char *  __ident,
int  __option,
int  __facility 
)

Here is the caller graph for this function:

int setlogmask ( int  __mask)

Definition at line 457 of file syslog.c.

{
       int omask;

       omask = LogMask;
       if (pmask != 0)
              LogMask = pmask;
       return (omask);
}
void syslog ( int  __pri,
__const char *  __fmt,
  ... 
)