posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
XSI_SYSTEM_LOGGING

XSI System Logging option group. More...

syslog() priority codes

void closelog (void)
 Close the connection to the system logger.
 
void openlog (const char *ident, int logopt, int facility)
 Open a connection to the system logger.
 
int setlogmask (int maskpri)
 Set the log priority mask.
 
void syslog (int priority, const char *message,...)
 Write a message to the system logger.
 
void vsyslog (int priority, const char *format, va_list ap)
 Write a message to the system logger (va_list form).
 

openlog() option flags

#define LOG_PID   1
 Include the process ID in each log message.
 
#define LOG_CONS   2
 Log to the system console if the logger is unavailable.
 
#define LOG_NDELAY   4
 Open the connection to the logger immediately.
 
#define LOG_ODELAY   8
 Delay the connection until the first message is sent.
 
#define LOG_NOWAIT   16
 Do not wait for child processes created by logging.
 
#define LOG_PERROR   32
 Also write messages to stderr.
 

Detailed Description

XSI System Logging option group.

Macro Definition Documentation

◆ LOG_CONS

#define LOG_CONS   2

Log to the system console if the logger is unavailable.

Definition at line 25 of file syslog.h.

◆ LOG_NDELAY

#define LOG_NDELAY   4

Open the connection to the logger immediately.

Definition at line 27 of file syslog.h.

◆ LOG_NOWAIT

#define LOG_NOWAIT   16

Do not wait for child processes created by logging.

Definition at line 31 of file syslog.h.

◆ LOG_ODELAY

#define LOG_ODELAY   8

Delay the connection until the first message is sent.

Definition at line 29 of file syslog.h.

◆ LOG_PERROR

#define LOG_PERROR   32

Also write messages to stderr.

Definition at line 33 of file syslog.h.

◆ LOG_PID

#define LOG_PID   1

Include the process ID in each log message.

Definition at line 23 of file syslog.h.

Function Documentation

◆ closelog()

void closelog ( void  )

Close the connection to the system logger.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/closelog.html

◆ openlog()

void openlog ( const char *  ident,
int  logopt,
int  facility 
)

Open a connection to the system logger.

Parameters
identString prepended to each log message; typically the program name.
logoptOR of LOG_* option flags (LOG_PID, LOG_CONS, etc.).
facilityFacility code (LOG_USER, LOG_DAEMON, etc.).
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/openlog.html

◆ setlogmask()

int setlogmask ( int  maskpri)

Set the log priority mask.

Parameters
maskpriNew priority mask (generated with LOG_MASK()).
Returns
The previous log priority mask.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/setlogmask.html

◆ syslog()

void syslog ( int  priority,
const char *  message,
  ... 
)

Write a message to the system logger.

Parameters
priorityPriority code (LOG_EMERG .. LOG_DEBUG).
messageprintf()-style format string.
...Format arguments.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/syslog.html

◆ vsyslog()

void vsyslog ( int  priority,
const char *  format,
va_list  ap 
)

Write a message to the system logger (va_list form).

Parameters
priorityPriority code (LOG_EMERG .. LOG_DEBUG).
formatprintf()-style format string.
apArgument list.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/vsyslog.html