FBB::SyslogStream(3bobcat)
Output Stream for Syslog
(libbobcat-dev_4.08.06-x.tar.gz)
2005-2018
NAME
FBB::SyslogStream - An output stream inserting syslog messages
SYNOPSIS
#include <bobcat/syslogstream>
Linking option: -lbobcat
DESCRIPTION
FBB::SyslogStream objects may be used as a std::ostream to write
syslog messages using stream facilities.
Multiple separate insertions can be used to create a single syslog message:
the message is only sent to the syslog daemon after receiving a flush
command (e.g., after inserting std::flush or std::endl). Non-printable
characters (like '\n') show up in the syslog message as octal values,
preceded by # (e.g., #012 for '\n'). The newline normally inserted
by std::endl is ignored: SyslogStream objects interpret std::endl
like std::flush.
One series of insertions may contain multiple std::endl or std::flush
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 SyslogStream's internal buffer
is cleared.
NAMESPACE
FBB
All constructors, members, operators and manipulators, mentioned in this
man-page, are defined in the namespace FBB.
INHERITS FROM
std::ostream
ENUMERATIONS
The following enumerations are defined in the namespace FBB:
Priority:
The values of this enumeration match the corresponding priority
LOG_xxx values used with syslog(3):
- EMERG:
system is unusable;
- ALERT:
action must be taken immediately;
- CRIT:
critical conditions;
- ERR:
error conditions;
- WARNING:
warning conditions;
- NOTICE:
normal, but significant, condition;
- INFO:
informational message;
- DEBUG:
debug-level message;
The setMask member (see below) can be used to select which type of
messages will actually be processed by the syslog daemon.
PriorityType:
This enumberation has two values fine-tuning the type of messages that
are actually processed by the syslog daemon:
- SINGLE:
Only messages of the priority specified at the setMask call are
processed by the syslog daemon;
- UPTO:
Messages of priority EMERG up to the the priority specified at the
setMask call are processed by the syslog daemon;
By default, the syslog daemon processes all messages it receives.
Facility:
The values of this enumeration match the corresponding facility
LOG_xxx values used with syslog(3):
- AUTHPRIV:
security/authorization messages (private)
- CRON:
clock daemon (cron and at)
- DAEMON:
other system daemons
- KERN:
kernel messages
- LOCAL0:
reserved for local use. LOCAL1 through LOCAL7 are
available as well.
- LPR:
line printer subsystem
- MAIL:
mail subsystem
- NEWS:
USENET news subsystem
- SYSLOGBUF:
messages generated internally by syslogbufd
- USER:
generic user-level messages
- UUCP:
UUCP subsystem
CONSTRUCTORS
- SyslogStream(string const &ident = "",
FBB::Priority priority = FBB::NOTICE,
FBB::Facility facility = FBB::USER,
int option = 0):
This constructor initializes a SyslogStream object. The
ident parameter is usually the name of the program. Its contents are
prepended to syslog messages.
The priority parameter determines the default importance of the message
sent to the syslog daemon. By default messages are sent to the syslog daemon
with priority FBB::NOTICE. Syslog messages may be given different priority
by inserting a SyslogStream manipulator (see below). The priority set at
construction time may also be modified using the setPriority and
setDefaultPriority members.
Which messages actually appear in log facilities is not determined by
the messages' priorities, but by syslog's log mask. The log mask can be
set by the static member setMask (see below).
The facility parameter determines the type of program doing the
logging. By default FBB::USER