https://github.com/brettlangdon/sysaudit
Backport module for sys.audit and sys.addaudithook mechanism
https://github.com/brettlangdon/sysaudit
audit backport hooks pypy python2 python3 sys
Last synced: 7 months ago
JSON representation
Backport module for sys.audit and sys.addaudithook mechanism
- Host: GitHub
- URL: https://github.com/brettlangdon/sysaudit
- Owner: brettlangdon
- License: mit
- Created: 2020-02-02T00:36:42.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-09-03T21:04:25.000Z (over 1 year ago)
- Last Synced: 2025-05-24T15:07:18.152Z (10 months ago)
- Topics: audit, backport, hooks, pypy, python2, python3, sys
- Language: Python
- Homepage: https://sysaudit.readthedocs.io/
- Size: 131 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
sysaudit
========
.. image:: https://readthedocs.org/projects/sysaudit/badge/?version=latest
:target: https://sysaudit.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://github.com/brettlangdon/sysaudit/workflows/Build/badge.svg?branch=main&event=push
:target: https://github.com/brettlangdon/sysaudit/actions?query=branch%3Amain+workflow%3ABuild+event%3Apush
:alt: Build status
Backport module of `sys.audit `_
and `sys.addaudithook `_
from Python 3.8.
**Note:** This module does *not* backport any of the built-in
`audit events `_.
Installation
------------
.. code-block:: bash
pip install sysaudit
Quick Usage
-----------
`sysaudit` can be used as a drop-in replacement for `sys.audit` and `sys.addaudithook`.
.. code-block:: python
import sysaudit
def hook(event, args):
print("Event:", event, args)
sysaudit.addaudithook(hook)
sysaudit.audit("event_name", 1, 2, dict(key="value"))
# Event: event_name (1, 2, {'key': 'value'})