pylogshield 0.0.1__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.
- pylogshield-0.0.1/.github/workflows/release.yml +116 -0
- pylogshield-0.0.1/.gitignore +189 -0
- pylogshield-0.0.1/LICENSE.txt +21 -0
- pylogshield-0.0.1/PKG-INFO +121 -0
- pylogshield-0.0.1/README.md +94 -0
- pylogshield-0.0.1/docs/cli_usage.md +214 -0
- pylogshield-0.0.1/docs/css/extra.css +3 -0
- pylogshield-0.0.1/docs/img/favicon/favicon-16x16.png +0 -0
- pylogshield-0.0.1/docs/img/favicon/favicon-32x32.png +0 -0
- pylogshield-0.0.1/docs/img/favicon/favicon.ico +0 -0
- pylogshield-0.0.1/docs/img/logo.png +0 -0
- pylogshield-0.0.1/docs/img/pylogshield.png +0 -0
- pylogshield-0.0.1/docs/img/pylogshield_192x192.png +0 -0
- pylogshield-0.0.1/docs/index.md +74 -0
- pylogshield-0.0.1/docs/installation.md +12 -0
- pylogshield-0.0.1/docs/references/config.md +5 -0
- pylogshield-0.0.1/docs/references/filters.md +5 -0
- pylogshield-0.0.1/docs/references/handlers.md +5 -0
- pylogshield-0.0.1/docs/references/logger.md +1 -0
- pylogshield-0.0.1/docs/references/utils.md +1 -0
- pylogshield-0.0.1/docs/references/viewer.md +1 -0
- pylogshield-0.0.1/docs/usage.md +406 -0
- pylogshield-0.0.1/mkdocs.yml +168 -0
- pylogshield-0.0.1/pyproject.toml +49 -0
- pylogshield-0.0.1/requirements.txt +2 -0
- pylogshield-0.0.1/setup.cfg +4 -0
- pylogshield-0.0.1/setup.py +45 -0
- pylogshield-0.0.1/src/pylogshield/__init__.py +98 -0
- pylogshield-0.0.1/src/pylogshield/__main__.py +13 -0
- pylogshield-0.0.1/src/pylogshield/_version.py +34 -0
- pylogshield-0.0.1/src/pylogshield/cli.py +77 -0
- pylogshield-0.0.1/src/pylogshield/config.py +142 -0
- pylogshield-0.0.1/src/pylogshield/core.py +498 -0
- pylogshield-0.0.1/src/pylogshield/filters.py +123 -0
- pylogshield-0.0.1/src/pylogshield/handlers.py +242 -0
- pylogshield-0.0.1/src/pylogshield/limiter.py +143 -0
- pylogshield-0.0.1/src/pylogshield/metrics.py +106 -0
- pylogshield-0.0.1/src/pylogshield/py.typed +0 -0
- pylogshield-0.0.1/src/pylogshield/utils.py +217 -0
- pylogshield-0.0.1/src/pylogshield/viewer.py +321 -0
- pylogshield-0.0.1/src/pylogshield.egg-info/PKG-INFO +121 -0
- pylogshield-0.0.1/src/pylogshield.egg-info/SOURCES.txt +44 -0
- pylogshield-0.0.1/src/pylogshield.egg-info/dependency_links.txt +1 -0
- pylogshield-0.0.1/src/pylogshield.egg-info/entry_points.txt +2 -0
- pylogshield-0.0.1/src/pylogshield.egg-info/requires.txt +2 -0
- pylogshield-0.0.1/src/pylogshield.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# ==============================================================================
|
|
2
|
+
# 🚢 Release Workflow — Project Caller
|
|
3
|
+
# ==============================================================================
|
|
4
|
+
# Save this file in YOUR PROJECT repo at:
|
|
5
|
+
# .github/workflows/release.yml
|
|
6
|
+
#
|
|
7
|
+
# TRIGGERS & JOB MATRIX:
|
|
8
|
+
#
|
|
9
|
+
# Event │ docs │ publish
|
|
10
|
+
# ─────────────────┼──────┼────────
|
|
11
|
+
# Push to main │ ✅ │ ⛔
|
|
12
|
+
# Push tag X.X.X │ ⛔ │ ✅
|
|
13
|
+
# Manual dispatch │ ✅ │ ⛔
|
|
14
|
+
#
|
|
15
|
+
# PUBLISH TARGET FLAG (controls where the package is published):
|
|
16
|
+
#
|
|
17
|
+
# publish-target: 'both' → TestPyPI first, then PyPI ← default
|
|
18
|
+
# publish-target: 'pypi' → PyPI only
|
|
19
|
+
# publish-target: 'testpypi' → TestPyPI only
|
|
20
|
+
#
|
|
21
|
+
# RELEASE FLOW:
|
|
22
|
+
# 1. Merge PRs to main as normal — docs deploy automatically
|
|
23
|
+
# 2. When ready to release, push a bare SemVer tag:
|
|
24
|
+
# git tag 1.2.1
|
|
25
|
+
# git push origin 1.2.1
|
|
26
|
+
# 3. The publish job runs: validate → test → build → testpypi → pypi
|
|
27
|
+
#
|
|
28
|
+
# SECRETS REQUIRED (Settings → Secrets and variables → Actions):
|
|
29
|
+
# TEST_PYPI_API_TOKEN — from test.pypi.org/manage/account/token/
|
|
30
|
+
# PYPI_API_TOKEN — from pypi.org (only if not using Trusted Publishing)
|
|
31
|
+
#
|
|
32
|
+
# PRE-REQUISITES (once per project):
|
|
33
|
+
#
|
|
34
|
+
# 1. Enable GitHub Pages:
|
|
35
|
+
# Settings → Pages → Source → GitHub Actions
|
|
36
|
+
#
|
|
37
|
+
# 2. Create GitHub Environments:
|
|
38
|
+
# Settings → Environments → New environment
|
|
39
|
+
# - "pypi" (real PyPI — add Required reviewers for safety)
|
|
40
|
+
# - "test-pypi" (TestPyPI sandbox — no reviewers needed)
|
|
41
|
+
#
|
|
42
|
+
# 3. Register Trusted Publisher on pypi.org:
|
|
43
|
+
# pypi.org → your project → Publishing → Add publisher
|
|
44
|
+
# owner = vertex-ai-automations
|
|
45
|
+
# repo = THIS-REPO-NAME
|
|
46
|
+
# workflow = release.yml
|
|
47
|
+
# env = pypi
|
|
48
|
+
#
|
|
49
|
+
# 4. Create docs/requirements.txt:
|
|
50
|
+
# mkdocs-material==9.5.18
|
|
51
|
+
# mkdocstrings[python]==0.24.3
|
|
52
|
+
#
|
|
53
|
+
# CUSTOMISE PER PROJECT:
|
|
54
|
+
# python-version — match your project's Python version
|
|
55
|
+
# test-command — your test runner command
|
|
56
|
+
# publish-target — 'both' | 'pypi' | 'testpypi'
|
|
57
|
+
# src-layout — true if you use a src/ directory layout
|
|
58
|
+
# mkdocs-strict — false to allow doc build warnings
|
|
59
|
+
# ==============================================================================
|
|
60
|
+
|
|
61
|
+
name: 🚢 Release
|
|
62
|
+
|
|
63
|
+
on:
|
|
64
|
+
push:
|
|
65
|
+
branches:
|
|
66
|
+
- main # Docs deploy only
|
|
67
|
+
tags:
|
|
68
|
+
- "*.*.*" # Publish only — bare SemVer e.g. 1.2.1
|
|
69
|
+
workflow_dispatch: # Manual trigger — docs only
|
|
70
|
+
|
|
71
|
+
jobs:
|
|
72
|
+
|
|
73
|
+
# ============================================================
|
|
74
|
+
# 📚 Deploy MkDocs to GitHub Pages
|
|
75
|
+
# Runs on: push to main, manual dispatch
|
|
76
|
+
# ============================================================
|
|
77
|
+
docs:
|
|
78
|
+
name: 📚 Deploy Docs
|
|
79
|
+
uses: vertex-ai-automations/shared-workflows/.github/workflows/publish-mkdocs.yml@main
|
|
80
|
+
permissions:
|
|
81
|
+
contents: read
|
|
82
|
+
pages: write
|
|
83
|
+
id-token: write
|
|
84
|
+
with:
|
|
85
|
+
python-version: "3.11"
|
|
86
|
+
docs-requirements: "docs/requirements.txt"
|
|
87
|
+
src-layout: true # ← set false if not using src/ layout
|
|
88
|
+
mkdocs-strict: true # ← set false to allow doc build warnings
|
|
89
|
+
secrets: inherit
|
|
90
|
+
|
|
91
|
+
# ============================================================
|
|
92
|
+
# 📦 Build and Publish Package
|
|
93
|
+
# Runs on: tag push only (tag guard is enforced inside the
|
|
94
|
+
# reusable workflow — non-tag pushes skip cleanly)
|
|
95
|
+
#
|
|
96
|
+
# publish-target controls which registries receive the package:
|
|
97
|
+
# 'both' → TestPyPI first, then PyPI (recommended)
|
|
98
|
+
# 'pypi' → PyPI only
|
|
99
|
+
# 'testpypi' → TestPyPI only
|
|
100
|
+
#
|
|
101
|
+
# No permissions block needed — declared inside python-publish.yml
|
|
102
|
+
# ============================================================
|
|
103
|
+
publish:
|
|
104
|
+
name: 📦 Publish Package
|
|
105
|
+
uses: vertex-ai-automations/shared-workflows/.github/workflows/python-publish.yml@main
|
|
106
|
+
permissions:
|
|
107
|
+
contents: read
|
|
108
|
+
id-token: write
|
|
109
|
+
with:
|
|
110
|
+
python-version: "3.11"
|
|
111
|
+
run-tests: true
|
|
112
|
+
test-command: "pytest tests/ -v --tb=short"
|
|
113
|
+
publish-target: "pypi" # 'both' | 'pypi' | 'testpypi'
|
|
114
|
+
use-trusted-publishing: false # set false to use PYPI_API_TOKEN instead
|
|
115
|
+
secrets: inherit
|
|
116
|
+
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# Derived from basic .gitignore template for python projects:
|
|
2
|
+
# https://github.com/github/gitignore/blob/main/Python.gitignore
|
|
3
|
+
# Please maintain the alphabetic order of the section titles
|
|
4
|
+
# To debug why a file is being ignored, use the command:
|
|
5
|
+
# git check-ignore -v $my_ignored_file
|
|
6
|
+
|
|
7
|
+
# Byte-compiled / optimized / DLL files
|
|
8
|
+
__pycache__/
|
|
9
|
+
*.py[cod]
|
|
10
|
+
*$py.class
|
|
11
|
+
|
|
12
|
+
# C extensions
|
|
13
|
+
*.so
|
|
14
|
+
|
|
15
|
+
# Cython debug symbols
|
|
16
|
+
cython_debug/
|
|
17
|
+
|
|
18
|
+
# Celery stuff
|
|
19
|
+
celerybeat-schedule
|
|
20
|
+
celerybeat.pid
|
|
21
|
+
|
|
22
|
+
# Distribution / packaging
|
|
23
|
+
.Python
|
|
24
|
+
build/
|
|
25
|
+
develop-eggs/
|
|
26
|
+
dist/
|
|
27
|
+
downloads/
|
|
28
|
+
eggs/
|
|
29
|
+
.eggs/
|
|
30
|
+
lib/
|
|
31
|
+
lib64/
|
|
32
|
+
parts/
|
|
33
|
+
sdist/
|
|
34
|
+
var/
|
|
35
|
+
wheels/
|
|
36
|
+
share/python-wheels/
|
|
37
|
+
*.egg-info/
|
|
38
|
+
.installed.cfg
|
|
39
|
+
*.egg
|
|
40
|
+
MANIFEST
|
|
41
|
+
|
|
42
|
+
# Django stuff
|
|
43
|
+
*.log
|
|
44
|
+
local_settings.py
|
|
45
|
+
db.sqlite3
|
|
46
|
+
db.sqlite3-journal
|
|
47
|
+
|
|
48
|
+
# Environments
|
|
49
|
+
.env
|
|
50
|
+
.venv
|
|
51
|
+
env/
|
|
52
|
+
venv/
|
|
53
|
+
ENV/
|
|
54
|
+
env.bak/
|
|
55
|
+
venv.bak/
|
|
56
|
+
|
|
57
|
+
# Flask stuff
|
|
58
|
+
instance/
|
|
59
|
+
.webassets-cache
|
|
60
|
+
|
|
61
|
+
# Installer logs
|
|
62
|
+
pip-log.txt
|
|
63
|
+
pip-delete-this-directory.txt
|
|
64
|
+
|
|
65
|
+
# IPython
|
|
66
|
+
profile_default/
|
|
67
|
+
ipython_config.py
|
|
68
|
+
|
|
69
|
+
# Jupyter Notebook
|
|
70
|
+
*.ipynb_checkpoints
|
|
71
|
+
|
|
72
|
+
# mkdocs documentation
|
|
73
|
+
/site
|
|
74
|
+
|
|
75
|
+
# Model saving / checkpointing
|
|
76
|
+
*.pt
|
|
77
|
+
*.pth
|
|
78
|
+
*.ckpt
|
|
79
|
+
|
|
80
|
+
# mypy
|
|
81
|
+
.mypy_cache/
|
|
82
|
+
.dmypy.json
|
|
83
|
+
dmypy.json
|
|
84
|
+
|
|
85
|
+
# PyBuilder
|
|
86
|
+
.pybuilder/
|
|
87
|
+
target/
|
|
88
|
+
|
|
89
|
+
# PyCharm
|
|
90
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
91
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
92
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
93
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
94
|
+
#.idea/
|
|
95
|
+
|
|
96
|
+
# PyInstaller
|
|
97
|
+
# Usually these files are written by a python script from a template
|
|
98
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
99
|
+
*.manifest
|
|
100
|
+
#*.spec
|
|
101
|
+
|
|
102
|
+
# pyenv
|
|
103
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
104
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
105
|
+
# .python-version
|
|
106
|
+
|
|
107
|
+
# pipenv
|
|
108
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
109
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
110
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
111
|
+
# install all needed dependencies.
|
|
112
|
+
# Pipfile.lock
|
|
113
|
+
|
|
114
|
+
# poetry
|
|
115
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
116
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
117
|
+
# commonly ignored for libraries.
|
|
118
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
119
|
+
# poetry.lock
|
|
120
|
+
|
|
121
|
+
# PEP 582: https://peps.python.org/pep-0582/
|
|
122
|
+
# This PEP proposes to add to Python a mechanism to automatically recognize a __pypackages__
|
|
123
|
+
# directory and prefer importing packages installed in this location over user or global site-packages.
|
|
124
|
+
# This will avoid the steps to create, activate or deactivate virtual environments. Python will use
|
|
125
|
+
# the __pypackages__ from the base directory of the script when present.
|
|
126
|
+
__pypackages__/
|
|
127
|
+
|
|
128
|
+
# Pyre type checker
|
|
129
|
+
.pyre/
|
|
130
|
+
|
|
131
|
+
# pytype static type analyzer
|
|
132
|
+
.pytype/
|
|
133
|
+
|
|
134
|
+
# Rope project settings
|
|
135
|
+
.ropeproject
|
|
136
|
+
|
|
137
|
+
# SageMath parsed files
|
|
138
|
+
*.sage.py
|
|
139
|
+
|
|
140
|
+
# Scrapy stuff:
|
|
141
|
+
.scrapy
|
|
142
|
+
|
|
143
|
+
# Sphinx documentation
|
|
144
|
+
docs/build
|
|
145
|
+
# sphinx-gallery
|
|
146
|
+
docs/source/generated_examples/
|
|
147
|
+
docs/source/gen_modules/
|
|
148
|
+
docs/source/generated/
|
|
149
|
+
docs/source/sg_execution_times.rst
|
|
150
|
+
# pytorch-sphinx-theme gets installed here
|
|
151
|
+
docs/src
|
|
152
|
+
|
|
153
|
+
# Spyder project settings
|
|
154
|
+
.spyderproject
|
|
155
|
+
.spyproject
|
|
156
|
+
|
|
157
|
+
# System / program generated files
|
|
158
|
+
*.err
|
|
159
|
+
*.log
|
|
160
|
+
*.swp
|
|
161
|
+
.DS_Store
|
|
162
|
+
|
|
163
|
+
# Translations
|
|
164
|
+
*.mo
|
|
165
|
+
*.pot
|
|
166
|
+
|
|
167
|
+
# TorchX
|
|
168
|
+
*.torchxconfig
|
|
169
|
+
|
|
170
|
+
# Unit test / coverage reports
|
|
171
|
+
htmlcov/
|
|
172
|
+
.tox/
|
|
173
|
+
.nox/
|
|
174
|
+
.coverage
|
|
175
|
+
.coverage.*
|
|
176
|
+
.cache
|
|
177
|
+
nosetests.xml
|
|
178
|
+
coverage.xml
|
|
179
|
+
*.cover
|
|
180
|
+
*.py,cover
|
|
181
|
+
.hypothesis/
|
|
182
|
+
.pytest_cache/
|
|
183
|
+
cover/
|
|
184
|
+
|
|
185
|
+
# VSCode
|
|
186
|
+
.vscode/
|
|
187
|
+
|
|
188
|
+
# wandb
|
|
189
|
+
wandb/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Muhammad Hassan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pylogshield
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: A Python logging library designed for data professionals and developers who need reliable, secure logging with minimal setup.
|
|
5
|
+
Author-email: Vertex AI Automations <info@vertexaiautomations.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: homepage, https://www.vertexaiautomations.com
|
|
8
|
+
Project-URL: documentation, https://vertex-ai-automations.github.io/pylogshield
|
|
9
|
+
Project-URL: repository, https://github.com/vertex-ai-automations/pylogshield
|
|
10
|
+
Project-URL: issues, https://github.com/vertex-ai-automations/pylogshield/issues/new
|
|
11
|
+
Keywords: logger,automation,package,custom,security
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Classifier: Topic :: System :: Logging
|
|
22
|
+
Classifier: Typing :: Typed
|
|
23
|
+
Requires-Python: >=3.8
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
Requires-Dist: rich>=13.0.0
|
|
26
|
+
Requires-Dist: typer>=0.12.0
|
|
27
|
+
|
|
28
|
+
<a name="readme-top"></a>
|
|
29
|
+
<!-- PROJECT LOGO -->
|
|
30
|
+
<br />
|
|
31
|
+
<div align="center">
|
|
32
|
+
<img src="https://github.com/vertex-ai-automations/pylogshield/raw/main/docs/img/pylogshield.png" alt="PyLogShield Logo" width="150">
|
|
33
|
+
<p>
|
|
34
|
+
<br>
|
|
35
|
+
<strong>📃
|
|
36
|
+
<a href="https://vertex-ai-automations.github.io/pylogshield"><strong>Examples and Docs</strong></a>
|
|
37
|
+
|🔧
|
|
38
|
+
<a href="https://github.com/vertex-ai-automations/pylogshield/issues/new">Report Bug/Issues</a>
|
|
39
|
+
|⛪
|
|
40
|
+
<a href="https://www.vertexaiautomations.com">Vertex AI Automations</a>|
|
|
41
|
+
</p>
|
|
42
|
+
<br>
|
|
43
|
+
<img src="docs/img/pylogshield_animate.gif" alt="PyLogShield Animation">
|
|
44
|
+
<br>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<br>
|
|
48
|
+
|
|
49
|
+
<details open="true">
|
|
50
|
+
<summary><strong> :page_with_curl: Table of Contents</string></summary>
|
|
51
|
+
<ol>
|
|
52
|
+
<li>
|
|
53
|
+
<a href="#mega-about-the-project">About The Project</a>
|
|
54
|
+
<ul>
|
|
55
|
+
<li><a href="#bulb-features">Features</a></li>
|
|
56
|
+
</ul>
|
|
57
|
+
</li>
|
|
58
|
+
<li>
|
|
59
|
+
<a href="#pushpin-getting-started">Getting Started</a>
|
|
60
|
+
<ul>
|
|
61
|
+
<li><a href="#installation">Installation</a></li>
|
|
62
|
+
</ul>
|
|
63
|
+
</li>
|
|
64
|
+
<li><a href="#family-contributor">Contributors</a></li>
|
|
65
|
+
<li><a href="#clap-acknowledgments">Acknowledgments</a></li>
|
|
66
|
+
</ol>
|
|
67
|
+
</details>
|
|
68
|
+
|
|
69
|
+
## :mega: About The Project
|
|
70
|
+
A Python logging library designed for data professionals and developers who need reliable, secure logging with minimal setup. It extends Python's standard `logging` module with production-ready features commonly needed in data engineering and application development. It includes features like sensitive data masking, log rotation, asynchronous logging, rate limiting, and dynamic configuration, all while remaining lightweight and easy to use.
|
|
71
|
+
|
|
72
|
+
<!-- Features -->
|
|
73
|
+
## :bulb: Features
|
|
74
|
+
|
|
75
|
+
- **Sensitive Data Masking**: Automatically masks predefined sensitive fields (e.g., `password`, `token`) in logs.
|
|
76
|
+
- **Log Filtering**: Filter logs based on specific keywords.
|
|
77
|
+
- **Dynamic Masking Control**: Enable or disable masking on a per-log basis using the `mask` parameter.
|
|
78
|
+
- **Performance Metrics**: Track logs per second for insights into logging activity.
|
|
79
|
+
- **Interactive Log Viewer**: View logs in a structured, styled table using the `rich` library.
|
|
80
|
+
- **Rate Limiting**: Avoid repetitive logs of the same message within a specified interval.
|
|
81
|
+
- **Log Rotation**: Supports rotating log files based on file size, with configurable backup counts.
|
|
82
|
+
- **Asynchronous Logging**: Offload logging to a background thread for improved performance.
|
|
83
|
+
- **JSON Log Formatting**: Optional structured JSON logging for integration with log aggregation tools.
|
|
84
|
+
- **Dynamic Log Level Adjustments**: Update logger settings (e.g., log level) dynamically at runtime.
|
|
85
|
+
- **Reusable Global Logger**: Easily access a shared logger across multiple modules with `get_logger`.
|
|
86
|
+
- **Color-Coded Logs**: Enable `rich` integration for visually enhanced terminal output.
|
|
87
|
+
- **CLI Log Viewer (Static/Live)**: Log viewer using CLI, also supports live viewer and detects for changes.
|
|
88
|
+
- **Custom Log Level**: Runtime custom log level injection (e.g. `SECURITY`, `AUDIT`)
|
|
89
|
+
|
|
90
|
+
<!-- GETTING STARTED -->
|
|
91
|
+
## :pushpin: Getting Started
|
|
92
|
+
|
|
93
|
+
### Installation
|
|
94
|
+
|
|
95
|
+
Install:
|
|
96
|
+
```bash
|
|
97
|
+
pip install pylogshield
|
|
98
|
+
```
|
|
99
|
+
Upgrade:
|
|
100
|
+
```bash
|
|
101
|
+
pip install --upgrade pylogshield
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Documentation**
|
|
105
|
+
|
|
106
|
+
Full developer docs with API reference, usage, and model schema:
|
|
107
|
+
|
|
108
|
+
- 👉 [Docs and Examples (PyLogShield)](https://vertex-ai-automations.github.io/pylogshield)
|
|
109
|
+
|
|
110
|
+
<!--Contributors-->
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
## :family: Contributors
|
|
114
|
+
All contributions are welcome. If you have a suggestion that would make this better, please fork the repo and create a merge request. You can also simply open an issue with the label 'enhancement'.
|
|
115
|
+
|
|
116
|
+
Don't forget to give the project a star! Thanks again!
|
|
117
|
+
|
|
118
|
+
:large_orange_diamond: [View all contributors](CONTRIBUTING.md)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<a name="readme-top"></a>
|
|
2
|
+
<!-- PROJECT LOGO -->
|
|
3
|
+
<br />
|
|
4
|
+
<div align="center">
|
|
5
|
+
<img src="https://github.com/vertex-ai-automations/pylogshield/raw/main/docs/img/pylogshield.png" alt="PyLogShield Logo" width="150">
|
|
6
|
+
<p>
|
|
7
|
+
<br>
|
|
8
|
+
<strong>📃
|
|
9
|
+
<a href="https://vertex-ai-automations.github.io/pylogshield"><strong>Examples and Docs</strong></a>
|
|
10
|
+
|🔧
|
|
11
|
+
<a href="https://github.com/vertex-ai-automations/pylogshield/issues/new">Report Bug/Issues</a>
|
|
12
|
+
|⛪
|
|
13
|
+
<a href="https://www.vertexaiautomations.com">Vertex AI Automations</a>|
|
|
14
|
+
</p>
|
|
15
|
+
<br>
|
|
16
|
+
<img src="docs/img/pylogshield_animate.gif" alt="PyLogShield Animation">
|
|
17
|
+
<br>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<br>
|
|
21
|
+
|
|
22
|
+
<details open="true">
|
|
23
|
+
<summary><strong> :page_with_curl: Table of Contents</string></summary>
|
|
24
|
+
<ol>
|
|
25
|
+
<li>
|
|
26
|
+
<a href="#mega-about-the-project">About The Project</a>
|
|
27
|
+
<ul>
|
|
28
|
+
<li><a href="#bulb-features">Features</a></li>
|
|
29
|
+
</ul>
|
|
30
|
+
</li>
|
|
31
|
+
<li>
|
|
32
|
+
<a href="#pushpin-getting-started">Getting Started</a>
|
|
33
|
+
<ul>
|
|
34
|
+
<li><a href="#installation">Installation</a></li>
|
|
35
|
+
</ul>
|
|
36
|
+
</li>
|
|
37
|
+
<li><a href="#family-contributor">Contributors</a></li>
|
|
38
|
+
<li><a href="#clap-acknowledgments">Acknowledgments</a></li>
|
|
39
|
+
</ol>
|
|
40
|
+
</details>
|
|
41
|
+
|
|
42
|
+
## :mega: About The Project
|
|
43
|
+
A Python logging library designed for data professionals and developers who need reliable, secure logging with minimal setup. It extends Python's standard `logging` module with production-ready features commonly needed in data engineering and application development. It includes features like sensitive data masking, log rotation, asynchronous logging, rate limiting, and dynamic configuration, all while remaining lightweight and easy to use.
|
|
44
|
+
|
|
45
|
+
<!-- Features -->
|
|
46
|
+
## :bulb: Features
|
|
47
|
+
|
|
48
|
+
- **Sensitive Data Masking**: Automatically masks predefined sensitive fields (e.g., `password`, `token`) in logs.
|
|
49
|
+
- **Log Filtering**: Filter logs based on specific keywords.
|
|
50
|
+
- **Dynamic Masking Control**: Enable or disable masking on a per-log basis using the `mask` parameter.
|
|
51
|
+
- **Performance Metrics**: Track logs per second for insights into logging activity.
|
|
52
|
+
- **Interactive Log Viewer**: View logs in a structured, styled table using the `rich` library.
|
|
53
|
+
- **Rate Limiting**: Avoid repetitive logs of the same message within a specified interval.
|
|
54
|
+
- **Log Rotation**: Supports rotating log files based on file size, with configurable backup counts.
|
|
55
|
+
- **Asynchronous Logging**: Offload logging to a background thread for improved performance.
|
|
56
|
+
- **JSON Log Formatting**: Optional structured JSON logging for integration with log aggregation tools.
|
|
57
|
+
- **Dynamic Log Level Adjustments**: Update logger settings (e.g., log level) dynamically at runtime.
|
|
58
|
+
- **Reusable Global Logger**: Easily access a shared logger across multiple modules with `get_logger`.
|
|
59
|
+
- **Color-Coded Logs**: Enable `rich` integration for visually enhanced terminal output.
|
|
60
|
+
- **CLI Log Viewer (Static/Live)**: Log viewer using CLI, also supports live viewer and detects for changes.
|
|
61
|
+
- **Custom Log Level**: Runtime custom log level injection (e.g. `SECURITY`, `AUDIT`)
|
|
62
|
+
|
|
63
|
+
<!-- GETTING STARTED -->
|
|
64
|
+
## :pushpin: Getting Started
|
|
65
|
+
|
|
66
|
+
### Installation
|
|
67
|
+
|
|
68
|
+
Install:
|
|
69
|
+
```bash
|
|
70
|
+
pip install pylogshield
|
|
71
|
+
```
|
|
72
|
+
Upgrade:
|
|
73
|
+
```bash
|
|
74
|
+
pip install --upgrade pylogshield
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Documentation**
|
|
78
|
+
|
|
79
|
+
Full developer docs with API reference, usage, and model schema:
|
|
80
|
+
|
|
81
|
+
- 👉 [Docs and Examples (PyLogShield)](https://vertex-ai-automations.github.io/pylogshield)
|
|
82
|
+
|
|
83
|
+
<!--Contributors-->
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
## :family: Contributors
|
|
87
|
+
All contributions are welcome. If you have a suggestion that would make this better, please fork the repo and create a merge request. You can also simply open an issue with the label 'enhancement'.
|
|
88
|
+
|
|
89
|
+
Don't forget to give the project a star! Thanks again!
|
|
90
|
+
|
|
91
|
+
:large_orange_diamond: [View all contributors](CONTRIBUTING.md)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|