Skip to content

Commit 32acd77

Browse files
docs: address feedback
1 parent ff9d2f4 commit 32acd77

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

docs/core/logger.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,37 @@ fields @timestamp, @message, execution_arn
503503

504504
**Q: Can I use a custom logger?**
505505

506-
Yes. Any logger that implements the `LoggerInterface` protocol (with `debug`, `info`, `warning`, `error`, `exception` methods) works with the SDK. Use `context.set_logger()` to set your custom logger.
506+
Yes. Any logger that implements the `LoggerInterface` protocol works with the SDK. Use `context.set_logger()` to set your custom logger.
507+
508+
The protocol is defined in `aws_durable_execution_sdk_python.types`:
509+
510+
```python
511+
from typing import Protocol
512+
from collections.abc import Mapping
513+
514+
class LoggerInterface(Protocol):
515+
def debug(
516+
self, msg: object, *args: object, extra: Mapping[str, object] | None = None
517+
) -> None: ...
518+
519+
def info(
520+
self, msg: object, *args: object, extra: Mapping[str, object] | None = None
521+
) -> None: ...
522+
523+
def warning(
524+
self, msg: object, *args: object, extra: Mapping[str, object] | None = None
525+
) -> None: ...
526+
527+
def error(
528+
self, msg: object, *args: object, extra: Mapping[str, object] | None = None
529+
) -> None: ...
530+
531+
def exception(
532+
self, msg: object, *args: object, extra: Mapping[str, object] | None = None
533+
) -> None: ...
534+
```
535+
536+
Any logger with these methods (like Python's standard `logging.Logger` or Powertools Logger) is compatible.
507537

508538
**Q: What's the difference between the SDK logger and Powertools for AWS Lambda (Python)?**
509539

0 commit comments

Comments
 (0)