---
title: aclAppLog
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/runtimeapi/aclcppdevg_03_0029.html
sourcePath: /source/zh/canncommercial/900/API/runtimeapi/aclcppdevg_03_0029.html
indexId: eed6a58f34a28bd685e5cf59fc67484b2d8d3ba42c690b37b0360dd9357f6ca968
---
# aclAppLog

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | √ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | √ |
| Atlas 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |


#### 功能说明

将日志记录到日志文件中。

acl接口还提供了ACL_APP_LOG宏，封装aclAppLog接口，推荐用户调用ACL_APP_LOG宏，传入日志级别、日志描述、fmt中的可变参数。

```
#define ACL_APP_LOG(level, fmt, ...) \
    aclAppLog(level, __FUNCTION__, __FILE__, __LINE__, fmt, ##__VA_ARGS__)
```


#### 函数原型

```
void aclAppLog(aclLogLevel logLevel, const char *func, const char *file, uint32_t line, const char *fmt, ...)
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| logLevel | 输入 | 日志级别。 typedef enum { ACL\_DEBUG = 0, ACL\_INFO = 1, ACL\_WARNING = 2, ACL\_ERROR = 3, } aclLogLevel; |
| func | 输入 | 表示用户在哪个接口中调用aclAppLog接口，固定配置为\_\_FUNCTION\_\_ |
| file | 输入 | 表示用户在哪个文件中调用aclAppLog接口，固定配置为\_\_FILE\_\_ |
| line | 输入 | 表示用户在哪一行中调用aclAppLog接口，固定配置为\_\_LINE\_\_ |
| fmt | 输入 | 日志描述。 在调用格式化函数时，fmt中参数的类型、个数必须与实际参数类型、个数保持一致。 |
| ... | 输入 | fmt中的可变参数，根据日志内容添加。 单条日志最大长度为1024字节，超过则会截断。 |


#### 返回值说明

无


#### 调用示例

```
//若fmt中存在可变参数，需提前定义
uint32_t modelId = 1;
ACL_APP_LOG(ACL_INFO, "load model success, modelId is %u", modelId);
```
