1 .\" syslog.txt - -*- Indented-Text -*-
2 $RoughId: syslog.txt,v 1.18 2002/02/25 08:20:14 knu Exp $
3 $Id: syslog.txt 15821 2008-03-21 12:15:06Z knu $
5 UNIX Syslog extension for Ruby
6 Amos Gouaux, University of Texas at Dallas
7 <amos+ruby@utdallas.edu>
13 - Akinori MUSHA <knu@iDaemons.org> (current maintainer)
17 Included Modules: Syslog::Constants
21 A Simple wrapper for the UNIX syslog system calls that might be handy
22 if you're writing a server in Ruby. For the details of the syslog(8)
23 architecture and constants, see the syslog(3) manual page of your
28 open(ident = $0, logopt = Syslog::LOG_PID | Syslog::LOG_CONS,
29 facility = Syslog::LOG_USER) [{ |syslog| ... }]
31 Opens syslog with the given options and returns the module
32 itself. If a block is given, calls it with an argument of
33 itself. If syslog is already opened, raises RuntimeError.
36 Syslog.open('ftpd', Syslog::LOG_PID | Syslog::LOG_NDELAY,
39 open!(ident = $0, logopt = Syslog::LOG_PID | Syslog::LOG_CONS,
40 facility = Syslog::LOG_USER)
41 reopen(ident = $0, logopt = Syslog::LOG_PID | Syslog::LOG_CONS,
42 facility = Syslog::LOG_USER)
44 Same as open, but does a close first.
48 Returns true if syslog opened, otherwise false.
54 Returns the parameters given in the last open, respectively.
55 Every call of Syslog::open resets these values.
57 log(pri, message, ...)
59 Writes message to syslog.
62 Syslog.log(Syslog::LOG_CRIT, "the sky is falling in %d seconds!", 10)
73 These are shortcut methods of Syslog::log(). The lineup may
74 vary depending on what priorities are defined on your system.
77 Syslog.crit("the sky is falling in %d seconds!", 5)
82 Returns or sets the log priority mask. The value of the mask
83 is persistent and will not be reset by Syslog::open or
87 Syslog.mask = Syslog::LOG_UPTO(Syslog::LOG_ERR)
95 Returns the "inspect" string of the Syslog module.
99 Returns the module itself. (Just for backward compatibility)
103 Creates a mask for one priority.
107 Creates a mask for all priorities up to pri.
109 ** Syslog::Constants(Module)
112 include Syslog::Constants
114 This module includes the LOG_* constants available on the system.
120 Creates a mask for one priority.
124 Creates a mask for all priorities up to pri.