AnCH Framework 0.2
Another C++ Hack: C++23 utility libraries
Loading...
Searching...
No Matches
anch::log::LogLine Class Reference

#include <stream.hpp>

Collaboration diagram for anch::log::LogLine:

Public Member Functions

 LogLine (const anch::log::Logger &logger, anch::log::Level level) noexcept
 LogLine (const LogLine &)=delete
 LogLine (LogLine &&)=delete
 ~LogLine () noexcept
template<typename T>
LogLine & operator<< (const T &value) noexcept
LogLine & operator<< (std::ostream &(*manip)(std::ostream &)) noexcept
LogLine & operator= (const LogLine &)=delete
LogLine & operator= (LogLine &&)=delete

Detailed Description

Log line.
Returned for levels greater or equal to MIN_LEVEL . The logger level is checked once at construction: when level is disabled, values are not formatted.
The message is written when the line is destroyed, i.e. at the end of the full expression.

A formatting error drops the message. Logging never throws.

Line is neither copyable nor movable. It must not be kept by reference: auto& line = LOG << anch::log::lvl::debug; is a dangling reference.

Author
Vincent Lachenal
Since
0.2

Constructor & Destructor Documentation

◆ LogLine() [1/3]

anch::log::LogLine::LogLine ( const anch::log::Logger & logger,
anch::log::Level level )
noexcept

LogLine constructor

Parameters
loggerThe logger
levelThe message level

◆ LogLine() [2/3]

anch::log::LogLine::LogLine ( const LogLine & )
delete

Prohibit LogLine copy

Here is the call graph for this function:

◆ LogLine() [3/3]

anch::log::LogLine::LogLine ( LogLine && )
delete

Prohibit LogLine move

Here is the call graph for this function:

◆ ~LogLine()

anch::log::LogLine::~LogLine ( )
noexcept

LogLine destructor: write the message when enabled

Member Function Documentation

◆ operator<<() [1/2]

template<typename T>
LogLine & anch::log::LogLine::operator<< ( const T & value)
noexcept

Append value to message

Parameters
valueThe value to append
Returns
this
Here is the call graph for this function:

◆ operator<<() [2/2]

LogLine & anch::log::LogLine::operator<< ( std::ostream &(* manip )(std::ostream &))
noexcept

Apply manipulator (std::endl , std::hex , ...) on message

Parameters
manipThe manipulator
Returns
this
Here is the call graph for this function:

◆ operator=() [1/2]

LogLine & anch::log::LogLine::operator= ( const LogLine & )
delete

Prohibit LogLine copy

Here is the call graph for this function:

◆ operator=() [2/2]

LogLine & anch::log::LogLine::operator= ( LogLine && )
delete

Prohibit LogLine move

Here is the call graph for this function:

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