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.0.tar.gz (15.7 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.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

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

Hashes for lognote-0.2.0.tar.gz
Algorithm Hash digest
SHA256 61a400e437ef16469a67ac4dff0a6b5e451b2f566c67d920e0574879ea99857b
MD5 b894cc2c39f672a374ba9f51743411c1
BLAKE2b-256 70cb180d91c1577d28d6ee669921e3048e45f16c2a3655f4b04d49d1a118f23b

See more details on using hashes here.

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

Hashes for lognote-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 66b5b888fe51c65b7bf04fd3b00313de14130bce684b50598c64e420c0d7aff8
MD5 faf614d268428604d56a28d73ecdf04a
BLAKE2b-256 04667463dffe341f81f894fefc7b29f74f69bc7c049a0a22fc396f99ad3dca41

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