xakki-log-python 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- xakki_log_python-0.4.0/.env_dist +8 -0
- xakki_log_python-0.4.0/.gitattributes +16 -0
- xakki_log_python-0.4.0/.github/workflows/autotest.yml +36 -0
- xakki_log_python-0.4.0/.github/workflows/publish.yml +54 -0
- xakki_log_python-0.4.0/.gitignore +15 -0
- xakki_log_python-0.4.0/AGENTS.md +65 -0
- xakki_log_python-0.4.0/Dockerfile +11 -0
- xakki_log_python-0.4.0/LICENSE +674 -0
- xakki_log_python-0.4.0/Makefile +127 -0
- xakki_log_python-0.4.0/PKG-INFO +275 -0
- xakki_log_python-0.4.0/Pipfile +12 -0
- xakki_log_python-0.4.0/Pipfile.lock +24 -0
- xakki_log_python-0.4.0/Readme.md +243 -0
- xakki_log_python-0.4.0/TODO.md +187 -0
- xakki_log_python-0.4.0/mypy.ini +6 -0
- xakki_log_python-0.4.0/pdm.lock +12 -0
- xakki_log_python-0.4.0/poetry.lock +749 -0
- xakki_log_python-0.4.0/pyproject.toml +60 -0
- xakki_log_python-0.4.0/pytest.ini +4 -0
- xakki_log_python-0.4.0/ruff.toml +34 -0
- xakki_log_python-0.4.0/scripts/release.sh +83 -0
- xakki_log_python-0.4.0/src/log_python/__init__.py +160 -0
- xakki_log_python-0.4.0/src/log_python/config.py +144 -0
- xakki_log_python-0.4.0/src/log_python/const.py +41 -0
- xakki_log_python-0.4.0/src/log_python/context.py +575 -0
- xakki_log_python-0.4.0/src/log_python/formatters.py +217 -0
- xakki_log_python-0.4.0/src/log_python/handlers/__init__.py +1 -0
- xakki_log_python-0.4.0/src/log_python/handlers/redis.py +42 -0
- xakki_log_python-0.4.0/src/log_python/heartbeat.py +52 -0
- xakki_log_python-0.4.0/src/log_python/integrations/__init__.py +1 -0
- xakki_log_python-0.4.0/src/log_python/integrations/sqlalchemy.py +87 -0
- xakki_log_python-0.4.0/src/log_python/logtype.py +171 -0
- xakki_log_python-0.4.0/src/log_python/manager.py +394 -0
- xakki_log_python-0.4.0/src/log_python/py.typed +0 -0
- xakki_log_python-0.4.0/src/log_python/redactor.py +261 -0
- xakki_log_python-0.4.0/src/log_python/trace.py +504 -0
- xakki_log_python-0.4.0/tests/unit/test_config.py +200 -0
- xakki_log_python-0.4.0/tests/unit/test_const.py +39 -0
- xakki_log_python-0.4.0/tests/unit/test_context.py +522 -0
- xakki_log_python-0.4.0/tests/unit/test_extras.py +186 -0
- xakki_log_python-0.4.0/tests/unit/test_formatters.py +154 -0
- xakki_log_python-0.4.0/tests/unit/test_manager.py +489 -0
- xakki_log_python-0.4.0/tests/unit/test_redactor.py +610 -0
- xakki_log_python-0.4.0/tests/unit/test_setup.py +184 -0
- xakki_log_python-0.4.0/tests/unit/test_smoke.py +10 -0
- xakki_log_python-0.4.0/tests/unit/test_trace.py +505 -0
- xakki_log_python-0.4.0/uv.lock +633 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.git export-ignore
|
|
2
|
+
.github export-ignore
|
|
3
|
+
.idea export-ignore
|
|
4
|
+
.claude export-ignore
|
|
5
|
+
tests export-ignore
|
|
6
|
+
ruff.toml export-ignore
|
|
7
|
+
mypy.ini export-ignore
|
|
8
|
+
pytest.ini export-ignore
|
|
9
|
+
Makefile export-ignore
|
|
10
|
+
Dockerfile export-ignore
|
|
11
|
+
.env_dist export-ignore
|
|
12
|
+
uv.lock export-ignore
|
|
13
|
+
poetry.lock export-ignore
|
|
14
|
+
pdm.lock export-ignore
|
|
15
|
+
Pipfile export-ignore
|
|
16
|
+
Pipfile.lock export-ignore
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: Autotest
|
|
2
|
+
on: [push, pull_request]
|
|
3
|
+
|
|
4
|
+
permissions:
|
|
5
|
+
contents: read
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
test:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
name: Python ${{ matrix.python }}
|
|
11
|
+
strategy:
|
|
12
|
+
fail-fast: false
|
|
13
|
+
matrix:
|
|
14
|
+
python: ['3.11', '3.12', '3.13']
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout repository
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Setup Python ${{ matrix.python }}
|
|
20
|
+
uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: ${{ matrix.python }}
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: pip install --no-cache-dir .[dev]
|
|
26
|
+
|
|
27
|
+
- name: Run CodeStyle check
|
|
28
|
+
run: |
|
|
29
|
+
ruff format --check .
|
|
30
|
+
ruff check .
|
|
31
|
+
|
|
32
|
+
- name: Run mypy
|
|
33
|
+
run: mypy
|
|
34
|
+
|
|
35
|
+
- name: Run pytest
|
|
36
|
+
run: pytest
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
tags: ['v*']
|
|
5
|
+
|
|
6
|
+
permissions:
|
|
7
|
+
contents: read
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
- uses: actions/setup-python@v5
|
|
15
|
+
with:
|
|
16
|
+
python-version: '3.13'
|
|
17
|
+
- name: Build sdist and wheel
|
|
18
|
+
run: pip install --no-cache-dir build && python -m build
|
|
19
|
+
- uses: actions/upload-artifact@v4
|
|
20
|
+
with:
|
|
21
|
+
name: dist
|
|
22
|
+
path: dist/
|
|
23
|
+
|
|
24
|
+
publish:
|
|
25
|
+
needs: build
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
environment: pypi
|
|
28
|
+
permissions:
|
|
29
|
+
id-token: write # Trusted Publishing (OIDC), no token stored
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/download-artifact@v4
|
|
32
|
+
with:
|
|
33
|
+
name: dist
|
|
34
|
+
path: dist/
|
|
35
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
36
|
+
|
|
37
|
+
github-release:
|
|
38
|
+
needs: publish
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
permissions:
|
|
41
|
+
contents: write # create the release and attach dist files
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/download-artifact@v4
|
|
44
|
+
with:
|
|
45
|
+
name: dist
|
|
46
|
+
path: dist/
|
|
47
|
+
- name: Create GitHub Release
|
|
48
|
+
env:
|
|
49
|
+
GH_TOKEN: ${{ github.token }}
|
|
50
|
+
run: >
|
|
51
|
+
gh release create "$GITHUB_REF_NAME" dist/*
|
|
52
|
+
--repo "$GITHUB_REPOSITORY"
|
|
53
|
+
--title "$GITHUB_REF_NAME"
|
|
54
|
+
--generate-notes
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# AGENTS.md — xakki-log-python
|
|
2
|
+
|
|
3
|
+
Python structured-logging library (dist `xakki-log-python`, import `log_python`,
|
|
4
|
+
src-layout `src/log_python/`). Port of PHP/Laravel `xakki/log-laravel` at
|
|
5
|
+
`/home/xakki/libs/log-laravel` — that repo is the normative reference for BOTH
|
|
6
|
+
structure and semantics. Its `docs/LoggingRules.md` and
|
|
7
|
+
`docs/ContextFieldNaming.md` are the language-agnostic spec this port must
|
|
8
|
+
conform to; `docs/PhytonLog.md` covers the fluent-bit/Graylog ingestion path.
|
|
9
|
+
The spec is read from there (linked from `Readme.md`) and is deliberately NOT
|
|
10
|
+
copied into this repo — do not propose porting `docs/`.
|
|
11
|
+
|
|
12
|
+
**Status: phases 0–9 implemented.** Core enrichment, formatters,
|
|
13
|
+
`log_python.setup()`, exception hooks, context binding, Redis/SQLAlchemy extras and
|
|
14
|
+
heartbeat are present. `TODO.md` is the release handoff and records remaining
|
|
15
|
+
owner/operator actions. The historical `.claude/` plan is staged for deletion;
|
|
16
|
+
do not unstage or re-add it without owner direction.
|
|
17
|
+
|
|
18
|
+
## Docker-only — no bare-host toolchain
|
|
19
|
+
|
|
20
|
+
Every operation goes through a `make` target — never invoke bare
|
|
21
|
+
`python`/`pip`/`pytest`/`ruff`/`mypy`/`uv`/`poetry`/`pdm`/`pipenv` on the
|
|
22
|
+
host. Missing target → add it to the Makefile, don't run the tool directly.
|
|
23
|
+
Every `docker run`, including one-off containers, needs both `--cpus` and
|
|
24
|
+
`--memory`.
|
|
25
|
+
|
|
26
|
+
## Field-name/type stability contract
|
|
27
|
+
|
|
28
|
+
A context field name must never emit two different JSON types across
|
|
29
|
+
services — OpenSearch silently drops the whole document on a type mismatch.
|
|
30
|
+
This is why the context type-coercion rules (suffix-driven `*_int` /
|
|
31
|
+
`*_float` / `*_bool` escape hatches, whole-segment matching, snake_case)
|
|
32
|
+
must be ported 1:1 from the reference, and are covered by a large
|
|
33
|
+
parametrized test table. Do not "simplify" this logic.
|
|
34
|
+
|
|
35
|
+
## Never grow a lint/type baseline
|
|
36
|
+
|
|
37
|
+
mypy runs `--strict` with no baseline; ruff has no suppression file. Fix the
|
|
38
|
+
code, don't silence the checker. Adding any baseline/ignore file requires
|
|
39
|
+
explicit owner approval.
|
|
40
|
+
|
|
41
|
+
## Secrets never get logged
|
|
42
|
+
|
|
43
|
+
Redaction (see reference `src/Redactor.php`) is a security-critical code
|
|
44
|
+
path. Any change to it needs tests proving the secret value never appears
|
|
45
|
+
in output.
|
|
46
|
+
|
|
47
|
+
## Before finishing
|
|
48
|
+
|
|
49
|
+
`make test` green (cs-check + mypy + pytest). If packaging metadata changed,
|
|
50
|
+
also run `make test-install`; before release also run `make build`.
|
|
51
|
+
|
|
52
|
+
## Local skills
|
|
53
|
+
|
|
54
|
+
Project-local skills live in `.agents/skills/<name>/SKILL.md` (gitignored, so
|
|
55
|
+
present only in the owner's checkout). Read before the matching work:
|
|
56
|
+
|
|
57
|
+
- `release-pypi` — cutting and verifying a release (`make release-publish`,
|
|
58
|
+
`make pypi-verify`, Trusted Publishing, PyPI index lag).
|
|
59
|
+
- `agent-session-gotchas` — hook and Docker-only pitfalls when running commands.
|
|
60
|
+
|
|
61
|
+
## No-touch
|
|
62
|
+
|
|
63
|
+
`.env` (registry creds), the four lock files (`uv.lock`, `poetry.lock`,
|
|
64
|
+
`pdm.lock`, `Pipfile.lock` — regenerate via `make lock`, never hand-edit),
|
|
65
|
+
`LICENSE`.
|