---
name: "level"
section: "3bobcat"
platform: "linux"
package: "libbobcat-dev"
version: "6.07.01-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/level"
---

# level(3bobcat)

Manipulator setting the log-level of FBB::Log objects

## NAME

FBB::level - Manipulator setting the log-level of **FBB::Log** objects

## SYNOPSIS

**#include \<bobcat/level\>**\
 Linking option: *-lbobcat*

## DESCRIPTION

An **FBB::level** object is used to specify insertion \`forces’ of information that is inserted into **FBB::Log** objects. When inserted into *Log* objects it defines the \`force’ of subsequent insertions (or *write* calls) into those *Log* objects.

Conversely, *Log* objects may specify insertion \`resistances’ through their *setLevel* members. If the *level’s* \`force’ is equal to or exceeds the *Log* object’s \`resistance’ then the insertion is performed, otherwise the insertion is ignored. A single insertion statement may contain multiple *level* calls. If so, then each *level* call updates the \`force’ of insertions following the *level* call.

By default insertions into *Log* objects not preceded by *level* insertions are completed.

When a *level* object is inserted into another kind of *std::ostream* object the *level* object performs no actions.

## NAMESPACE

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

## INHERITS FROM

\-

## CONSTRUCTORS

- o

  **level(size\_t force)**:\
   This constructor is used in insertion statements, usually inserting it as anonymous object into an *FBB::Log* object.

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

## OVERLOADED OPERATOR

- o

  **std::ostream &::operator\<\<(std::ostream &ostr,** **FBB::level const &force)**:\
   If the *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.

## EXAMPLE

```
#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.

## SEE ALSO

[**bobcat**(7)](/bobcat/7.md), [**log**(3bobcat)](/log/3bobcat.md)

## BUGS

None Reported.

## BOBCAT PROJECT FILES

- o

  *https://fbb-git.gitlab.io/bobcat/*: gitlab project page;

Debian Bobcat project files:

- o

  *libbobcat6*: debian package containing the shared library, changelog and copyright note;

- o

  *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’.

## 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**).
