> This page is for SDK, version Legacy.
> For other versions, use one of these documentation indexes:
> - Current (default): https://buildwithfern.com/learn/sdks/current/llms.txt
> - Legacy: https://buildwithfern.com/learn/sdks/legacy/llms.txt

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

## 4.58.0

**`(feat):`** 为生成的 SDK 添加日志记录支持。
用户可以通过向客户端构造函数传递 `logging` 参数来配置日志记录器。

```python
from acme import AcmeClient
from acme.core import ConsoleLogger

client = AcmeClient(
    token="YOUR_TOKEN",
    logging={
        "level": "debug",  # "info" 是默认值
        "logger": ConsoleLogger(),  # ConsoleLogger 是默认值
        "silent": False,  # True 是默认值，设置为 False 以启用日志记录
    }
)
```

`logging` 参数接受一个包含以下属性的 `LogConfig` 字典：

* `level`：要使用的日志级别。默认为 `"info"`。
* `logger`：要使用的日志记录器。默认为 `ConsoleLogger`。
* `silent`：是否静默日志记录器。默认为 `True`。

`level` 属性可以是以下值之一：

* `"debug"`
* `"info"`
* `"warn"`
* `"error"`

要提供自定义日志记录器，请传递一个实现 `ILogger` 协议的对象，该对象具有 `debug`、`info`、`warn` 和 `error` 方法。

敏感头部信息（`authorization`、`x-api-key`、`cookie` 等）会在日志中自动被编辑。