x-lang

← Index

x/sys/syslog

syslog(3)’s line and its send, over Socket’s unix datagram door.

No daemon is needed to build a line: (Syslog line …) is pure but for the zone the time is shown in.

Class Syslog

A line to the system log as syslog(3) sends it: (Syslog send ident facility severity text) builds it and sends it to the log daemon’s socket; (Syslog line …) builds it alone.

%facilities

Static field: data held by Syslog itself, not by its instances.

%severities

Static field: data held by Syslog itself, not by its instances.

%months

Static field: data held by Syslog itself, not by its instances.

(Syslog path)

The log daemon’s socket on this system: /var/run/syslog on Darwin, /dev/log elsewhere.

Returns: STRING — A socket path

(Syslog priority facility severity)

The PRI a line leads with: the facility’s number times eight plus the severity’s. Raises a label ‘value for a name it does not know.

Parameters:

Returns: INTEGER — 0 to 191

(Syslog %two n pad)

n in two characters.

Parameters:

Returns: STRING — Two characters

(Syslog stamp secs)

The time a line carries: local, as “Mmm dd hh:mm:ss” with the day space-padded, as the C libraries write it.

Parameters:

Returns: STRING — 15 characters

(Syslog line ident facility severity text secs pid)

The line syslog(3) sends, without sending it: “Mmm dd hh:mm:ss IDENT[PID]: TEXT".

Parameters:

Returns: STRING — The line

(Syslog send ident facility severity text . where)

Send one line to the log daemon, stamped now with this process’s id. Answers #t, or #f when no daemon is listening there – the caller decides what then.

Parameters:

Returns: BOOL — Whether the line was sent