Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
ara::log::Logger Class Reference

Logger of a specific context. More...

#include <logger.h>

Public Member Functions

ClientState RemoteClientState () const noexcept
 Remote logging client connection state. More...
 
LogStream LogFatal () const
 Create a stream for fatal logs. More...
 
LogStream LogError () const
 Create a stream for error logs. More...
 
LogStream LogWarn () const
 Create a stream for warning logs. More...
 
LogStream LogInfo () const
 Create a stream for information logs. More...
 
LogStream LogDebug () const
 Create a stream for debug logs. More...
 
LogStream LogVerbose () const
 Create a stream for verbose logs. More...
 
bool IsEnabled (LogLevel logLevel) const noexcept
 Determine whether a certian log level is enabled in the current context or not. More...
 
LogStream WithLevel (LogLevel logLevel) const
 Create a stream for certian level logs. More...
 

Static Public Member Functions

static Logger CreateLogger (std::string ctxId, std::string ctxDescription, LogLevel ctxDefLogLevel)
 Logger factory. More...
 

Detailed Description

Logger of a specific context.

Member Function Documentation

◆ CreateLogger()

Logger ara::log::Logger::CreateLogger ( std::string  ctxId,
std::string  ctxDescription,
LogLevel  ctxDefLogLevel 
)
static

Logger factory.

Parameters
ctxIdContext ID
ctxDescriptionContext description
ctxDefLogLevelContext default log level
Returns
A new logger for that specifc context
Note
Log with less severity than the default log level are ignored.

◆ IsEnabled()

bool ara::log::Logger::IsEnabled ( LogLevel  logLevel) const
noexcept

Determine whether a certian log level is enabled in the current context or not.

Parameters
logLevelInput log severity level
Returns
True if the level is enabled; otherwise false

◆ LogDebug()

LogStream ara::log::Logger::LogDebug ( ) const

Create a stream for debug logs.

Returns
Debug log stream in the current context
See also
WithLevel

◆ LogError()

LogStream ara::log::Logger::LogError ( ) const

Create a stream for error logs.

Returns
Error log stream in the current context
See also
WithLevel

◆ LogFatal()

LogStream ara::log::Logger::LogFatal ( ) const

Create a stream for fatal logs.

Returns
Fatal log stream in the current context
See also
WithLevel

◆ LogInfo()

LogStream ara::log::Logger::LogInfo ( ) const

Create a stream for information logs.

Returns
Information log stream in the current context
See also
WithLevel

◆ LogVerbose()

LogStream ara::log::Logger::LogVerbose ( ) const

Create a stream for verbose logs.

Returns
Verbose log stream in the current context
See also
WithLevel

◆ LogWarn()

LogStream ara::log::Logger::LogWarn ( ) const

Create a stream for warning logs.

Returns
Warning log stream in the current context
See also
WithLevel

◆ RemoteClientState()

ClientState ara::log::Logger::RemoteClientState ( ) const
noexcept

Remote logging client connection state.

Returns
Client connection state

◆ WithLevel()

LogStream ara::log::Logger::WithLevel ( LogLevel  logLevel) const

Create a stream for certian level logs.

Parameters
logLevelInput log severity level
Returns
Log stream with the determined level in the current context