Logo
中文版
详情联系: neusar-support@reachauto.com
API 文档

1 说明

中间件API文档

2 头文件

3 功能定义

3.1 PrintLog

Symbol:middleware::logwrapper::PrintLog(const char* const context_id, const uint8_t log_level, const char* const format, ...)
Kind:function
Scope:namespace middleware::logwrapper
Visibility:public
Syntax:void PrintLog(const char* const context_id, const uint8_t log_level, const char* const format, ...);
Parameters (in):context_id上下文ID。
log_level日志级别,0-6分别表示OFF、FATAL、ERROR、WARN、INFO、DEBUG、VERBOSE,如果不在此范围,级别为WARN。
format格式化字符串。
参量表
Parameters (inout):none
Parameters (out):none
Return value:void-
Header file:#include " midware/log_wrapper /logging_wrapper.h"
Description:类似C语言的printf。
Additionalconst char* str = "hello world"; PrintLog("ABCD", 4, "%s", str);

3.2 PrintLocation

Symbol:middleware::logwrapper:: PrintLocation (const char* const context_id, uint8_t level, const char* const format, ...)
Kind:function
Scope:namespace middleware::logwrapper
Visibility:public
Syntax:PrintLocation (const char* const ctxId, uint8_t logLevel, const char* const format, ...);
Parameters (in):context_id上下文ID。
level日志级别,0-6分别表示OFF、FATAL、ERROR、WARN、INFO、DEBUG、VERBOSE,如果不在此范围,级别为WARN。
format格式化字符串。
参量表
Parameters (inout):none
Parameters (out):none
Return value:void-
Header file:#include " midware/log_wrapper /logging_wrapper.h"
Description:类似C语言的printf,会自动打印函数名,行号,函数名。
Notes:是一个函数宏。
Additionalconst char* str = "hello world"; PrintLocation("ABCD", 4, "%s", str);
Additionaluint32_t num_uint32_t = 216; Logger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); MY_LOGGER.LogInfo() << " some signed number in bin format:" << BinFormat(num_uint32_t);

4 类定义

4.1 LogStreamWrapper类

LogStreamWrapper类是对LogStream类的封装。

4.1.1 LogStreamWrapper:: LogStreamWrapper

Symbol:middleware::logwrapper::LogStreamWrapper::FlushLog() middleware::logwrapper::LogStreamWrapper() = delete; middleware::logwrapper::LogStreamWrapper(const LogStreamWrapper&) = delete; middleware::logwrapper::LogStreamWrapper& operator=(LogStreamWrapper&&) = delete; middleware::logwrapper::LogStreamWrapper(ara::log::LogLevel level, ara::log::Logger& logger); middleware::logwrapper::LogStreamWrapper(LogStreamWrapper&&);
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Syntax:LogStreamWrapper() = delete; LogStreamWrapper(const LogStreamWrapper&) = delete; LogStreamWrapper& operator=(LogStreamWrapper&&) = delete; LogStreamWrapper(ara::log::LogLevel level, ara::log::Logger& logger); LogStreamWrapper(LogStreamWrapper&&);
Visibility:public
Parameters (in):none
Parameters (inout):none
Parameters (out):none
Return value:None
Header file:#include "midware/logstream_wrapper.h"
Description:构造函数。
AdditionalLogger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); LoggerWrapper lt_wp{ MY_LOGGER }; LogStreamWrapper stream{ MY_LOGGER.Error()}; stream << " message......"; stream << " message2......"; stream.FlushLog();

4.1.2 LogStreamWrapper::FlushLog

Symbol:middleware::logwrapper::LogStreamWrapper::FlushLog()
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Syntax:void FlushLog () noexcept;
Visibility:public
Parameters (in):none
Parameters (inout):none
Parameters (out):none
Return value:None
Header file:#include "midware/logstream_wrapper.h"
Description:发送当前日志缓冲区并启动新的消息流。
AdditionalLogger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); LoggerWrapper lt_wp{ MY_LOGGER }; LogStreamWrapper stream{ MY_LOGGER.Error()}; stream << " message......"; stream << " message2......"; stream.FlushLog();

