Next: gauche.termios
- Terminal control, Previous: gauche.sequence
- Sequence framework, Up: Library modules - Gauche extensions [Contents][Index]
gauche.syslog
- SyslogThis module provides syslog(3) system logger interface.
For the common applications, you might find gauche.logger
module
easier to use (see gauche.logger
- User-level logging). This module is for those
who need direct access to the syslog API.
The procedures are only defined if the underlying system supports them.
[POSIX] {gauche.syslog} Opens a connection to the system logger. A string argument ident is used for the prefix of the log, and usually is the program name. Option is an integer flag to control the behavior of logging, and facility is an integer that specify the type of the program.
The flag for option can be composed by logior
-ing
one or more of the following integer constants:
LOG_CONS
, LOG_NDELAY
, LOG_NOWAIT
,
LOG_ODELAY
, LOG_PERROR
and LOG_PID
.
(Some of the constants may not be defined if the underlying system
doesn’t support them).
The facility argument can be one of the following integer
constants: LOG_AUTH
, LOG_AUTHPRIV
, LOG_CRON
,
LOG_DAEMON
, LOG_FTP
, LOG_KERN
, LOG_LOCAL0
through LOG_LOCAL7
, LOG_LPR
, LOG_MAIL
, LOG_NEWS
,
LOG_SYSLOG
, LOG_USER
and LOG_UUCP
.
(Some of the constants may not be defined if the underlying system
doesn’t support them).
See your system’s manpage of openlog(3) for detail description about these constants.
[POSIX]
{gauche.syslog}
Log the string message. Unlike syslog(3), this procedure doesn’t
do formatting—you can use format
(see Output) to create
a formatted message, or use higher-level routine log-format
(see gauche.logger
- User-level logging).
An integer argument priority can be composed by logior
-ing
one of the facility constants described above and
the level constants: LOG_EMERG
, LOG_ALERT
,
LOG_CRIT
, LOG_ERR
, LOG_WARNING
, LOG_NOTICE
,
LOG_INFO
, LOG_DEBUG
.
[POSIX] {gauche.syslog} Closes the connection to the logging system.
[POSIX]
{gauche.syslog}
Sets the process’s log priority mask that determines which calls to
sys-syslog
may be logged.
An priority mask can be composed by logior
-ing
bitmasks corresponding to the level argument of sys-syslog
.
You can use sys-logmask
below to obtain a bitmask
from the level.
[POSIX]
{gauche.syslog}
Returns an integer bitmask for sys-setlogmask
from
the log level level.
Next: gauche.termios
- Terminal control, Previous: gauche.sequence
- Sequence framework, Up: Library modules - Gauche extensions [Contents][Index]