FBB::level(3bobcat)

πŸ¦‹ FBB::level β€” the log-level setter, bestie edition

okay so this is FBB::level(3bobcat), a manual page from section 3bobcat (that's the bobcat library's C++ API section, iykyk). It's about a cute lil manipulator that tells FBB::Log objects how loud to be. Let's get into it πŸ’…


✨ NAME ✨

FBB::level β€” the manipulator that sets the log-level of FBB::Log objects. periodt.


🌸 SYNOPSIS 🌸

#include <bobcat/level>

Linking option: -lbobcat


πŸ’– DESCRIPTION πŸ’–

okay so an FBB::level object is the thing you use to specify the insertion forces of info that gets inserted into FBB::Log objects. The way that it works: when you insert a level into a Log object, it defines the force of every insertion (or write call) that comes after it into that Log object. no cap.

Conversely (flip side, bestie), Log objects can set their own insertion resistances through their setLevel members. So here's the vibe check: if the level's force is equal to or exceeds the Log object's resistance, then the insertion happens. If not? The insertion is just… ignored. πŸ™ˆ

A single insertion statement can contain multiple level calls, and if it does, then each level call updates the force of the insertions that follow that level call. so they stack up as you go, one after another. iconic behaviour honestly.

By default, insertions into Log objects that are not preceded by level insertions are completed. (default = you get your message, no drama.)

And heads up: when a level object gets inserted into another kind of std::ostream object β€” literally anything that isn't a Log β€” the level object performs no actions. It's like it's not even there. silent. main character who says nothing.


πŸ‘‘ NAMESPACE πŸ‘‘

FBB

All constructors, members, operators and manipulators mentioned in this man-page are defined in the namespace FBB. everyone lives in the same house fr fr 🫢


πŸŽ€ INHERITS FROM πŸŽ€

-

(yeah, nothing. it inherits from nothing. it's self-made.)


🌈 CONSTRUCTORS 🌈

  • level(size_t force) β€” this constructor is used in insertion statements, usually by inserting it as an anonymous object into an FBB::Log object. that's the classic move.

Copy and move constructors (and assignment operators) are available. βœ…


πŸ’œ OVERLOADED OPERATOR πŸ’œ

  • std::ostream &::operator<<(std::ostream &ostr, FBB::level const &force) β€” if ostr can be downcasted to an FBB::Log object, then subsequent insertions are performed if force exceeds the Log object's resistance as specified by its setLevel member. If ostr does not actually refer to a Log object, then ostr is returned without any further action, and ostr handles subsequent insertions in its default way. (it just goes back to doing its own thing. live and let live.)

πŸ”₯ EXAMPLE πŸ”₯

okay this is the whole thing, verbatim, don't skip it bestie:

#include <iostream>
#include <iomanip>

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

using namespace std;
using namespace FBB;

int main()
{
//    Log &log = Log::initialize("&1"); // uses the static Log object
    Log log;                        // explicitly defining a Log object
//    log.open("/tmp/out");           // or at once: Log log{ "/tmp/out" }

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

    log.off();
    log << "This message is not shown\n";
    log << "This message is not shown\n";
    log << fnl;
    log << "This message is not shown\n";

    log.on(2);
    log << "This message is shown\n";

    log << level(0) << "not shown" << level(2) << "shown at level 2\n";
    log << level(3) << "at level(3)" << level(1) << "not shown" << fnl;

    log << "separate new line\n";

    log << level(2) << "in business again\n";
    log << "final line\n";

    log.str("ab");

    log(’a’) << "hello a!" << endl;
    log(’b’) << "hello b!" << nl <<
                setw(16) << ’ ’ << "so far, so good" << endl;

    log << "not shown" << endl;

    log(’c’) << "not shown\n";
    log << "not shown\n";

    log.setLevel(2);
    log << level(2) << "in business again\n";
}

πŸ“ FILES πŸ“

bobcat/level β€” defines the class interface. that's where the magic lives.


🧚 SEE ALSO 🧚

bobcat(7), log(3bobcat)

go read those too, they're the besties of this page πŸ’ž


πŸ’€ BUGS πŸ’€

None Reported.

(read: nobody found anything. slay.)


⭐ BOBCAT PROJECT FILES ⭐

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'. cute name, honestly. it's giving acronym royalty πŸ‘‘


This is free software, distributed under the terms of the GNU General Public License (GPL). free as in freedom, bestie, go wild 🫢


πŸŽ€ AUTHOR πŸŽ€

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


and that's the whole page!! πŸ’… this was from libbobcat-dev_6.15.01, dated 2005-2026, and it's the FBB::level(3bobcat) page itself. stay logged, stay levelled, mwah πŸ˜­πŸ’–

πŸ“¦ where this page comes from