FBB::LogBuf(3bobcat)

log messages stream buffer
(libbobcat-dev_6.04.00)

2005-2023

NAME

FBB::LogBuf - std::streambuf handling log messages

SYNOPSIS

#include <bobcat/logbuf>
Linking option: -lbobcat

DESCRIPTION

FBB::LogBuf is a class derived from std::streambuf handling log messages. The stream to log to, timestamps and log-levels can be configured both at construction time and beyond. The FBB::LogBuf may be used to initialize a std::ostream.

NAMESPACE

FBB
All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB.

INHERITS FROM

std::streambuf

ENUMERATIONS

The enumeration TimeStamps is defined in the namespace FBB to be used when initializing FBB::LogBuf objects. It has the following values:

The enumeration Active is used to distinguish between suspending message insertion when a message's level does not exceed a minimum level and suspending all message insertions (e.g., when suspending inserting messages into FBB::Log objects after calling their off member):

CONSTRUCTORS

Copy and move constructors (and assignment operators) are not available.

PUBLIC MEMBER FUNCTIONS

All members of std::streambuf are available, as FBB::LogBuf inherits from this class.

EXAMPLE

#include <iostream>
#include <iomanip>

#include <bobcat/log>
#include <bobcat/level>

using namespace std;
using namespace FBB;

int main()
{
    LogBuf buffer(cout, FBB::TIMESTAMPS);
    ostream log(&buffer);

    log << "This message is written to cout" << nl <<
           setw(16) << ' ' << "occupying multiple lines\n";

    buffer.setActive(false);

    log << "one line\n";
    log << "more lines ";
    log << fnl;
    log << "another\n";

    buffer.setActive(true);
    log << "and active again\n";
    log << "another log msg\n";
}

FILES

bobcat/logbuf - defines the class interface

SEE ALSO

bobcat(7), log(3bobcat)

BUGS

None Reported.

BOBCAT PROJECT FILES

BOBCAT

Bobcat is an acronym of `Brokken's Own Base Classes And Templates'.

COPYRIGHT

This is free software, distributed under the terms of the GNU General Public License (GPL).

AUTHOR

Frank B. Brokken (f.b.brokken@rug.nl).