iceoryx_hoofs 2.0.5
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Friends | List of all members
iox::log::Logger Class Reference

#include <iceoryx_hoofs/log/logger.hpp>

Public Member Functions

 Logger (Logger &&other) noexcept
 
Loggeroperator= (Logger &&rhs) noexcept
 
 Logger (const Logger &other)=delete
 
Loggeroperator= (const Logger &rhs)=delete
 
LogLevel GetLogLevel () const noexcept
 Getter method for the current LogLevel.
 
void SetLogLevel (const LogLevel logLevel) noexcept
 Sets the LogLevel for the Logger.
 
cxx::GenericRAII SetLogLevelForScope (const LogLevel logLevel) noexcept
 Sets the LogLevel to the given level for the lifetime of the GenericRAII object and then sets it back to the previous one.
 
void SetLogMode (const LogMode logMode) noexcept
 
bool IsEnabled (const LogLevel logLevel) const noexcept
 
LogStream LogFatal () noexcept
 
LogStream LogError () noexcept
 
LogStream LogWarn () noexcept
 
LogStream LogInfo () noexcept
 
LogStream LogDebug () noexcept
 
LogStream LogVerbose () noexcept
 

Protected Member Functions

 Logger (const std::string &ctxId, const std::string &ctxDescription, const LogLevel appLogLevel) noexcept
 
virtual void Log (const LogEntry &entry) const noexcept
 

Friends

class LogManager
 
class LogStream
 

Detailed Description

Todo:
for asynchronous logging, make the logger an active object according to Herb Sutter https://herbsutter.com/2010/07/12/effective-concurrency-prefer-using-active-objects-instead-of-naked-threads/

Member Function Documentation

◆ GetLogLevel()

LogLevel iox::log::Logger::GetLogLevel ( ) const
noexcept

Getter method for the current LogLevel.

Returns
the current LogLevel

◆ SetLogLevel()

void iox::log::Logger::SetLogLevel ( const LogLevel  logLevel)
noexcept

Sets the LogLevel for the Logger.

Parameters
[in]logLevelto be set

◆ SetLogLevelForScope()

cxx::GenericRAII iox::log::Logger::SetLogLevelForScope ( const LogLevel  logLevel)
noexcept

Sets the LogLevel to the given level for the lifetime of the GenericRAII object and then sets it back to the previous one.

Parameters
[in]logLevelto be set temporarily
Returns
a scope guard which resets the LogLevel to the value at the time when this method was called

Friends And Related Symbol Documentation

◆ LogStream

friend class LogStream
friend
Todo:
LogStream needs to call Log(); do we want to make Log() public?

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