Documentation
Includes
tuya_cloud_types.h
#include "tuya_cloud_types.h"
Macros
Marco _UNI_LOG_H
#define _UNI_LOG_H
Marco TY_LOG_LEVEL_ERR
#define TY_LOG_LEVEL_ERR 0 // error information
Marco TY_LOG_LEVEL_WARN
#define TY_LOG_LEVEL_WARN 1 // warnning information
Marco TY_LOG_LEVEL_NOTICE
#define TY_LOG_LEVEL_NOTICE 2 // notice information
Marco TY_LOG_LEVEL_INFO
#define TY_LOG_LEVEL_INFO 3 // information
Marco TY_LOG_LEVEL_DEBUG
#define TY_LOG_LEVEL_DEBUG 4 // debug information , should delete in release version
Marco TY_LOG_LEVEL_TRACE
#define TY_LOG_LEVEL_TRACE 5 // trace information , should delete in release version
Marco TY_DEAULT_LOG_LEVEL
#define TY_DEAULT_LOG_LEVEL TY_LOG_LEVEL_DEBUG
Marco TY_DEAULT_LOG_LEVEL
#define TY_DEAULT_LOG_LEVEL TY_LOG_LEVEL_INFO
Marco DEF_LOG_BUF_LEN
#define DEF_LOG_BUF_LEN 1024
Marco LOG_LEVEL_MIN
#define LOG_LEVEL_MIN 0
Marco LOG_LEVEL_MAX
#define LOG_LEVEL_MAX 5
Marco _THIS_FILE_NAME_
#define _THIS_FILE_NAME_ __FILE__
Marco SAK_PRINT_LOG(module,level,fmt, ...)
#define SAK_PRINT_LOG(module,level,fmt, ...) \
do \
{ \
PrintLog(module,level, \
_THIS_FILE_NAME_, __LINE__,\
fmt,##__VA_ARGS__); \
}while(0)
Marco TUYA_REDUCE_BIN_LEVEL1
#define TUYA_REDUCE_BIN_LEVEL1 1
Marco TUYA_REDUCE_BIN_LEVEL2
#define TUYA_REDUCE_BIN_LEVEL2 2
Marco TUYA_REDUCE_BIN_LEVEL3
#define TUYA_REDUCE_BIN_LEVEL3 3
Marco SAK_PRINT_ERR_LOG(fmt, ...)
#define SAK_PRINT_ERR_LOG(fmt, ...) \
do \
{ \
PrintErrLog(fmt,##__VA_ARGS__); \
}while(0)
Marco SAK_PRINT_WARN_LOG(fmt, ...)
#define SAK_PRINT_WARN_LOG(fmt, ...) \
do \
{ \
PrintWarnLog(fmt,##__VA_ARGS__); \
}while(0)
Marco SAK_PRINT_INFO_LOG(fmt, ...)
#define SAK_PRINT_INFO_LOG(fmt, ...) \
do \
{ \
PrintInfoLog(fmt,##__VA_ARGS__); \
}while(0)
Marco SAK_PRINT_NOTICE_LOG(fmt, ...)
#define SAK_PRINT_NOTICE_LOG(fmt, ...) \
do \
{ \
PrintNoticeLog(fmt,##__VA_ARGS__); \
}while(0)
Marco SAK_PRINT_DEBUG_LOG(fmt, ...)
#define SAK_PRINT_DEBUG_LOG(fmt, ...) \
do \
{ \
PrintDebugLog(fmt,##__VA_ARGS__); \
}while(0)
Marco SAK_PRINT_TRACE_LOG(fmt, ...)
#define SAK_PRINT_TRACE_LOG(fmt, ...) \
do \
{ \
PrintTraceLog(fmt,##__VA_ARGS__); \
}while(0)
Marco SAK_PRINT_ERR_LOG(fmt, ...)
#define SAK_PRINT_ERR_LOG(fmt, ...) \
do \
{ \
PrintErrLog(_THIS_FILE_NAME_, fmt,##__VA_ARGS__); \
}while(0)
Marco SAK_PRINT_WARN_LOG(fmt, ...)
#define SAK_PRINT_WARN_LOG(fmt, ...) \
do \
{ \
PrintWarnLog(_THIS_FILE_NAME_, fmt,##__VA_ARGS__); \
}while(0)
Marco SAK_PRINT_INFO_LOG(fmt, ...)
#define SAK_PRINT_INFO_LOG(fmt, ...) \
do \
{ \
PrintInfoLog(_THIS_FILE_NAME_, fmt,##__VA_ARGS__); \
}while(0)
Marco SAK_PRINT_NOTICE_LOG(fmt, ...)
#define SAK_PRINT_NOTICE_LOG(fmt, ...) \
do \
{ \
PrintNoticeLog(_THIS_FILE_NAME_, fmt,##__VA_ARGS__); \
}while(0)
Marco SAK_PRINT_DEBUG_LOG(fmt, ...)
#define SAK_PRINT_DEBUG_LOG(fmt, ...) \
do \
{ \
PrintDebugLog(_THIS_FILE_NAME_, fmt,##__VA_ARGS__); \
}while(0)
Marco SAK_PRINT_TRACE_LOG(fmt, ...)
#define SAK_PRINT_TRACE_LOG(fmt, ...) \
do \
{ \
PrintTraceLog(_THIS_FILE_NAME_, fmt,##__VA_ARGS__); \
}while(0)
Marco SAK_PRINT_ERR_LOG(fmt, ...)
#define SAK_PRINT_ERR_LOG(fmt, ...) \
do \
{ \
PrintErrLog(_THIS_FILE_NAME_, __LINE__, fmt,##__VA_ARGS__); \
}while(0)
Marco SAK_PRINT_WARN_LOG(fmt, ...)
#define SAK_PRINT_WARN_LOG(fmt, ...) \
do \
{ \
PrintWarnLog(_THIS_FILE_NAME_, __LINE__,fmt,##__VA_ARGS__); \
}while(0)
Marco SAK_PRINT_INFO_LOG(fmt, ...)
#define SAK_PRINT_INFO_LOG(fmt, ...) \
do \
{ \
PrintInfoLog(_THIS_FILE_NAME_, __LINE__,fmt,##__VA_ARGS__); \
}while(0)
Marco SAK_PRINT_NOTICE_LOG(fmt, ...)
#define SAK_PRINT_NOTICE_LOG(fmt, ...) \
do \
{ \
PrintNoticeLog(_THIS_FILE_NAME_, __LINE__,fmt,##__VA_ARGS__); \
}while(0)
Marco SAK_PRINT_DEBUG_LOG(fmt, ...)
#define SAK_PRINT_DEBUG_LOG(fmt, ...) \
do \
{ \
PrintDebugLog(_THIS_FILE_NAME_, __LINE__,fmt,##__VA_ARGS__); \
}while(0)
Marco SAK_PRINT_TRACE_LOG(fmt, ...)
#define SAK_PRINT_TRACE_LOG(fmt, ...) \
do \
{ \
PrintTraceLog(_THIS_FILE_NAME_, __LINE__,fmt,##__VA_ARGS__); \
}while(0)
Marco PR_TRACE(fmt, ...)
#define PR_TRACE(fmt, ...)
Marco PR_TRACE_ENTER()
#define PR_TRACE_ENTER()
Marco PR_TRACE_LEAVE
#define PR_TRACE_LEAVE()
Marco MPR_TRACE(module,fmt, ...)
#define MPR_TRACE(module,fmt, ...)
Marco PR_DEBUG(fmt, ...)
#define PR_DEBUG(fmt, ...)
Marco MPR_DEBUG(module,fmt, ...)
#define MPR_DEBUG(module,fmt, ...)
Marco PR_TRACE(fmt, ...)
#define PR_TRACE(fmt, ...) SAK_PRINT_TRACE_LOG(fmt, ##__VA_ARGS__)
Marco PR_TRACE_ENTER()
#define PR_TRACE_ENTER() PR_TRACE("enter [%s]", (const char*)__func__)
Marco PR_TRACE_LEAVE()
#define PR_TRACE_LEAVE() PR_TRACE("leave [%s]", (const char*)__func__)
Marco MPR_TRACE(module,fmt, ...)
#define MPR_TRACE(module,fmt, ...) SAK_PRINT_LOG(module,TY_LOG_LEVEL_TRACE, fmt, ##__VA_ARGS__)
Marco PR_DEBUG(fmt, ...)
#define PR_DEBUG(fmt, ...) SAK_PRINT_DEBUG_LOG(fmt, ##__VA_ARGS__)
Marco MPR_DEBUG(module,fmt, ...)
#define MPR_DEBUG(module,fmt, ...) SAK_PRINT_LOG(module,TY_LOG_LEVEL_DEBUG, fmt, ##__VA_ARGS__)
Marco PR_ERR(fmt, ...)
#define PR_ERR(fmt, ...) SAK_PRINT_ERR_LOG(fmt, ##__VA_ARGS__)
Marco PR_WARN(fmt, ...)
#define PR_WARN(fmt, ...) SAK_PRINT_WARN_LOG(fmt, ##__VA_ARGS__)
Marco PR_NOTICE(fmt, ...)
#define PR_NOTICE(fmt, ...) SAK_PRINT_NOTICE_LOG(fmt, ##__VA_ARGS__)
Marco PR_INFO(fmt, ...)
#define PR_INFO(fmt, ...) SAK_PRINT_INFO_LOG(fmt, ##__VA_ARGS__)
Marco SET_PR_DEBUG_LEVEL(level)
#define SET_PR_DEBUG_LEVEL(level) SetLogManageAttr(level)
Marco MPR_ERR(module,fmt, ...)
#define MPR_ERR(module,fmt, ...) SAK_PRINT_LOG(module,TY_LOG_LEVEL_ERR, fmt, ##__VA_ARGS__)
Marco MPR_WARN(module,fmt, ...)
#define MPR_WARN(module,fmt, ...) SAK_PRINT_LOG(module,TY_LOG_LEVEL_WARN, fmt, ##__VA_ARGS__)
Marco MPR_NOTICE(module,fmt, ...)
#define MPR_NOTICE(module,fmt, ...) SAK_PRINT_LOG(module,TY_LOG_LEVEL_NOTICE, fmt, ##__VA_ARGS__)
Marco MPR_INFO(module,fmt, ...)
#define MPR_INFO(module,fmt, ...) SAK_PRINT_LOG(module,TY_LOG_LEVEL_INFO, fmt, ##__VA_ARGS__)
Marco PR_DEBUG_RAW
#define PR_DEBUG_RAW(fmt, ...)
Marco PR_DEBUG_RAW(fmt, ...)
#define PR_DEBUG_RAW(fmt, ...) PrintLogRaw(fmt, ##__VA_ARGS__)
Marco PR_DEBUG_RAW
#define PR_DEBUG_RAW(fmt, ...)
Functions
Func PrintLog
int PrintLog(const char* pModuleName,
const LOG_LEVEL logLevel,
const char* pFile, const int line,
const char* pFmt,...);
Func PrintErrLog
int PrintErrLog(const char* pFmt,...);
Func PrintWarnLog
int PrintWarnLog(const char* pFmt,...);
Func PrintInfoLog
int PrintInfoLog(const char* pFmt,...);
Func PrintNoticeLog
int PrintNoticeLog(const char* pFmt,...);
Func PrintDebugLog
int PrintDebugLog(const char* pFmt,...);
Func PrintTraceLog
int PrintTraceLog(const char* pFmt,...);
Func PrintErrLog
int PrintErrLog(const char* pFile, const char* pFmt,...);
Func PrintWarnLog
int PrintWarnLog(const char* pFile, const char* pFmt,...);
Func PrintInfoLog
int PrintInfoLog(const char* pFile, const char* pFmt,...);
Func PrintNoticeLog
int PrintNoticeLog(const char* pFile, const char* pFmt,...);
Func PrintDebugLog
int PrintDebugLog(const char* pFile, const char* pFmt,...);
Func PrintTraceLog
int PrintTraceLog(const char* pFile, const char* pFmt,...);
Func PrintErrLog
int PrintErrLog(const char* pFile, const int line, const char* pFmt,...);
Func PrintWarnLog
int PrintWarnLog(const char* pFile, const int line, const char* pFmt,...);
Func PrintInfoLog
int PrintInfoLog(const char* pFile, const int line, const char* pFmt,...);
Func PrintNoticeLog
int PrintNoticeLog(const char* pFile, const int line, const char* pFmt,...);
Func PrintDebugLog
int PrintDebugLog(const char* pFile, const int line, const char* pFmt,...);
Func PrintTraceLog
int PrintTraceLog(const char* pFile, const int line, const char* pFmt,...);
Func CreateLogManageAndInit
OPERATE_RET CreateLogManageAndInit(IN CONST LOG_LEVEL curLogLevel,IN CONST INT_T buf_len,\
IN CONST LOG_OUTPUT output);
Func AddOutputTerm
OPERATE_RET AddOutputTerm(IN CONST CHAR_T *name,IN CONST LOG_OUTPUT term);
Func DelOutputTerm
VOID DelOutputTerm(IN CONST CHAR_T *name);
Func SetLogManageAttr
OPERATE_RET SetLogManageAttr(IN CONST LOG_LEVEL curLogLevel);
Func SetLogManagemtime
OPERATE_RET SetLogManagemtime(BOOL_T if_ms_level);
Func GetLogManageAttr
OPERATE_RET GetLogManageAttr(OUT LOG_LEVEL *pCurLogLevel);
Func AddModuleLevel
OPERATE_RET AddModuleLevel(IN CONST PCHAR_T pModuleName,\
IN CONST LOG_LEVEL logLevel);
Func SetModuleLevel
OPERATE_RET SetModuleLevel(IN CONST PCHAR_T pModuleName,\
LOG_LEVEL log_level);
Func GetModuleLevel
OPERATE_RET GetModuleLevel(IN CONST PCHAR_T pModuleName,\
OUT LOG_LEVEL *pLogLevel);
Func DeleteModuleLevel
OPERATE_RET DeleteModuleLevel(IN CONST PCHAR_T pModuleName);
Func PrintLogRaw
OPERATE_RET PrintLogRaw(IN CONST PCHAR_T pFmt,...);
Func ReleaseLogManage
VOID ReleaseLogManage(VOID);
Func tuya_debug_hex_dump
VOID tuya_debug_hex_dump(CHAR_T *title, UINT8_T width, UINT8_T *buf, UINT16_T size);
Vars
Consts
Types
Typedefs
Typedef LOG_LEVEL
typedef INT_T LOG_LEVEL;
Typedef LOG_OUTPUT
typedef VOID (*LOG_OUTPUT)(IN CONST CHAR_T *str);