Lunchbox  1.6.0
Classes | Namespaces | Defines | Enumerations | Functions
log.h File Reference

This file contains logging classes. More...

#include <lunchbox/api.h>
#include <lunchbox/types.h>
#include <assert.h>
#include <iomanip>
#include <iostream>
#include <sstream>
+ Include dependency graph for log.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  lunchbox::LogBuffer
class  lunchbox::Log
 The logging class. More...

Namespaces

namespace  lunchbox
 

Abstraction layer and common utilities for multi-threaded programming.


Defines

#define LBERROR
 Output an error message to the per-thread Log stream.
#define LBWARN
 Output a warning message to the per-thread Log stream.
#define LBINFO
 Output an informational message to the per-thread Log.
#define LBVERB
 Output a verbatim message to the per-thread Log stream.
#define LBLOG(topic)
 Output a message pertaining to a topic to the per-thread Log stream.

Enumerations

enum  lunchbox::LogLevel {
  lunchbox::LOG_ERROR = 1, lunchbox::LOG_WARN, lunchbox::LOG_INFO, lunchbox::LOG_VERB,
  LOG_ALL
}
 The logging levels. More...
enum  lunchbox::LogTopic { lunchbox::LOG_CUSTOM = 0x10, lunchbox::LOG_ANY = 0xffffu }
 The logging topics. More...

Functions

std::ostream & lunchbox::indent (std::ostream &os)
 Increases the indentation level of the Log stream, causing subsequent lines to be intended by four characters.
std::ostream & lunchbox::exdent (std::ostream &os)
 Decrease the indent of the Log stream.
std::ostream & lunchbox::disableFlush (std::ostream &os)
 Disable flushing of the Log stream.
std::ostream & lunchbox::enableFlush (std::ostream &os)
 Re-enable flushing of the Log stream.
std::ostream & lunchbox::forceFlush (std::ostream &os)
 Flush the Log stream regardless of the auto-flush state.
std::ostream & lunchbox::disableHeader (std::ostream &os)
 Disable printing of the Log header for subsequent lines.
std::ostream & lunchbox::enableHeader (std::ostream &os)
 Re-enable printing of the Log header.

Detailed Description

This file contains logging classes.

The macros LBERROR, LBWARN, LBINFO and LBVERB output messages at their respective logging level, if the level is active. They use a per-thread lunchbox::Log instance, which is a std::ostream. LBVERB is always inactive in release builds.

Definition in file log.h.


Define Documentation

#define LBERROR
Value:

Output an error message to the per-thread Log stream.

Version:
1.0

Definition at line 232 of file log.h.

#define LBINFO
Value:

Output an informational message to the per-thread Log.

Version:
1.0

Definition at line 238 of file log.h.

#define LBLOG (   topic)
Value:
(lunchbox::Log::topics & (topic))  &&  \
    lunchbox::Log::instance( __FILE__, __LINE__ )

Output a message pertaining to a topic to the per-thread Log stream.

Version:
1.0

Definition at line 254 of file log.h.

#define LBVERB
Value:

Output a verbatim message to the per-thread Log stream.

Version:
1.0

Definition at line 246 of file log.h.

#define LBWARN
Value:

Output a warning message to the per-thread Log stream.

Version:
1.0

Definition at line 235 of file log.h.

Referenced by lunchbox::daemonize().