4.1.3 封装的本地支持类型的运算符

4.1.3.1 middleware::logwrapper::LogStreamWrapper::operator<< (const bool value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<(const bool value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const bool value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的布尔类型值。
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将给定的布尔类型值附加到内部消息缓冲区。
Additionalbool boo = false; Logger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Info() << boo;

4.1.3.2 middleware::logwrapper::LogStreamWrapper::operator<< (const uint8_t value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<(const uint8_t value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const uint8_t value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的uint8_t类型值
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将uint8_t类型给定值附加到内部消息缓冲区。
Additionaluint8_t num_uint8_t = 14; Logger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Info() << num_uint8_t;

4.1.3.3 middleware::logwrapper::LogStreamWrapper::operator<< (const uint16_t value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<(const uint16_t value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const uint16_t value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的uint16_t类型值
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将给定的uint16_t类型值附加到内部消息缓冲区。
Additionaluint16_t num_uint16_t = 256; Logger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Info() << num_uint16_t;

4.1.3.4 middleware::logwrapper::LogStreamWrapper::operator<< (const uint32_t value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<(const uint32_t value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const uint32_t value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的uint32_t类型值
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将给定的uint32_t类型值附加到内部消息缓冲区。
Additionaluint32_t num_uint32_t = 1235; Logger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Info() << num_uint32_t;

4.1.3.5 middleware::logwrapper::LogStreamWrapper::operator<< (const uint64_t value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<(const uint64_t value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const uint64_t value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的uint64_t类型值
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将给定的uint64_t类型值附加到内部消息缓冲区。
Additionaluint64_t num_uint64_t = 5668; Logger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Info() << num_uint64_t;

4.1.3.6 middleware::logwrapper::LogStreamWrapper::operator<< (const int8_t value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<(const int8_t value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const int8_t value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的int8_t类型值
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将给定int8_t类型值附加到内部消息缓冲区。
Additionalint8_t num_int8_t = 14; Logger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Info() << num_int8_t;

4.1.3.7 middleware::logwrapper::LogStreamWrapper::operator<< (const int16_t value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<(const int16_t value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const int16_t value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的int16_t类型值
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将给定的int16_t类型值附加到内部消息缓冲区。
Additionalint16_t num_int16_t = 256; Logger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Info() << num_int16_t;

4.1.3.8 middleware::logwrapper::LogStreamWrapper::operator<< (const int32_t value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<(const int32_t value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const int32_t value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的int32_t类型值
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将给定的int32_t类型值附加到内部消息缓冲区。
Additionalint32_t num_int32_t = 1235; Logger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Info() << num_int32_t;

4.1.3.9 middleware::logwrapper::LogStreamWrapper::operator<< (const int64_t value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<(const int64_t value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const int64_t value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的int64_t类型值
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将给定的int64_t类型值附加到内部消息缓冲区。
Additionalint64_t num_int64_t = 5668; Logger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Info() << num_int64_t;

4.1.3.10 middleware::logwrapper::LogStreamWrapper::operator<< (const float value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<(const float value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const float value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的float类型值。
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将给定的float类型值附加到内部消息缓冲区。
Additionalfloat val = 2.1; Logger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Info() << val;

4.1.3.11 middleware::logwrapper::LogStreamWrapper::operator<< (const double value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<(const double value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const double value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的double类型值。
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将给定的double类型值附加到内部消息缓冲区。
Additionaldouble val = 2.12; Logger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Info() << val;

4.1.3.12 middleware::logwrapper::LogStreamWrapper::operator<< (const LogRawBuffer &value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<( const LogRawBuffer &value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const LogRawBuffer &value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的LogRawBuffer类型值。
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将给定的LogRawBuffer类型值附加到内部消息缓冲区。
Additional定义结构体MyCustomStruct struct MyCustomStruct { int someInt; std::string someText; float someFloat; }; MyCustomStruct myData{1234, "myData", 3.333f}; Logger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Info() << LogRawBuffer{static_cast<const void*>(&myData), sizeof(MyCustomStruct)};

4.1.3.13 middleware::logwrapper::LogStreamWrapper::operator<< (const LogHex8 &value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<( const LogHex8 &value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const LogHex8 &value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的LogHex8类型值。
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将给定的LogHex8类型值附加到内部消息缓冲区。
Additionaluint8_t num_uint8_t = 20; Logger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Info() << HexFormat(num_uint8_t);

4.1.3.14 middleware::logwrapper::LogStreamWrapper::operator<< (const LogHex16 &value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<( const LogHex16 &value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const LogHex16 &value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的值。
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将给定值附加到内部消息缓冲区。
Additional参见4.1.2.13,只是换了数据类型

4.1.3.15 middleware::logwrapper::LogStreamWrapper::operator<< (const LogHex32 &value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<( const LogHex32 &value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const LogHex32 &value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的LogHex32类型值。
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将给定的LogHex32类型值附加到内部消息缓冲区。
Additional参见4.1.2.13,只是换了数据类型

4.1.3.16 middleware::logwrapper::LogStreamWrapper::operator<< (const LogHex64 &value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<( const LogHex64 &value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const LogHex64 &value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的LogHex64类型值。
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将给定的LogHex64类型值附加到内部消息缓冲区。
Additional参见4.1.2.13,只是换了数据类型

4.1.3.17 middleware::logwrapper::LogStreamWrapper::operator<< (const LogBin8 &value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<( const LogBin8 &value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const LogBin8 &value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的LogBin8类型值。
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将给定的LogBin8类型值附加到内部消息缓冲区。
Additional参见4.1.2.13,只是换了数据类型

4.1.3.18 middleware::logwrapper::LogStreamWrapper::operator<< (const LogBin16 &value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<( const LogBin16 &value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const LogBin16 &value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的LogBin16类型值。
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将给定的LogBin16类型值附加到内部消息缓冲区。
Additional参见4.1.2.13,只是换了数据类型

4.1.3.19 middleware::logwrapper::LogStreamWrapper::operator<< (const LogBin32 &value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<( const LogBin32 &value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const LogBin32 &value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的LogBin32类型值。
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将给定的LogBin32类型值附加到内部消息缓冲区。
Additional参见4.1.2.13,只是换了数据类型

4.1.3.20 middleware::logwrapper::LogStreamWrapper::operator<< (const LogBin64 &value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<( const LogBin64 &value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const LogBin64 &value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的LogBin64类型值。
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将给定的LogBin64类型值附加到内部消息缓冲区。
Additional参见4.1.2.13,只是换了数据类型

4.1.3.21 middleware::logwrapper::LogStreamWrapper::operator<< (const ara::core::StringView value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<(const ara::core::StringView value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const ara::core::StringView value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的StringView类型值。
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将给定的StringView类型值附加到内部消息缓冲区。
Additionalstd::string aa = "string"; ara::core::StringView stwi{aa.c_str(), aa.size()}; Logger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Info() << stwi;

4.1.3.22 middleware::logwrapper::LogStreamWrapper::operator<< (const char *const value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<( const char *const value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const char *const value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的值。
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将给定值附加到内部消息缓冲区。
Additionalconst char *cca = "cca"; char *const ccb = "ccb"; const char *const ccc = "ccc"; Logger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Info() << cca; lt_wp.Info() << ccb; lt_wp.Info() << ccc;

4.1.3.23 middleware::logwrapper::LogStreamWrapper::operator<< (const LogLevel value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<(const LogLevel value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const LogLevel value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的LogLevel类型值。
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将给定的LogLevel类型值附加到内部消息缓冲区。
AdditionalLogLevel lev = LogLevel::kInfo; Logger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Info() << lev;

4.1.3.24 middleware::logwrapper::LogStreamWrapper::operator<< (const ara::core::ErrorCode& value)

Symbol:middleware::logwrapper::LogStreamWrapper::operator<<(const ara::core::ErrorCode& value)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& operator<< (const ara::core::ErrorCode& value) noexcept;
Parameters (in):value要附加到内部消息缓冲区的值。
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:将给定值附加到内部消息缓冲区。
Additional参考4.1.2.21,只是换了数据类型

4.1.3.25 middleware::logwrapper::LogStreamWrapper:: WithLocation(const ara::core::StringView file, const int line, const ara::core::StringView func)

Symbol:middleware::logwrapper::LogStreamWrapper:: WithLocation(const ara::core::StringView file, const int line, const ara::core::StringView func)
Kind:function
Scope:class middleware::logwrapper::LogStreamWrapper
Visibility:public
Syntax:LogStreamWrapper& WithLocation(const ara::core::StringView file, const int line, const ara::core::StringView func) noexcept;
Parameters (in):file__FILE__。
Parameters (inout):line__LINE__
Parameters (out):func__FUNCTION__或__PRETTY_FUNCTION__
Return value:LogStreamWrapper &
Header file:#include " midware/log_wrapper /logstream_wrapper.h"
Description:输出文件名,行号,函数名信息。
Additionalbool val = true; Logger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Info().WithLocation(FILE, LINE, FUNCTION) << val;

4.2 LoggerWrapper类

LoggerWrapper类封装Logger类。

4.2.1 LoggerWrapper::Fatal

Symbol:middleware::logwrapper::LoggerWrapper::Fatal()
Kind:function
Scope:class middleware::logwrapper::LoggerWrapper
Visibility:public
Syntax:LoggerWrapper::Fatal();
Parameters (in):none
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper
Header file:#include " midware/log_wrapper /logger_wrapper.h"
AdditionalLogger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Info() << 1111; 对应打印fatal级别日志

4.2.2 LoggerWrapper::Error

Symbol:middleware::logwrapper::LoggerWrapper::Error()
Kind:function
Scope:class middleware::logwrapper::LoggerWrapper
Visibility:public
Syntax:LoggerWrapper::Error();
Parameters (in):none
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper
Header file:#include " midware/log_wrapper /logger_wrapper.h"
AdditionalLogger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kVerbose); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Error() << 1111; 对应打印error级别日志

4.2.3 LoggerWrapper::Warn

Symbol:middleware::logwrapper::LoggerWrapper::Warn()
Kind:function
Scope:class middleware::logwrapper::LoggerWrapper
Visibility:public
Syntax:LoggerWrapper::Warn();
Parameters (in):none
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper
Header file:#include " midware/log_wrapper /logger_wrapper.h"
AdditionalLogger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kVerbose); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Warn() << 1111; 对应打印warn级别日志

4.2.4 LoggerWrapper::Info

Symbol:middleware::logwrapper::LoggerWrapper::Info()
Kind:function
Scope:class middleware::logwrapper::LoggerWrapper
Visibility:public
Syntax:LoggerWrapper::Info();
Parameters (in):none
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper
Header file:#include " midware/log_wrapper /logger_wrapper.h"
AdditionalLogger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kVerbose); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Info() << 1111; 对应打印info级别日志

4.2.5 LoggerWrapper::Debug

Symbol:middleware::logwrapper::LoggerWrapper::Debug()
Kind:function
Scope:class middleware::logwrapper::LoggerWrapper
Visibility:public
Syntax:LoggerWrapper::Debug();
Parameters (in):none
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper
Header file:#include " midware/log_wrapper /logger_wrapper.h"
AdditionalLogger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kVerbose); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Debug() << 1111; 对应打印debug级别日志

4.2.6 LoggerWrapper::Verbose

Symbol:middleware::logwrapper::LoggerWrapper::Verbose()
Kind:function
Scope:class middleware::logwrapper::LoggerWrapper
Visibility:public
Syntax:LoggerWrapper::Verbose();
Parameters (in):none
Parameters (inout):none
Parameters (out):none
Return value:LogStreamWrapper
Header file:#include " midware/log_wrapper /logger_wrapper.h"
AdditionalLogger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kVerbose); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Verbose() << 1111; 对应打印verbose级别日志

5 ERROR