中间件API文档
无
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。 | |
Additional | const char* str = "hello world"; PrintLog("ABCD", 4, "%s", str); |
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: | 是一个函数宏。 | |
Additional | const char* str = "hello world"; PrintLocation("ABCD", 4, "%s", str); | |
Additional | uint32_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); |
LogStreamWrapper类是对LogStream类的封装。
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: | 构造函数。 |
Additional | Logger& 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(); |
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: | 发送当前日志缓冲区并启动新的消息流。 |
Additional | Logger& 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(); |
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: | 将给定的布尔类型值附加到内部消息缓冲区。 | |
Additional | bool boo = false; Logger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Info() << boo; |
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类型给定值附加到内部消息缓冲区。 | |
Additional | uint8_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; |
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类型值附加到内部消息缓冲区。 | |
Additional | uint16_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; |
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类型值附加到内部消息缓冲区。 | |
Additional | uint32_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; |
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类型值附加到内部消息缓冲区。 | |
Additional | uint64_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; |
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类型值附加到内部消息缓冲区。 | |
Additional | int8_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; |
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类型值附加到内部消息缓冲区。 | |
Additional | int16_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; |
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类型值附加到内部消息缓冲区。 | |
Additional | int32_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; |
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类型值附加到内部消息缓冲区。 | |
Additional | int64_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; |
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类型值附加到内部消息缓冲区。 | |
Additional | float val = 2.1; Logger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Info() << val; |
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类型值附加到内部消息缓冲区。 | |
Additional | double val = 2.12; Logger& MY_LOGGER = CreateLogger("MYLG", "my default context 1",LogLevel::kDebug); LoggerWrapper lt_wp{ MY_LOGGER }; lt_wp.Info() << val; |
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)}; |
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类型值附加到内部消息缓冲区。 | |
Additional | uint8_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); |
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,只是换了数据类型 |
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,只是换了数据类型 |
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,只是换了数据类型 |
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,只是换了数据类型 |