CVB++ 15.0
Loading...
Searching...
No Matches

A log object to stream messages. More...

#include <cvb/telemetry/log.hpp>

Inherits AttributeMap.

Public Member Functions

 operator bool () const noexcept
 Operator to evaluate as bool.
 
template<typename T, typename = typename std::enable_if<is_ostreamable<T>::value>::type>
Logoperator<< (const T &value)
 Operator for types compatible with std::ostream.
 
- Public Member Functions inherited from AttributeMap
AttributeMapoperator() (const std::string &key, const Char *value)
 Specialization for Cvb::Char*.
 
AttributeMapoperator() (const std::string &key, void *value)
 Specialization for void*.
 
template<>
AttributeMapoperator() (const std::string &key, const double &value)
 Specialization for double.
 
template<>
AttributeMapoperator() (const std::string &key, const float &value)
 Specialization for float.
 
template<>
AttributeMapoperator() (const std::string &key, const String &value)
 Specialization for Cvb::String.
 
template<>
AttributeMapoperator() (const std::string &key, const bool &value)
 Specialization for bool.
 
template<>
AttributeMapoperator() (const std::string &key, const int8_t &value)
 Specialization for int8_t.
 
template<>
AttributeMapoperator() (const std::string &key, const uint8_t &value)
 Specialization for uint8_t.
 
template<>
AttributeMapoperator() (const std::string &key, const int16_t &value)
 Specialization for int16_t.
 
template<>
AttributeMapoperator() (const std::string &key, const uint16_t &value)
 Specialization for uint16_t.
 
template<>
AttributeMapoperator() (const std::string &key, const int32_t &value)
 Specialization for int32_t.
 
template<>
AttributeMapoperator() (const std::string &key, const uint32_t &value)
 Specialization for uint32_t.
 
template<>
AttributeMapoperator() (const std::string &key, const int64_t &value)
 Specialization for int64_t.
 
template<>
AttributeMapoperator() (const std::string &key, const uint64_t &value)
 Specialization for uint64_t.
 

Static Public Member Functions

static Log Create ()
 Creates a dummy log.
 
static Log Create (LogLevel logLevel)
 Creates a log with the given log level.
 

Detailed Description

A log object to stream messages.

Log objects are created to stream messages. They support all std::ostream compatible types.

Member Function Documentation

◆ Create() [1/2]

static Log Create ( )
inlinestatic

Creates a dummy log.

Exceptions
Doesnot throw any exception.

A dummy log will evaluate to false. and perform only NOPs. Dummy logs are used when logging is deactivated.

◆ Create() [2/2]

static Log Create ( LogLevel logLevel)
inlinestatic

Creates a log with the given log level.

Parameters
[in]logLevelThe log level.
Exceptions
Doesnot throw any exception.

Log object to receive a message at the given level.

◆ operator bool()

operator bool ( ) const
inlineexplicitnoexcept

Operator to evaluate as bool.

Dummy logs always evaluate to false. Otherwise logs evaluate to true.