/usr/share/doc/libbobcat4-dev/man/syslogbuf.3.html is in libbobcat-dev 4.08.02-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | <!DOCTYPE html><html><head>
<meta charset="UTF-8">
<title>FBB::Syslogbuf(3bobcat)</title>
<style type="text/css">
figure {text-align: center;}
img {vertical-align: center;}
.XXfc {margin-left:auto;margin-right:auto;}
.XXtc {text-align: center;}
.XXtl {text-align: left;}
.XXtr {text-align: right;}
.XXvt {vertical-align: top;}
.XXvb {vertical-align: bottom;}
</style>
<link rev="made" href="mailto:Frank B. Brokken: f.b.brokken@rug.nl">
</head>
<body text="#27408B" bgcolor="#FFFAF0">
<hr/>
<h1 id="title">FBB::Syslogbuf(3bobcat)</h1>
<h2 id="author">Stream Buffer for Syslog<br/>(libbobcat-dev_4.08.02-x.tar.gz)</h2>
<h2 id="date">2005-2017</h2>
<p>
<h2 >NAME</h2>FBB::Syslogbuf - A streambuf object inserting syslog messages
<p>
<h2 >SYNOPSIS</h2>
<strong >#include <bobcat/syslogbuf></strong><br/>
Linking option: <em >-lbobcat</em>
<p>
<h2 >DESCRIPTION</h2>
Addresses of <strong >FBB::Syslogbuf</strong> objects can be passed as
<strong >std::streambuf</strong> addresses to <em >std::ostream</em> objects to write messages to
the syslog daemon using stream facilities.
<p>
Multiple separate insertions can be used to create a single syslog message:
the message is only sent to the syslog daemon after receiving a <em >flush</em>
command (e.g., after inserting <em >std::flush</em> or <em >std::endl</em>). Non-printable
characters (like <em >'\n'</em>) show up in the syslog message as octal values,
preceded by <em >#</em> (e.g., <em >#012</em> for <em >'\n'</em>). The newline normally inserted
by <em >std::endl</em> is ignored: <strong >SyslogStream</strong> objects interpret <em >std::endl</em>
like <em >std::flush</em>.
<p>
One series of insertions may contain multiple <em >std::endl</em> or <em >std::flush</em>
manipulators. At each of these manipulators a new message is sent to the
syslog daemon, containing all info that has so far been buffered. After
sending a message to the syslog daemon, the <strong >SyslogStream</strong>'s internal buffer
is cleared.
<p>
<h2 >NAMESPACE</h2>
<strong >FBB</strong><br/>
All constructors, members, operators and manipulators, mentioned in this
man-page, are defined in the namespace <strong >FBB</strong>.
<p>
<h2 >INHERITS FROM</h2>
<strong >std::streambuf</strong>
<p>
<h2 >ENUMERATIONS</h2>
<p>
The following enumerations are defined in the namespace <strong >FBB</strong>:
<p>
<strong >Priority</strong>:
<p>
The values of this enumeration match the corresponding priority
<strong >LOG_xxx</strong> values used with <strong >syslog</strong>(3):
<ul>
<li> <strong >EMERG</strong>:<br/>
system is unusable;
<li> <strong >ALERT</strong>:<br/>
action must be taken immediately;
<li> <strong >CRIT</strong>:<br/>
critical conditions;
<li> <strong >ERR</strong>:<br/>
error conditions;
<li> <strong >WARNING</strong>:<br/>
warning conditions;
<li> <strong >NOTICE</strong>:<br/>
normal, but significant, condition;
<li> <strong >INFO</strong>:<br/>
informational message;
<li> <strong >DEBUG</strong>:<br/>
debug-level message;
</ul>
<p>
<strong >PriorityType</strong>:
<p>
This enumberation has two values fine-tuning the type of messages that
are actually processed by the syslog daemon:
<ul>
<li> <strong >SINGLE</strong>:<br/>
Only messages of the priority specified at the <em >setMask</em> call are
processed by the syslog daemon;
<li> <strong >UPTO</strong>:<br/>
Messages of priority <em >EMERG</em> up to the the priority specified at the
<em >setMask</em> call are processed by the syslog daemon;
</ul>
By default, the syslog daemon processes all messages it receives.
<p>
<strong >Facility</strong>:
<p>
The values of this enumeration match the corresponding facility
<strong >LOG_xxx</strong> values used with <strong >syslog</strong>(3):
<ul>
<li> <strong >AUTHPRIV</strong>:<br/>
security/authorization messages (private)
<li> <strong >CRON</strong>:<br/>
clock daemon (<em >cron</em> and <em >at</em>)
<li> <strong >DAEMON</strong>:<br/>
other system daemons
<li> <strong >KERN</strong>:<br/>
kernel messages
<li> <strong >LOCAL0</strong>:<br/>
reserved for local use. <strong >LOCAL1</strong> through <strong >LOCAL7</strong> are
available as well.
<li> <strong >LPR</strong>:<br/>
line printer subsystem
<li> <strong >MAIL</strong>:<br/>
mail subsystem
<li> <strong >NEWS</strong>:<br/>
<em >USENET</em> news subsystem
<li> <strong >SYSLOGBUF</strong>:<br/>
messages generated internally by <em >syslogbufd</em>
<li> <strong >USER</strong>:<br/>
generic user-level messages
<li> <strong >UUCP</strong>:<br/>
UUCP subsystem
</ul>
<p>
<h2 >CONSTRUCTORS</h2>
<ul>
<li> <strong >Syslogbuf(string const &ident = "",
FBB::Priority priority = FBB::NOTICE,
FBB::Facility facility = FBB::USER,
int option = 0)</strong>:<br/>
This constructor initializes a <strong >Syslogbuf</strong> object. The
<em >ident</em> parameter is usually the name of the program. Its contents are
prepended to syslog messages.
<p>
The <em >priority</em> parameter determines the default importance of the message
sent to the syslog daemon. By default messages are sent to the syslog daemon
with priority <strong >FBB::NOTICE</strong>. Syslog messages may be given different priority
by inserting a <strong >SyslogStream</strong>(3bobcat) manipulator. The priority set at
construction time may also be modified using the <em >setPriority</em> and
<em >setDefaultPriority</em> members.
<p>
Which messages actually appear in log facilities is not determined by
the messages' priorities, but by syslog's <em >log mask</em>. The log mask can be
set by the static member <em >setMask</em> (see below).
<p>
The <em >facility</em> parameter determines the type of program doing the
logging. By default <strong >FBB::USER</strong> is used.
<p>
The <em >option</em> parameter may be used to specify various options (use the
binary `<em >bitor</em>' (`<em >|</em>') operator to combine options):
<p>
<strong >LOG_CONS</strong>:
write directly to system console if there is an
error while sending to system logger <br/>
<strong >LOG_NDELAY</strong>:
open the connection immediately (normally, the con-
nection is opened when the first message is logged) <br/>
<strong >LOG_PERROR</strong>:
print to stderr as well <br/>
<strong >LOG__PID</strong>:
include PID with each message <br/>
<p>
By default no options are used.
<p>
<li> <strong >Syslogbuf(char const *ident,
FBB::Priority priority = FBB::NOTICE,
FBB::Facility facility = FBB::USER,
int option = 0)</strong>:<br/>
This constructor is kept for backward compatibility. Its parameters
have the same meanings as those of the abovementioned constructor. A
<em >nullptr</em> indicates that no text needs to be prepended to syslog messages.
</ul>
<p>
Copy and move constructors are not available.
<p>
<h2 >MEMBER FUNCTIONS</h2>
<p>
All members of <strong >std::streambuf</strong> are available, as <strong >FBB::Syslogbuf</strong>
inherits from this class.
<p>
<ul>
<li> <strong >void close()</strong>:<br/>
If the <strong >SyslogStream</strong>'s internal buffer is not empty it is flushed to
the syslog daemon. Thereafer <strong >closelog</strong>(3) is called.
<li> <strong >Priority defaultPriority() const</strong>:<br/>
Returns the current default priority. I.e., the priority that will be
used for the messages after inserting <em >endl</em> or <em >flush</em>.
<li> <strong >void open(string const &ident,
FBB::Priority priority = FBB::NOTICE,
FBB::Facility facility = FBB::USER,
int option = 0)</strong>:<br/>
Redefines the current identifier, priority, facility and options that
are used when sending messages to the syslog daemon. If the
<strong >SyslogStream</strong>'s internal buffer is not empty it is first flushed to
the syslog daemon using the identifier, priority and options that were
active just before calling <em >open</em>.
<li> <strong >Priority priority() const</strong>:<br/>
Returns the next priority. I.e., the priority that will be used for
the next message that is sent to the syslog daemon.
<li> <strong >Priority setDefaultPriority(Priority priority)</strong>:<br/>
Changes the default priority of the next message that is sent to the
syslog daemon after inserting <em >std::eoln</em> or
<em >std::flush</em>. The previously active default priority is
returned.
<li> <strong >Priority setPriority(Priority priority)</strong>:<br/> Changes the priority for the
next message that is sent to the syslog daemon after inserting
<em >std::eoln</em> or <em >std::flush</em>. Subsequent messages will again use
the default priority. The previously active priority setting is
returned.
</ul>
<p>
<h2 >PROTECTED MEMBER FUNCTION</h2>
<p>
The member listed in this section implements the tasks of the comparably
named virtual function in the class's private interface. This separates the
redefinable interface from the user-interface. The class <strong >Syslogbuf</strong>
can, in accordance with Liskov's Substitution Principle, be used as a
<em >std:streambuf</em>; but it also offers a facility for classes deriving from
<strong >Syslogbuf</strong>.
<ul>
<li> <strong >int pSync()</strong>:<br/>
The contents of the <strong >Syslogbuf</strong>'s internal buffer are flushed to the
syslog daemon.
</ul>
<p>
<h2 >EXAMPLE</h2>
See also <strong >syslogstream</strong>(3bobcat)
<p>
<pre>
#include <iostream>
#include <bobcat/syslogstream>
using namespace std;
using namespace FBB;
int main(int argc, char **argv)
{
ostream sls(new Syslogbuf(argv[0]));
sls << SyslogStream::debug << "Hello world" << flush <<
SyslogStream::strerrno << endl;
}
</pre>
<p>
<h2 >FILES</h2>
<em >bobcat/syslogbuf</em> - defines the class interface
<p>
<h2 >SEE ALSO</h2>
<strong >bobcat</strong>(7), <strong >closelog</strong>(3), <strong >openlog</strong>(3), <strong >rsyslogd</strong>(8)
<strong >syslog</strong>(3), <strong >syslogstream</strong>(3bobcat)
<p>
<h2 >BUGS</h2>
The constructor's <em >option</em> parameter is an <em >int</em>. Because of this,
<em >int</em> values rather than enumeration values are passed to the
constructor. It is the responsibility of the programmer to pass defined option
values only.
<p>
<h2 >DISTRIBUTION FILES</h2>
<ul>
<li> <em >bobcat_4.08.02-x.dsc</em>: detached signature;
<li> <em >bobcat_4.08.02-x.tar.gz</em>: source archive;
<li> <em >bobcat_4.08.02-x_i386.changes</em>: change log;
<li> <em >libbobcat1_4.08.02-x_*.deb</em>: debian package holding the
libraries;
<li> <em >libbobcat1-dev_4.08.02-x_*.deb</em>: debian package holding the
libraries, headers and manual pages;
<li> <em >http://sourceforge.net/projects/bobcat</em>: public archive location;
</ul>
<p>
<h2 >BOBCAT</h2>
Bobcat is an acronym of `Brokken's Own Base Classes And Templates'.
<p>
<h2 >COPYRIGHT</h2>
This is free software, distributed under the terms of the
GNU General Public License (GPL).
<p>
<h2 >AUTHOR</h2>
Frank B. Brokken (<strong >f.b.brokken@rug.nl</strong>).
<p>
</body>
</html>
|