Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
ara::log::sink::LogSink Class Referenceabstract

Application logging sink. More...

#include <log_sink.h>

Inheritance diagram for ara::log::sink::LogSink:
ara::log::sink::ConsoleLogSink ara::log::sink::FileLogSink

Public Member Functions

virtual void Log (const LogStream &logStream) const =0
 Log a stream corresponds to the current application. More...
 

Protected Member Functions

 LogSink (std::string appId, std::string appDescription)
 Constructor. More...
 
LogStream GetAppstamp () const
 Get the application stamp (application ID and description) More...
 
LogStream GetTimestamp () const
 Get the current timestamp at the function call. More...
 

Protected Attributes

const std::string cWhitespace {" "}
 Whitespace constant character.
 

Detailed Description

Application logging sink.

Constructor & Destructor Documentation

◆ LogSink()

ara::log::sink::LogSink::LogSink ( std::string  appId,
std::string  appDescription 
)
protected

Constructor.

Parameters
appIdApplication ID
appDescriptionApplication description

Member Function Documentation

◆ GetAppstamp()

LogStream ara::log::sink::LogSink::GetAppstamp ( ) const
protected

Get the application stamp (application ID and description)

Returns
A log stream with the application stamp

◆ GetTimestamp()

LogStream ara::log::sink::LogSink::GetTimestamp ( ) const
protected

Get the current timestamp at the function call.

A log stream with the current long format date-time

◆ Log()

virtual void ara::log::sink::LogSink::Log ( const LogStream logStream) const
pure virtual

Log a stream corresponds to the current application.

Parameters
logStreamInput log stream

Implemented in ara::log::sink::ConsoleLogSink, and ara::log::sink::FileLogSink.