A Black Box Flight Recorder for Python applications.
Project description
Stop guessing why your production code crashed. Start replaying it.
๐ฉ๏ธ What is lognote?
lognote acts like an airplane's Flight Data Recorder โ silently capturing every function call, argument, and variable state in the background. When your app crashes, lognote hands you a full AI-driven autopsy report โ no print statements, no heavy debuggers, no regrets.
In a world where logs are often too thin and debuggers are too heavy, lognote sits perfectly in the middle with Agentic Instrumentation that works without touching a single line of your existing code.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ YOUR APPLICATION โ
โ โ
โ main() โ service() โ db_query() โ ๐ฅ CRASH โ
โ โ โ โ โ
โ โโโโโโโโโโโโโดโโโโโโโโโโโ โ
โ lognote records EVERYTHING โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐งฉ The Real Problem (And How lognote Solves It)
| ๐ด The Problem | โ The lognote Solution |
|---|---|
| The "Heisenbug" โ crashes that vanish under a debugger | Captures the exact locals() state at the millisecond of failure |
| Production Latency โ tracing slows everything down | Non-blocking background worker: main thread overhead < 1ms |
| PII Leaks โ passwords & tokens ending up in log files | Multi-layer Semantic Filter redacts secrets before they touch disk |
| Post-Mortem Fatigue โ staring at stack traces for hours | AI diagnosis explains why the crash happened in plain English |
๐๏ธ System Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ lognote Flight Recorder โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฃ
โ โ
โ Your Code sys.settrace Engine โ
โ โโโโโโโโโโ โโโบ โโโโโโโโโโโโโโโโโโโโโ โ
โ main() IGNITE: Hook into your project scope โ
โ service() FILTER: Skip stdlib & site-packages โ
โ db_query() CAPTURE: locals(), args, return values โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโ โ
โ โ Async Queue โ โ Non-blocking buffer โ
โ โโโโโโโโโฌโโโโโโโโ โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโ โ
โ โ PII Scrubber โ โ Redacts secrets โ
โ โโโโโโโโโฌโโโโโโโโ โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโ โ
โ โ JSON Flight โ โ Structured record โ
โ โ Record โ โ
โ โโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
4 Phases, Zero Effort:
- ๐ฅ Ignite โ
sys.settracehooks into every call in your project - ๐ Filter โ Ignores
site-packagesandstdlibfor maximum performance - ๐ฅ Buffer โ Events pushed to a thread-safe
Queue - ๐พ Process โ Background thread scrubs PII and writes the
.jsonFlight Record
๐ Quickstart
Step 1 โ Install
pip install lognote
Step 2 โ One Line. That's It.
import lognote
# ๐ฅ Ignite the flight recorder
lognote.ignite(output_dir="./traces", secret_scrubbing=True)
# โ
The rest of your application โ completely unchanged
def process_payment(user_id, amount):
...
def fetch_user(token):
...
No decorators. No wrappers. No config files. Just one line at the top of
main.py.
Step 3 โ Analyze the Crash
When a crash occurs, a .json Flight Record is auto-generated. Replay it with the built-in Time-Travel CLI:
python -m lognote view ./traces/lognote_trace_1714412345.json
You'll get a beautiful terminal dashboard like this:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ฉ lognote โ Flight Record Analysis โ
โ File: lognote_trace_1714412345.json โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฃ
โ Timeline โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ 14:22:01.001 โ main() [ENTER] args={} โ
โ 14:22:01.003 โ fetch_user() [ENTER] token=*** โ
โ 14:22:01.045 โ db_query() [ENTER] sql="SELECTโฆ" โ
โ 14:22:01.099 โ db_query() [EXIT] result=None โ
โ 14:22:01.100 โ process() [ERROR] ๐ฅ CRASH โ
โ โ
โ ๐ค AI Diagnosis โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ db_query() returned None because the connection pool โ
โ was exhausted. process() tried to call .rows on None. โ
โ Fix: Add a null-check after db_query() or increase โ
โ MAX_POOL_SIZE in your database config. โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Features at a Glance
| Feature | Description |
|---|---|
| ๐ฏ Zero-Config | No decorators, no wrappers. ignite() and you're done. |
| ๐ค Agentic Tracing | Automatically identifies function boundaries & captures all arguments. |
| ๐ Privacy-First | Built-in RegEx + keyword filters for SSN, passwords, API tokens. |
| โก Async by Design | Background worker writes logs โ your API latency stays untouched. |
| ๐ฅ๏ธ Rich Dashboard | Terminal UI with full event timeline leading to the crash. |
| ๐ง AI Diagnosis | Plain-English explanation of why the crash happened. |
| ๐๏ธ Structured Output | Portable .json flight records โ pipe to any observability stack. |
โ๏ธ Configuration Reference
lognote.ignite(
output_dir = "./logs", # Where to save .json flight records
secret_scrubbing = True, # Auto-mask: passwords, tokens, SSNs
max_queue_size = 1000, # Cap memory during high-burst execution
)
| Parameter | Default | Description |
|---|---|---|
output_dir |
./logs |
Directory for .json flight records |
secret_scrubbing |
True |
Redact sensitive variable names/values |
max_queue_size |
1000 |
Memory ceiling during burst traffic |
๐ Privacy & Security
lognote's Multi-Layer Semantic Filter protects your users before data ever reaches disk:
Raw Variable State
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Layer 1: Keyword Match โ password, token, secret, key, ssnโฆ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Layer 2: RegEx Patterns โ /Bearer [A-Z0-9]+/, credit cardโฆ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Layer 3: Entropy Scanner โ High-entropy strings โ likely keys
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
Scrubbed Record โ { "token": "***REDACTED***" }
๐ฃ๏ธ Roadmap
- Core
sys.settraceengine - Async queue + background worker
- Multi-layer PII scrubber
- Time-Travel CLI viewer
- AI-powered crash diagnosis
- ๐ OpenTelemetry export
- ๐ Web dashboard (FastAPI + React)
- ๐
async/awaitcoroutine tracing - ๐ Pytest plugin for trace-on-fail
๐ค Contributing
lognote is open-source and welcomes contributors! Here's how to get started:
# Clone the repo
git clone https://github.com/Nvishal2006/lognote.git
cd lognote
# Set up your environment
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
# Run tests
pytest tests/
- ๐ Found a bug? Open an issue on GitHub
- ๐ฌ Want to discuss? Join the conversation on LinkedIn
- ๐ Like the project? Star it โ it helps more than you'd think!
๐จ๐ป Author
๐ License
This project is licensed under the MIT License โ see the LICENSE file for details.
lognote โ Because every crash deserves a black box.
Made with โค๏ธ by Vishal N ยท Python Observability ยท Open Source
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lognote-0.2.0.tar.gz.
File metadata
- Download URL: lognote-0.2.0.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61a400e437ef16469a67ac4dff0a6b5e451b2f566c67d920e0574879ea99857b
|
|
| MD5 |
b894cc2c39f672a374ba9f51743411c1
|
|
| BLAKE2b-256 |
70cb180d91c1577d28d6ee669921e3048e45f16c2a3655f4b04d49d1a118f23b
|
File details
Details for the file lognote-0.2.0-py3-none-any.whl.
File metadata
- Download URL: lognote-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66b5b888fe51c65b7bf04fd3b00313de14130bce684b50598c64e420c0d7aff8
|
|
| MD5 |
faf614d268428604d56a28d73ecdf04a
|
|
| BLAKE2b-256 |
04667463dffe341f81f894fefc7b29f74f69bc7c049a0a22fc396f99ad3dca41
|