summaryrefslogtreecommitdiff
path: root/jni/ruby/ext/syslog/syslog.txt
blob: 4286f295344978c1e9cc01e6b643c4f81d391aa3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
.\" syslog.txt -  -*- Indented-Text -*-
$RoughId: syslog.txt,v 1.18 2002/02/25 08:20:14 knu Exp $
$Id: syslog.txt 31689 2011-05-22 09:26:02Z nobu $

UNIX Syslog extension for Ruby
Amos Gouaux, University of Texas at Dallas
<amos+ruby@utdallas.edu>
&
Akinori MUSHA
<knu@iDaemons.org>

Contact:
  - Akinori MUSHA <knu@iDaemons.org> (current maintainer)

** Syslog(Module)

Included Modules: 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.

Module 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 module
        itself.  If a block is given, calls it with an argument of
        itself.  If syslog is already opened, raises RuntimeError.

        Example:
          Syslog.open('ftpd', Syslog::LOG_PID | Syslog::LOG_NDELAY,
                              Syslog::LOG_FTP)

   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 resets these values.

   log(pri, message, ...)

        Writes message to syslog.

        Example:
          Syslog.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:
          Syslog.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 will not be reset by Syslog::open or
        Syslog::close.

        Example:
          Syslog.mask = Syslog::LOG_UPTO(Syslog::LOG_ERR)

   close

        Closes syslog.

   inspect

        Returns the "inspect" string of the Syslog module.

   instance

        Returns the module itself. (Just for backward compatibility)

   LOG_MASK(pri)

        Creates a mask for one priority.

   LOG_UPTO(pri)

        Creates a mask for all priorities up to pri.

** Syslog::Constants(Module)

require 'syslog'
include Syslog::Constants

This module includes the LOG_* constants available on the system.

Module Methods:

   LOG_MASK(pri)

        Creates a mask for one priority.

   LOG_UPTO(pri)

        Creates a mask for all priorities up to pri.