Woman, Life, Freedom


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

Logging framework which links loggers to a log sink. More...

#include <logging_framework.h>

Public Member Functions

const LoggerCreateLogger (std::string ctxId, std::string ctxDescription)
 Create a logger. More...
 
const LoggerCreateLogger (std::string ctxId, std::string ctxDescription, LogLevel ctxDefLogLevel)
 Create a logger. More...
 
void Log (const Logger &logger, LogLevel logLevel, const LogStream &logStream)
 Log a stream to the determined sink. More...
 

Static Public Member Functions

static LoggingFrameworkCreate (std::string appId, LogMode logMode, LogLevel logLevel=LogLevel::kWarn, std::string appDescription="")
 Logging framework factory. More...
 
static LoggingFrameworkCreate (std::string appId, std::string filePath, LogLevel logLevel=LogLevel::kWarn, std::string appDescription="")
 Logging framework factory only for file sinks. More...
 

Detailed Description

Logging framework which links loggers to a log sink.

Member Function Documentation

◆ Create() [1/2]

LoggingFramework * ara::log::LoggingFramework::Create ( std::string  appId,
LogMode  logMode,
LogLevel  logLevel = LogLevel::kWarn,
std::string  appDescription = "" 
)
static

Logging framework factory.

Parameters
appIdApplication ID
logModeLog sink mode
logLevelLog severity level
appDescriptionApplication description
Returns
Pointer to created logging framework
Exceptions
std::invalid_argumentThrows when file log mode is chosen
Note
To create a framework to use a file sink refer to see aslo
See also
Create(std::string, std::string, LogLevel, std::string)

◆ Create() [2/2]

LoggingFramework * ara::log::LoggingFramework::Create ( std::string  appId,
std::string  filePath,
LogLevel  logLevel = LogLevel::kWarn,
std::string  appDescription = "" 
)
static

Logging framework factory only for file sinks.

Parameters
appIdApplication ID
filePathLog file path
logLevelLog severity level
appDescriptionApplication description
Returns
Pointer to created logging framework
Note
To create a framework for other sinks refer to see also
See also
Create(std::string, LogMode, LogLevel, std::string)

◆ CreateLogger() [1/2]

const Logger & ara::log::LoggingFramework::CreateLogger ( std::string  ctxId,
std::string  ctxDescription 
)

Create a logger.

Parameters
ctxIdLog context ID
ctxDescriptionLog context description
Returns
A logger

◆ CreateLogger() [2/2]

const Logger & ara::log::LoggingFramework::CreateLogger ( std::string  ctxId,
std::string  ctxDescription,
LogLevel  ctxDefLogLevel 
)

Create a logger.

Parameters
ctxIdLog context ID
ctxDescriptionLog context description
ctxDefLogLevelLog context default log level
Returns
A logger

◆ Log()

void ara::log::LoggingFramework::Log ( const Logger logger,
LogLevel  logLevel,
const LogStream logStream 
)

Log a stream to the determined sink.

Parameters
loggerA logger
logLevelLog severity level
logStreamStream to be logged