Backport module for sys.audit and sys.addaudithook mechanism
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Brett Langdon 58f152fb4d
Create LICENSE
5 years ago
.github/workflows fix quotes 5 years ago
sysaudit ignore .c files 5 years ago
tests fix up failing test 5 years ago
.gitignore ignore .c files 5 years ago
LICENSE Create LICENSE 5 years ago
README.md update package metadata 5 years ago
build.py convert to Poetry and Cython 5 years ago
poetry.lock update poetry lock 5 years ago
pyproject.toml bump version to 0.2.0 5 years ago

README.md

sysaudit

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

pip install sysaudit

Usage

sysaudit can be used as a drop-in replacement for sys.audit and sys.addaudithook.

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'})