Skip to main content

A Black Box Flight Recorder for Python applications.

Project description

PyPI Version Python Versions License Downloads

Overhead Zero Config PII Safe AI Powered


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:

  1. ๐Ÿ”ฅ Ignite โ€” sys.settrace hooks into every call in your project
  2. ๐Ÿ” Filter โ€” Ignores site-packages and stdlib for maximum performance
  3. ๐Ÿ“ฅ Buffer โ€” Events pushed to a thread-safe Queue
  4. ๐Ÿ’พ Process โ€” Background thread scrubs PII and writes the .json Flight 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.settrace engine
  • Async queue + background worker
  • Multi-layer PII scrubber
  • Time-Travel CLI viewer
  • AI-powered crash diagnosis
  • ๐Ÿ”œ OpenTelemetry export
  • ๐Ÿ”œ Web dashboard (FastAPI + React)
  • ๐Ÿ”œ async/await coroutine 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/

๐Ÿ‘จ๐Ÿ’ป Author

Building tools that make Python production-ready.

LinkedIn GitHub


๐Ÿ“„ 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

lognote-0.2.3.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lognote-0.2.3-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file lognote-0.2.3.tar.gz.

File metadata

  • Download URL: lognote-0.2.3.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for lognote-0.2.3.tar.gz
Algorithm Hash digest
SHA256 48a061018768e770fa2227bc1849ea90d4a6f7628a3d0503ecbc8b73c38cf814
MD5 611b2ed0ead51d8b30c1933f8cfba9b5
BLAKE2b-256 43e67ed9cc2fdfc8c5802154d5009293a9da55955d5b415354492526812da9a2

See more details on using hashes here.

File details

Details for the file lognote-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: lognote-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for lognote-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5ce8ca3ed279ff159d619fad87f355e4d76f469045707af43d14ecf8287a4208
MD5 ee984fcf734be7ef19dcfaf633ca3e90
BLAKE2b-256 03412f043c46b76fe275f166efb3058dcc853113e262e9d0249a98b99a363dcb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page