4.58.0

(feat): Add support for logging to the generated SDK. Users can configure the logger by passing in a logging parameter to the client constructor.

1from acme import AcmeClient
2from acme.core import ConsoleLogger
3
4client = AcmeClient(
5 token="YOUR_TOKEN",
6 logging={
7 "level": "debug", # "info" is the default
8 "logger": ConsoleLogger(), # ConsoleLogger is the default
9 "silent": False, # True is the default, set to False to enable logging
10 }
11)

The logging parameter accepts a LogConfig dict with the following properties:

  • level: The log level to use. Defaults to "info".
  • logger: The logger to use. Defaults to ConsoleLogger.
  • silent: Whether to silence the logger. Defaults to True.

The level property can be one of the following values:

  • "debug"
  • "info"
  • "warn"
  • "error"

To provide a custom logger, pass an object implementing the ILogger protocol with debug, info, warn, and error methods.

Sensitive headers (authorization, x-api-key, cookie, etc.) are automatically redacted in logs.