Module Name: src
Committed By: mbalmer
Date: Wed Nov 13 20:55:08 UTC 2013
Modified Files:
src/distrib/sets/lists/man: mi
src/share/man/man3lua: Makefile intro.3lua
Added Files:
src/share/man/man3lua: syslog.3lua
Log Message:
Document syslog(3lua).
To generate a diff of this commit:
cvs rdiff -u -r1.1449 -r1.1450 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.3 -r1.4 src/share/man/man3lua/Makefile \
src/share/man/man3lua/intro.3lua
cvs rdiff -u -r0 -r1.1 src/share/man/man3lua/syslog.3lua
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1449 src/distrib/sets/lists/man/mi:1.1450
--- src/distrib/sets/lists/man/mi:1.1449 Tue Nov 12 21:58:37 2013
+++ src/distrib/sets/lists/man/mi Wed Nov 13 20:55:08 2013
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1449 2013/11/12 21:58:37 pettai Exp $
+# $NetBSD: mi,v 1.1450 2013/11/13 20:55:08 mbalmer Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -650,6 +650,7 @@
./usr/share/man/cat3lua/gpio.write.0 man-sys-catman .cat
./usr/share/man/cat3lua/intro.0 man-sys-catman .cat
./usr/share/man/cat3lua/sqlite.0 man-sys-catman .cat
+./usr/share/man/cat3lua/syslog.0 man-sys-catman .cat
./usr/share/man/cat4/aac.0 man-sys-catman .cat
./usr/share/man/cat4/ac97.0 man-sys-catman .cat
./usr/share/man/cat4/acardide.0 man-sys-catman .cat
@@ -3698,6 +3699,7 @@
./usr/share/man/html3lua/gpio.write.html man-sys-htmlman html
./usr/share/man/html3lua/intro.html man-sys-htmlman html
./usr/share/man/html3lua/sqlite.html man-sys-htmlman html
+./usr/share/man/html3lua/syslog.html man-sys-htmlman html
./usr/share/man/html4/aac.html man-sys-htmlman html
./usr/share/man/html4/ac97.html man-sys-htmlman html
./usr/share/man/html4/acardide.html man-sys-htmlman html
@@ -6420,6 +6422,7 @@
./usr/share/man/man3lua/gpio.write.3lua man-sys-man .man
./usr/share/man/man3lua/intro.3lua man-sys-man .man
./usr/share/man/man3lua/sqlite.3lua man-sys-man .man
+./usr/share/man/man3lua/syslog.3lua man-sys-man .man
./usr/share/man/man4/aac.4 man-sys-man .man
./usr/share/man/man4/ac97.4 man-sys-man .man
./usr/share/man/man4/acardide.4 man-sys-man .man
Index: src/share/man/man3lua/Makefile
diff -u src/share/man/man3lua/Makefile:1.3 src/share/man/man3lua/Makefile:1.4
--- src/share/man/man3lua/Makefile:1.3 Sun Oct 27 12:47:54 2013
+++ src/share/man/man3lua/Makefile Wed Nov 13 20:55:08 2013
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.3 2013/10/27 12:47:54 mbalmer Exp $
+# $NetBSD: Makefile,v 1.4 2013/11/13 20:55:08 mbalmer Exp $
-MAN= gpio.3lua intro.3lua sqlite.3lua
+MAN= gpio.3lua intro.3lua sqlite.3lua syslog.3lua
MLINKS+=gpio.3lua gpio.open.3lua \
gpio.3lua gpio.info.3lua \
Index: src/share/man/man3lua/intro.3lua
diff -u src/share/man/man3lua/intro.3lua:1.3 src/share/man/man3lua/intro.3lua:1.4
--- src/share/man/man3lua/intro.3lua:1.3 Mon Nov 4 08:04:18 2013
+++ src/share/man/man3lua/intro.3lua Wed Nov 13 20:55:08 2013
@@ -1,4 +1,4 @@
-.\" $NetBSD: intro.3lua,v 1.3 2013/11/04 08:04:18 mbalmer Exp $
+.\" $NetBSD: intro.3lua,v 1.4 2013/11/13 20:55:08 mbalmer Exp $
.\"
.\" Copyright (c) 2013 Marc Balmer <[email protected]>. All rights reserved.
.\"
@@ -27,7 +27,7 @@
.\" SUCH DAMAGE.
.\"
.\"
-.Dd November 4, 2013
+.Dd November 13, 2013
.Dt INTRO 3lua
.Os
.Sh NAME
@@ -49,6 +49,10 @@ pins.
Access
.Xr sqlite3 1
files.
+.It Em syslog
+Acces
+.Xr syslog 3
+functionality.
.El
.Sh SEE ALSO
.Xr lua 1 ,
Added files:
Index: src/share/man/man3lua/syslog.3lua
diff -u /dev/null src/share/man/man3lua/syslog.3lua:1.1
--- /dev/null Wed Nov 13 20:55:08 2013
+++ src/share/man/man3lua/syslog.3lua Wed Nov 13 20:55:08 2013
@@ -0,0 +1,216 @@
+.\" $NetBSD: syslog.3lua,v 1.1 2013/11/13 20:55:08 mbalmer Exp $
+.\"
+.\" Copyright (c) 2013 Marc Balmer <[email protected]>. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd November 13, 2013
+.Dt SYSLOG 3lua
+.Os
+.Sh NAME
+.Nm syslog
+.Nd access
+.Xr syslog 3
+functionality from Lua
+.Sh SYNOPSIS
+.Cd "require 'syslog'"
+.Pp
+.Bl -tag -width XXXX -compact
+.It Dv syslog.openlog(ident, logopt, facility)
+.It Dv syslog.syslog(priority, message)
+.It Dv syslog.closelog()
+.It Dv oldmask = syslog.setlogmask(maskpri)
+.El
+.Sh DESCRIPTION
+The
+.Nm
+Lua binding provides access to the
+.Xr syslog 3
+funcionality.
+.Pp
+.Bl -tag -width XXXX -compact
+.Pp
+.It Dv syslog.openlog(ident, logopt, facility)
+The syslog.openlog() function provides for more specialized processing of the
+messages sent by syslog.syslog().
+The parameter
+.Ar ident
+is a string that will be prepended to every message.
+The
+.Ar logopt
+argument is a bit field specifying logging options, which is formed
+by adding one or more of the following values:
+.Pp
+.Bl -tag -width XXXX -compact
+.It Dv syslog.LOG_CONS
+If
+.Fn syslog.syslog
+cannot pass the message to syslogd(8) it will attempt to write the
+message to the console (``/dev/console'').
+.Pp
+.It Dv syslog.LOG_NDELAY
+Open the connection to syslogd(8) immediately.
+Normally the open is delayed until the first message is logged.
+Useful for programs that need to manage the order in which file descriptors are
+allocated.
+.Pp
+.It Dv syslog.LOG_PERROR
+Write the message to standard error output as well to the system log.
+.Pp
+.It Dv syslog.LOG_PID
+Log the process id with each message: useful for identifying instantiations of
+daemons.
+(This PID is placed within brackets between the ident and the message.)
+.El
+.Pp
+The facility parameter encodes a default facility to be assigned to all
+messages that do not have an explicit facility encoded:
+.Pp
+.Bl -tag -width XXXX -compact
+.It Dv syslog.LOG_AUTH
+The authorization system: login(1), su(1), getty(8), etc.
+.Pp
+.It Dv syslog.LOG_AUTHPRIV
+The same as LOG_AUTH, but logged to a file readable only by selected
+individuals.
+.Pp
+.It Dv syslog.LOG_CRON
+The cron daemon: cron(8).
+.Pp
+.It Dv syslog.LOG_DAEMON
+System daemons, such as routed(8), that are not provided for explicitly by other
+facilities.
+.Pp
+.It Dv syslog.LOG_FTP
+The file transfer protocol daemon: ftpd(8).
+.Pp
+.It Dv syslog.LOG_KERN
+Messages generated by the kernel.
+These cannot be generated by any user processes.
+.Pp
+.It Dv syslog.LOG_LPR
+The line printer spooling system: lpr(1), lpc(8), lpd(8), etc.
+.Pp
+.It Dv syslog.LOG_MAIL
+The mail system.
+.Pp
+.It Dv syslog.LOG_NEWS
+The network news system.
+.Pp
+.It Dv syslog.LOG_SYSLOG
+Messages generated internally by syslogd(8).
+.Pp
+.It Dv syslog.LOG_USER
+Messages generated by random user processes.
+This is the default facility identifier if none is specified.
+.Pp
+.It Dv syslog.LOG_UUCP
+The uucp system.
+.Pp
+.It Dv syslog.LOG_LOCAL0
+Reserved for local use.
+Similarly for syslog.LOG_LOCAL1 through syslog.LOG_LOCAL7
+.El
+.Pp
+.It Dv syslog.syslog(priority, message)
+The
+.Fn syslog
+function writes
+.Ar message
+to the system message logger.
+The message is then written to the system console, log files, logged-in
+users, or forwarded to other machines as appropriate (see syslogd(8)).
+.Pp
+The
+.Ar message
+is tagged with
+.Ar priority .
+Priorities are encoded as a
+.Ar facility
+and a
+.Ar level .
+The facility describes the part of the system generating the message.
+The level is selected from the following ordered (high to low) list:
+.Pp
+.Bl -tag -width XXXX -compact
+.It Dv syslog.LOG_EMERG
+A panic condition.
+This is normally broadcast to all users.
+.Pp
+.It Dv syslog.LOG_ALERT
+A condition that should be corrected immediately, such as a corrupted system
+database.
+.Pp
+.It Dv syslog.LOG_CRIT
+Critical conditions, e.g., hard device errors.
+.Pp
+.It Dv syslog.LOG_ERR
+Errors.
+.Pp
+.It Dv syslog.LOG_WARNING
+Warning messages.
+.Pp
+.It Dv syslog.LOG_NOTICE
+Conditions that are not error conditions, but should possibly be handled
+specially.
+.Pp
+.It Dv syslog.LOG_INFO
+Informational messages.
+.Pp
+.It Dv syslog.LOG_DEBUG
+Messages that contain information normally of use only when debugging a program.
+.El
+.Pp
+.It Dv syslog.closelog()
+The
+.Fn syslog.closelog
+function can be used to close the log file.
+.Pp
+.It Dv oldmask = syslog.setlogmask(maskpri)
+The
+.Fn setlogmask
+function sets the log priority mask to maskpri and returns the previous mask.
+Calls to
+.Fn syslog
+with a priority not set in maskpri are rejected.
+.El
+.Sh SEE ALSO
+.Xr lua 1 ,
+.Xr luac 1 ,
+.Xr intro 3lua ,
+.Xr syslog 3 ,
+.Xr syslogd 8
+.Sh HISTORY
+A
+.Nm
+Lua binding manual appeared in
+.Nx 7.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+Lua binding was written by
+.An Marc Balmer Aq Mt [email protected] .