FBB::SyslogBuf(3bobcat)
β¨ NAME β¨
FBB::SyslogBuf β literally a streambuf object that inserts syslog messages, bestie π
This is the FBB::SyslogBuf(3bobcat) page, btw. Stream buffer for syslog. Iconic.
π SYNOPSIS π
#include <bobcat/syslogbuf>
Linking option: -lbobcat
π¦ DESCRIPTION π¦
Okay so here's the tea β β you can take addresses of FBB::SyslogBuf objects and hand them over as std::streambuf addresses to std::ostream objects, and boom, now you're writing messages to the syslog daemon using plain old stream facilities. no cap.
Multiple separate insertions can be used to create a one single syslog message. The way that works? The message only actually gets sent to the syslog daemon after it receives a flush command (like after inserting std::flush or std::endl). so like, nothing goes out until you say go π«Ά
Non-printable characters (like '\n' bestie, yes even that one) show up in the syslog message as octal values, preceded by #. So for example #012 for '\n'. wild, I know. π
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. And after sending a message to the syslog daemon, the SyslogStream's internal buffer is cleared. clean slate, periodt. β¨
π NAMESPACE π
FBB
All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB. all of them. every single one. π
π INHERITS FROM π
FBB::EoiBuf and thus from std::streambuf π
π 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;
PriorityType
This enumeration 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 thesetMaskcall are processed by the syslog daemon;UPTO: messages of priorityEMERGup to the the priority specified at thesetMaskcall 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 daemonsKERN: kernel messagesLOCAL0: reserved for local use.LOCAL1throughLOCAL7are available as well.LPR: line printer subsystemMAIL: mail subsystemNEWS: USENET news subsystemSYSLOGBUF: messages generated internally by syslogbufdUSER: generic user-level messagesUUCP: UUCP subsystem
π§ CONSTRUCTOR π§
SyslogBuf(string const &ident = "", FBB::Priority priority = FBB::NOTICE, FBB::Facility facility = FBB::USER, int option = 0)β the whole vibe-setter right here. Let's break it down:
The ident parameter is usually the name of the program. Its content 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(3bobcat) manipulator. The priority set at construction time may also be modified using the setPriority and setDefaultPriority members.
ngl bestie, which messages actually appear in log facilities is not determined by the messages' priorities β it's determined 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 is used.
The option parameter may be used to specify various options (use the binary bitor (|) operator to combine options):
LOG_CONS: write directly to system console if there is an
error while sending to system logger
LOG_NDELAY: open the connection immediately (normally, the con-
nection is opened when the first message is logged)
LOG_PERROR: print to stderr as well
LOG__PID: include PID with each message
By default no options are used.
Copy and move constructors (and assignment operators) are not available. π no copying, no moving, we stay exactly where we are.
π MEMBER FUNCTIONS π
All members of std::streambuf are available, as FBB::SyslogBuf inherits from this class. inherit and thrive, slay.
Priority defaultPriority() constβ Returns the current default priority. I.e., the priority that will be used for the messages after insertingendlorflush.void eoi()β If theSyslogStream's internal buffer is not empty it is flushed to the syslog daemon. Thereafercloselog(3)is called. Instead of using this member theeoimanipulator can also be used.Priority priority() constβ Returns the next priority. I.e., the priority that will be used for the next message that is sent to the syslog daemon.void reset(string const &ident, FBB::Priority priority = FBB::NOTICE, FBB::Facility facility = FBB::USER, int option = 0)β Redefines the current identifier, priority, facility and options that are used when sending messages to the syslog daemon. If theSyslogStream'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 callingopen.Priority setDefaultPriority(Priority priority)β Changes the default priority of the next message that is sent to the syslog daemon after insertingstd::eolnorstd::flush. The previously active default priority is returned.Priority setPriority(Priority priority)β Changes the priority for the next message that is sent to the syslog daemon after insertingstd::eolnorstd::flush. Subsequent messages will again use the default priority. The previously active priority setting is returned.
β MANIPULATOR β
FBB::eoiβ Theeoimanipulator can be inserted into theostreaminstead of calling theSyslogBuf::endmember. It performs the same actions as theeoimember. If inserted into a plainstd::ostreamnothing happens. π«Ά
π₯ EXAMPLE π₯
See also syslogstream(3bobcat)
#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;
}
bestie this example ate and left no crumbs, fr fr π
πΈ FILES πΈ
bobcat/syslogbuf β defines the class interface
π SEE ALSO π
bobcat(7), closelog(3), openlog(3), rsyslogd(8) syslog(3), syslogstream(3bobcat)
π BUGS π
The constructor's option parameter is an int. Because of this, int values rather than enumeration values are passed to the constructor. It is the responsibility of the programmer to pass defined option values only.
okay so not me being dramatic but YES this is a real caveat β you're on your own for validity here, it will not hold your hand π«
π¦ BOBCAT PROJECT FILES π¦
- https://fbb-git.gitlab.io/bobcat/: gitlab project page;
Debian Bobcat project files:
libbobcat6: debian package containing the shared library, changelog and copyright note;libbobcat-dev: debian package containing the static library, headers, manual pages, and developer info;
π BOBCAT π
Bobcat is an acronym of Brokken's Own Base Classes And Templates. the lore is real π
π COPYRIGHT π
This is free software, distributed under the terms of the GNU General Public License (GPL). free as in slay π
β¨ AUTHOR β¨
Frank B. Brokken (f.b.brokken@rug.nl).
and that's the whole page, bestie β this waslibbobcat-dev_6.15.01, dated2005-2026, and yeah it's theFBB::SyslogBuf(3bobcat)manual, mwah π go log something iconic β¨
π¦ where this page comes from
- ubuntu stonking: libbobcat-dev 6.15.01-1 Β· GPL-3.0-or-later WITH OpenSSL exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms