![]() |
Gamma |
Collection of Guile Modules |
Sergey Poznyakoff |
Gamma (split by node): | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
? |
The ‘(gamma syslog)’ module provides bindings for ‘syslog’ functions:
(use-modules ((gamma syslog))) |
Opens a connection to the system logger for Guile program. Arguments have the same meaning as in openlog(3):
Syslog tag: a string that will be prepended to every message.
Flags that control the operation. A logical or (logior
) of
one or more of the following:
Write directly to system console if there is an error while sending to system logger.
Open the connection immediately (normally, the opening is delayed until when the first message is logged).
Don't wait for child processes that may have been created while logging the message.
The converse of ‘LOG_NDELAY’; opening of the connection is
delayed until syslog
is called. This is the default.
Print to stderr as well. This constant may be absent if the underlying implementation does not support it.
Include PID with each message.
Specifies what type of program is logging the message. The facility must be one of:
Example:
(openlog "reader" (logior LOG_PID LOG_CONS) LOG_DAEMON) |
Returns the tag, used in the recent call to openlog
.
Distribute a message via syslogd
. The text supplies
the message text. The prio specifies priority of the
message. Its value must be one of the following:
Example:
(syslog LOG_WARNING "This is a test message") |
The priority argument may also be ‘OR’ed with a facility value, to
override the one set by the openlog
function, e.g.:
(syslog (logior LOG_DAEMON LOG_WARNING) "This is a test message") |
It is common to use the format
function to prepare the value
of the text argument:
(syslog LOG_WARNING (format #f "operation reported: ~A" result)) |
Create a syslog port for the given priority. Syslog port is a special output port such that any writes to it are transferred to the syslog with the given priority. The port is line buffered. For example, the following code:
(set-current-output-port (open-syslog-port LOG_ERR)) (display "A test ") (display "message") (newline) |
results in sending the string ‘A test message’ to the syslog
priority LOG_ERR
.
Return #t
if openlog
was previously called.
Close the logging channel. The use of this function is optional.
Gamma (split by node): | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
? |
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.