On this page
sys.audit
Prev: sys.addaudithook | Up: sys | Next: sys.breakpointhook
Rel: sys.activate_stack_trampoline, sys.addaudithook, sys.breakpointhook, sys.call_tracing
Ref: docs.python.org — sys.audit
Tags: #public #python3 #stdlib #sys
Import
import sys
from sys import audit
Signature & Overview
sys.audit(event, /, *args)
Passes the event to any audit hooks that are attached.
Usage
import sys
# Emit a custom audit event to any hooks registered via sys.addaudithook()
sys.audit("myapp.config_loaded", "prod")
Gotchas
- Zero-cost when no hooks are registered: Library authors can emit custom audit events without impacting normal performance.
REPL Inspect
from sys import audit
help(audit)
Linked from
- tuts/python3/stdlib_module/sys
- tuts/python3/stdlib_module/sys/activate_stack_trampoline
- tuts/python3/stdlib_module/sys/addaudithook
- tuts/python3/stdlib_module/sys/breakpointhook
- tuts/python3/stdlib_module/sys/call_tracing
- tuts/python3/stdlib_module/sys/deactivate_stack_trampoline
- tuts/python3/stdlib_module/sys/displayhook
- tuts/python3/stdlib_module/sys/exc_info
- tuts/python3/stdlib_module/sys/excepthook
- tuts/python3/stdlib_module/sys/exception
- tuts/python3/stdlib_module/sys/exit
- tuts/python3/stdlib_module/sys/get_asyncgen_hooks
- tuts/python3/stdlib_module/sys/get_coroutine_origin_tracking_depth
- tuts/python3/stdlib_module/sys/get_int_max_str_digits
- tuts/python3/stdlib_module/sys/getallocatedblocks
- tuts/python3/stdlib_module/sys/getdefaultencoding
- tuts/python3/stdlib_module/sys/getdlopenflags
- tuts/python3/stdlib_module/sys/getfilesystemencodeerrors
- tuts/python3/stdlib_module/sys/getfilesystemencoding
- tuts/python3/stdlib_module/sys/getprofile
- tuts/python3/stdlib_module/sys/getrecursionlimit
- tuts/python3/stdlib_module/sys/getrefcount
- tuts/python3/stdlib_module/sys/getsizeof
- tuts/python3/stdlib_module/sys/getswitchinterval
- tuts/python3/stdlib_module/sys/gettrace
- tuts/python3/stdlib_module/sys/getunicodeinternedsize
- tuts/python3/stdlib_module/sys/intern
- tuts/python3/stdlib_module/sys/is_finalizing
- tuts/python3/stdlib_module/sys/is_remote_debug_enabled
- tuts/python3/stdlib_module/sys/is_stack_trampoline_active
- tuts/python3/stdlib_module/sys/remote_exec
- tuts/python3/stdlib_module/sys/set_asyncgen_hooks
- tuts/python3/stdlib_module/sys/set_coroutine_origin_tracking_depth
- tuts/python3/stdlib_module/sys/set_int_max_str_digits
- tuts/python3/stdlib_module/sys/setdlopenflags
Related notes
- tuts/python3/stdlib_module/sys/activate_stack_trampoline Linked here; links to this page; shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys/addaudithook Linked here; links to this page; shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys/breakpointhook Linked here; links to this page; shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys/call_tracing Linked here; links to this page; shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sys/deactivate_stack_trampoline links to this page; shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys/displayhook links to this page; shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys/exc_info links to this page; shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys/excepthook links to this page; shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys/exception links to this page; shared tags: #stdlib, #sys