aclAppLog
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Function
Saves logs to a file.
Acl APIs also provide the ACL_APP_LOG macro, which 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.
1 2 | #define ACL_APP_LOG(level, fmt, ...) \ aclAppLog(level, __FUNCTION__, __FILE__, __LINE__, fmt, ##__VA_ARGS__) |
Prototype
1 | 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 the actual ones. |
... |
Input |
A variable parameter in fmt, added based on the log content. The maximum length of a single log is 1024 bytes. If the length exceeds 1024 bytes, the log will be truncated. |
Returns
None
Example
1 2 3 | //If fmt contains variable parameters, define them in advance. uint32_t modelId = 1; ACL_APP_LOG(ACL_INFO, "load model success, modelId is %u", modelId); |