aclAppLog
Description
Saves logs to a file.
The ACL_APP_LOG macro has encapsulated the aclAppLog API. You are advised to pass the variable parameters in the log level, log description, and fmt to the ACL_APP_LOG macro call. For details about log files, see Log Reference.
#define ACL_APP_LOG(level, fmt, ...) \
aclAppLog(level, __FUNCTION__, __FILE__, __LINE__, fmt, ##__VA_ARGS__)
Prototype
void aclAppLog(aclLogLevel logLevel, const char *func, const char *file, uint32_t line, const char *fmt, ...)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
logLevel |
Input |
Log level. typedef enum {
ACL_DEBUG = 0,
ACL_INFO = 1,
ACL_WARNING = 2,
ACL_ERROR = 3,
} aclLogLevel;
|
func |
Input |
API where aclAppLog is called. The value is fixed at __FUNCTION__. |
file |
Input |
File where aclAppLog is called. The value is fixed at __FILE__. |
line |
Input |
Line where aclAppLog is called. The value is fixed at __LINE__. |
fmt |
Input |
Log description. When the formatting function is called, the type and number of parameters in fmt must be the same as that in actuality. |
... |
Input |
A variable in fmt, added based on the log content. |
Returns
None
Example
//If fmt contains variables, define them in advance. uint32_t modelId = 1; ACL_APP_LOG(ACL_INFO, "load model success, modelId is %u", modelId);