Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Document syslog(3lua).
details: https://anonhg.NetBSD.org/src/rev/eca1aa116a8b
branches: trunk
changeset: 791331:eca1aa116a8b
user: mbalmer <mbalmer%NetBSD.org@localhost>
date: Wed Nov 13 20:55:08 2013 +0000
description:
Document syslog(3lua).
diffstat:
distrib/sets/lists/man/mi | 5 +-
share/man/man3lua/Makefile | 4 +-
share/man/man3lua/intro.3lua | 8 +-
share/man/man3lua/syslog.3lua | 216 ++++++++++++++++++++++++++++++++++++++++++
4 files changed, 228 insertions(+), 5 deletions(-)
diffs (294 lines):
diff -r 370bc8408835 -r eca1aa116a8b distrib/sets/lists/man/mi
--- a/distrib/sets/lists/man/mi Wed Nov 13 18:46:33 2013 +0000
+++ b/distrib/sets/lists/man/mi Wed Nov 13 20:55:08 2013 +0000
@@ -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
diff -r 370bc8408835 -r eca1aa116a8b share/man/man3lua/Makefile
--- a/share/man/man3lua/Makefile Wed Nov 13 18:46:33 2013 +0000
+++ b/share/man/man3lua/Makefile Wed Nov 13 20:55:08 2013 +0000
@@ -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 \
diff -r 370bc8408835 -r eca1aa116a8b share/man/man3lua/intro.3lua
--- a/share/man/man3lua/intro.3lua Wed Nov 13 18:46:33 2013 +0000
+++ b/share/man/man3lua/intro.3lua Wed Nov 13 20:55:08 2013 +0000
@@ -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 <mbalmer%NetBSD.org@localhost>. 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 @@
Access
.Xr sqlite3 1
files.
+.It Em syslog
+Acces
+.Xr syslog 3
+functionality.
.El
.Sh SEE ALSO
.Xr lua 1 ,
diff -r 370bc8408835 -r eca1aa116a8b share/man/man3lua/syslog.3lua
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man3lua/syslog.3lua Wed Nov 13 20:55:08 2013 +0000
@@ -0,0 +1,216 @@
+.\" $NetBSD: syslog.3lua,v 1.1 2013/11/13 20:55:08 mbalmer Exp $
+.\"
+.\" Copyright (c) 2013 Marc Balmer <mbalmer%NetBSD.org@localhost>. 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 mbalmer%NetBSD.org@localhost .
Home |
Main Index |
Thread Index |
Old Index