summaryrefslogtreecommitdiff
path: root/ext/syslog/syslog.txt
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-11-26 12:00:40 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-11-26 12:00:40 +0000
commit09a4937b2fcf883fa57af1dfa5d12f605f812970 (patch)
tree52f67fc28923cedbe81d496f6c735c173ef645dc /ext/syslog/syslog.txt
parent43271e97abb9b70be32aabe5acaa6f087ebb079f (diff)
Import the "syslog" module from the rough ruby project. This module
provides the interface to the UNIX system logger (syslog). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/syslog/syslog.txt')
-rw-r--r--ext/syslog/syslog.txt124
1 files changed, 124 insertions, 0 deletions
diff --git a/ext/syslog/syslog.txt b/ext/syslog/syslog.txt
new file mode 100644
index 0000000000..d9dcfc4315
--- /dev/null
+++ b/ext/syslog/syslog.txt
@@ -0,0 +1,124 @@
+.\" syslog.txt - -*- Indented-Text -*-
+$RoughId: syslog.txt,v 1.15 2001/11/25 21:21:23 knu Exp $
+$Id$
+
+UNIX Syslog extension for Ruby
+Amos Gouaux, University of Texas at Dallas
+<amos+ruby@utdallas.edu>
+&
+Akinori MUSHA
+<knu@ruby-lang.org>
+
+** Syslog(Class)
+
+Superclass: Object
+
+Mix-ins: Syslog::Constants
+
+require 'syslog'
+
+A Simple wrapper for the UNIX syslog system calls that might be handy
+if you're writing a server in Ruby. For the details of the syslog(8)
+architecture and constants, see the syslog(3) manual page of your
+platform.
+
+Class Methods:
+
+ open(ident = $0, logopt = Syslog::LOG_PID | Syslog::LOG_CONS,
+ facility = Syslog::LOG_USER) [{ |syslog| ... }]
+
+ Opens syslog with the given options and returns the singleton
+ object of the Syslog class. If a block is given, calls it
+ with an argument of the object. If syslog is already opened,
+ raises RuntimeError.
+
+ Example:
+ sl = Syslog.open('ftpd', Syslog::LOG_PID | Syslog::LOG_NDELAY,
+ Syslog::LOG_FTP)
+
+ instance
+
+ Returns the singleton object.
+
+ LOG_MASK(pri)
+
+ Creates a mask for one priority.
+
+ LOG_UPTO(pri)
+
+ Creates a mask for all priorities up to pri.
+
+Methods:
+
+ open(ident = $0, logopt = Syslog::LOG_PID | Syslog::LOG_CONS,
+ facility = Syslog::LOG_USER)
+
+ Opens syslog with the given options. If syslog is already
+ opened, raises RuntimeError.
+
+ open!(ident = $0, logopt = Syslog::LOG_PID | Syslog::LOG_CONS,
+ facility = Syslog::LOG_USER)
+ reopen(ident = $0, logopt = Syslog::LOG_PID | Syslog::LOG_CONS,
+ facility = Syslog::LOG_USER)
+
+ Same as open, but does a close first.
+
+ opened?
+
+ Returns true if syslog opened, otherwise false.
+
+ ident
+ options
+ facility
+
+ Returns the parameters given in the last open, respectively.
+ Every call of Syslog::open/Syslog#open resets those values.
+
+ log(pri, message, ...)
+
+ Writes message to syslog.
+
+ Example:
+ sl.log(Syslog::LOG_CRIT, "the sky is falling in %d seconds!", 10)
+
+ crit(message, ...)
+ emerg(message, ...)
+ alert(message, ...)
+ err(message, ...)
+ warning(message, ...)
+ notice(message, ...)
+ info(message, ...)
+ debug(message, ...)
+
+ These are shortcut methods of Syslog#log(). The Lineup may
+ vary depending on what priorities are defined on your system.
+
+ Example:
+ sl.crit("the sky is falling in %d seconds!",5)
+
+ mask
+ mask=(mask)
+
+ Returns or sets the log priority mask. The value of the mask
+ is persistent and Syslog::open/Syslog#open/Syslog#close don't
+ reset it.
+
+ Example:
+ sl.mask = Syslog::LOG_UPTO(Syslog::LOG_ERR)
+
+ close
+
+ Closes syslog.
+
+ inspect
+
+ Returns the "inspect" string of the object.
+
+** Syslog::Constants(Module)
+
+Superclass: Object
+
+require 'syslog'
+include Syslog::Constants
+
+This module includes the LOG_* constants available on the system.