nl:: Weave:: Logging
此命名空間包含 Weave 中的所有介面,用於共用記錄支援。
摘要
這個介麵包括平台獨立於 Weave SDK 記錄介面的巨集、常數和函式。
Weave SDK 用戶端可在編譯期間選擇 Android、C 標準 I/O,或外部 (平台和整合商定義) 記錄樣式實作,而呼叫以下任一預先處理工具符號時就會叫用:
列舉 |
|
---|---|
@406
|
列舉 |
LogCategory
|
列舉 用於識別特定錯誤訊息所屬的類別。 |
LogModule
|
列舉 識別程式碼的邏輯部分,做為記錄訊息的來源。 |
Typedefs |
|
---|---|
LogMessageFunct)(uint8_t module, uint8_t category, const char *msg, va_list ap)
|
typedefvoid(*
|
Variables |
|
---|---|
ModuleNames[]
|
const char
|
gLogFilter = kLogCategory_Max
|
uint8_t
|
gLogFunct = DefaultLogMessage
|
LogMessageFunct
|
函式 |
|
---|---|
GetCategoryName(char *buf, uint8_t bufSize, uint8_t category)
|
void
|
GetLogFilter()
|
NL_DLL_EXPORT uint8_t
|
GetMessageWithPrefix(char *buf, uint8_t bufSize, uint8_t module, const char *msg)
|
void
|
GetModuleName(char *buf, uint8_t module)
|
void
|
Log(uint8_t module, uint8_t category, const char *msg, ...)
|
NL_DLL_EXPORT __WEAVE_LOGGING_LINK_ATTRIBUTE void
記錄至平台指定的機制,也就是提供的類別 category 中針對指定模組 module 的指定記錄訊息 msg。
|
PrintMessagePrefix(uint8_t module)
|
void
|
SetLogFilter(uint8_t category)
|
NL_DLL_EXPORT void
|
SetLogFunct(LogMessageFunct logFunct)
|
NL_DLL_EXPORT void
|
列舉
@406
@406
LogCategory
LogCategory
用於識別特定錯誤訊息所屬的類別。
LogModule
LogModule
識別程式碼的邏輯部分,做為記錄訊息的來源。
Typedefs
LogMessageFunct
void(* LogMessageFunct)(uint8_t module, uint8_t category, const char *msg, va_list ap)
Variables
ModuleNames
const char ModuleNames[]
gLogFilter
uint8_t gLogFilter = kLogCategory_Max
gLogFunct
LogMessageFunct gLogFunct = DefaultLogMessage
函式
GetCategoryName
void GetCategoryName( char *buf, uint8_t bufSize, uint8_t category )
GetLogFilter
NL_DLL_EXPORT uint8_t GetLogFilter()
GetMessageWithPrefix
void GetMessageWithPrefix( char *buf, uint8_t bufSize, uint8_t module, const char *msg )
GetModuleName
void GetModuleName( char *buf, uint8_t module )
物流業
NL_DLL_EXPORT __WEAVE_LOGGING_LINK_ATTRIBUTE void Log( uint8_t module, uint8_t category, const char *msg, ... )
記錄至平台指定的機制,也就是提供的類別 category 中針對指定模組 module 的指定記錄訊息 msg。
詳細說明 | |||||||||
---|---|---|---|---|---|---|---|---|---|
參數 |
|
PrintMessagePrefix
void PrintMessagePrefix( uint8_t module )
SetLogFilter
NL_DLL_EXPORT void SetLogFilter( uint8_t category )
SetLogFunct
NL_DLL_EXPORT void SetLogFunct( LogMessageFunct logFunct )