Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
log_sink.h
1#ifndef LOG_SINK_H
2#define LOG_SINK_H
3
4#include <ctime>
5#include "../log_stream.h"
6
7namespace ara
8{
9 namespace log
10 {
11 namespace sink
12 {
14 class LogSink
15 {
16 private:
17 std::string mApplicationId;
18 std::string mApplicationDescription;
19
20 protected:
22 const std::string cWhitespace{" "};
23
27 LogSink(std::string appId, std::string appDescription);
28
31 LogStream GetAppstamp() const;
32
35 LogStream GetTimestamp() const;
36
37 public:
38 virtual ~LogSink() noexcept = default;
39
42 virtual void Log(const LogStream &logStream) const = 0;
43 };
44 }
45 }
46}
47
48#endif
A stream pipeline to combine log entities.
Definition: log_stream.h:17
Application logging sink.
Definition: log_sink.h:15
LogSink(std::string appId, std::string appDescription)
Constructor.
Definition: log_sink.cpp:9
const std::string cWhitespace
Whitespace constant character.
Definition: log_sink.h:22
LogStream GetTimestamp() const
Get the current timestamp at the function call.
Definition: log_sink.cpp:27
LogStream GetAppstamp() const
Get the application stamp (application ID and description)
Definition: log_sink.cpp:14
virtual void Log(const LogStream &logStream) const =0
Log a stream corresponds to the current application.