CMR  1.3.0
Public Member Functions | Friends | List of all members
tu::logger Class Reference

#include <logger.hpp>

Public Member Functions

 logger (log_level level)
 
virtual ~logger ()
 
log_level level () const
 
bool is_quiet () const
 
bool is_verbose () const
 
bool is_progressive () const
 
void indent (size_t amount=1)
 
void unindent (size_t amount=1)
 
void clear ()
 
size_t size () const
 
void erase (size_t position)
 
std::stringstream & line ()
 
const std::stringstream & line () const
 

Friends

std::ostream & operator<< (std::ostream &, logger &)
 Stream operator. More...
 

Detailed Description

This class manages the logging behaviour of the library. There are three level:

Constructor & Destructor Documentation

◆ logger()

tu::logger::logger ( log_level  level)

Creates a logger object.

Parameters
levelThe log level to work with

◆ ~logger()

tu::logger::~logger ( )
virtual

Destructor

Member Function Documentation

◆ clear()

void tu::logger::clear ( )
inline

Clears the current line.

◆ erase()

void tu::logger::erase ( size_t  position)
inline

Erases a portion from the current line.

Parameters
positionPosition from which to erase

◆ indent()

void tu::logger::indent ( size_t  amount = 1)
inline

Increases the indent of current and further lines.

Parameters
amountNumber of spaces to increase

◆ is_progressive()

bool tu::logger::is_progressive ( ) const
inline
Returns
true if and only if log level is updating

◆ is_quiet()

bool tu::logger::is_quiet ( ) const
inline
Returns
true if and only if log level is quiet

◆ is_verbose()

bool tu::logger::is_verbose ( ) const
inline
Returns
true if and only if log level is verbose

◆ level()

log_level tu::logger::level ( ) const
inline
Returns
The current log level

◆ line() [1/2]

std::stringstream& tu::logger::line ( )
inline
Returns
The string stream holding the current line

◆ line() [2/2]

const std::stringstream& tu::logger::line ( ) const
inline
Returns
The string stream holding the current line

◆ size()

size_t tu::logger::size ( ) const
inline
Returns
Number of characters in the current line

◆ unindent()

void tu::logger::unindent ( size_t  amount = 1)
inline

Decreases the indent of current and further lines.

Parameters
amountNumber of space to decrease

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  ,
logger  
)
friend

Stream operator.

Streams a line of a logger object and flushes the output stream.

Parameters
Outputstream
Loggerobject
Returns
Output stream

The documentation for this class was generated from the following files: