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
feat(logger): add context manager for logger keys (#5883)
* add context manager to logger
* Passing the method implementation to the formatter class
* modify logger tests
* add examples to doc
---------
Co-authored-by: Leandro Damascena <[email protected]>
Copy file name to clipboardExpand all lines: docs/core/logger.md
+19
Original file line number
Diff line number
Diff line change
@@ -187,6 +187,25 @@ You can append your own keys to your existing Logger via `append_keys(**addition
187
187
188
188
This example will add `order_id` if its value is not empty, and in subsequent invocations where `order_id` might not be present it'll remove it from the Logger.
189
189
190
+
#### append_context_keys method
191
+
192
+
???+ warning
193
+
`append_context_keys` is not thread-safe.
194
+
195
+
The append_context_keys method allows temporary modification of a Logger instance's context without creating a new logger. It's useful for adding context keys to specific workflows while maintaining the logger's overall state and simplicity.
0 commit comments