You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor ReplaySafeLogger to use LoggerAdapter, add tests and docs
- Rewrite ReplaySafeLogger as a logging.LoggerAdapter subclass with a
single isEnabledFor() override instead of manual method delegation
- Add log() and isEnabledFor() methods with tests
- Add replay-safe logging section to docs/features.md
- Add usage example in examples/activity_sequence.py
- Add cross-package compatibility section to copilot-instructions.md
Copy file name to clipboardExpand all lines: docs/features.md
+41Lines changed: 41 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -150,6 +150,47 @@ Orchestrations can be suspended using the `suspend_orchestration` client API and
150
150
151
151
Orchestrations can specify retry policies for activities and sub-orchestrations. These policies control how many times and how frequently an activity or sub-orchestration will be retried in the event of a transient error.
152
152
153
+
### Replay-safe logging
154
+
155
+
Orchestrator functions replay their history each time they are resumed,
156
+
which can cause duplicate log messages. The `create_replay_safe_logger`
157
+
method on `OrchestrationContext` returns a `ReplaySafeLogger` that wraps
158
+
a standard `logging.Logger`and automatically suppresses output while
159
+
the orchestrator is replaying. `ReplaySafeLogger` extends Python's
160
+
`logging.LoggerAdapter`, which is the idiomatic way to add context or
0 commit comments