Skip to content

Commit 9fe5997

Browse files
[3.13] gh-136697: Use the standard audit event format for sys.monitoring docs (GH-136747)
(cherry picked from commit 28937d3) Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
1 parent 46fe8e3 commit 9fe5997

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Doc/library/sys.monitoring.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,13 +314,17 @@ To register a callable for events call
314314
it is unregistered and returned.
315315
Otherwise :func:`register_callback` returns ``None``.
316316

317+
.. audit-event:: sys.monitoring.register_callback func sys.monitoring.register_callback
317318

318319
Functions can be unregistered by calling
319320
``sys.monitoring.register_callback(tool_id, event, None)``.
320321

321322
Callback functions can be registered and unregistered at any time.
322323

323-
Registering or unregistering a callback function will generate a :func:`sys.audit` event.
324+
Callbacks are called only once regardless if the event is turned on both
325+
globally and locally. As such, if an event could be turned on for both global
326+
and local events by your code then the callback needs to be written to handle
327+
either trigger.
324328

325329

326330
Callback function arguments

0 commit comments

Comments
 (0)