Skip to main content

pymcp_logging

Zero-dependency Python logging handler that ships log events to a Supabase table in near-realtime. Stdlib only — no requests, no httpx.

Features

  • Drop-in logging.Handler for Supabase (PostgREST-compatible).
  • Bounded in-memory queue with a 1.5s / 50-row batch flush.
  • Gzipped NDJSON disk spool when the network is unreachable; auto-replays on recovery.
  • Backpressure: drops debug/info first when the queue fills, keeps warning+.
  • Redaction of common secret keys (password, token, secret, api_key, Authorization, Cookie) and JWT / sb_* / AWS-key value patterns.
  • Stable machine ID (SHA-256 of Windows MachineGuid) + per-process session UUID.
  • Runtime kill switch via a flag file — toggle live streaming without restarting the app.

Install

pip install pymcp_logging

Quick start

import os
import pymcp_logging as plg

os.environ["SUPABASE_URL"] = "https://<project>.supabase.co"
os.environ["SUPABASE_ANON_KEY"] = "<anon-jwt>"

plg.install()  # adds handler to root logger, registers sys.excepthook

import logging
logging.getLogger(__name__).info("hello supabase", extra={"order_id": 42})

Supabase table

Expects a public.logs table with columns roughly: id, ts, level, logger, message, machine_id, session_id, hostname, app_version, extra (jsonb), traceback.

Kill switch

Create or delete the flag file to toggle live streaming at runtime: %LOCALAPPDATA%\PyMCP\livestream_debug.flag (Windows) — checked each flush (~1.5s).

License

MIT

Metadata

Release files for pymcp-logging 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pymcp-logging 0.1.0
File Size Uploaded Provenance
pymcp_logging-0.1.0.tar.gz 10.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pymcp-logging 0.1.0
File Interpreter ABI Platform
pymcp_logging-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.1 kB

Release files / pymcp_logging-0.1.0.tar.gz

Download URL pymcp_logging-0.1.0.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f3218c694dd1a279ff5492dfa84410caf600b17ccc26b2434c175544d4d4bf5f
BLAKE2b-256 checksum
How to use checksums
f0aa33365439ac38ed08b32f16b6697f8bf7bb9c4d0b9ab80426c32a1c635867
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release files / pymcp_logging-0.1.0-py3-none-any.whl

Download URL pymcp_logging-0.1.0-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4771251fcfbbda2f951641836138f7d68ae0a3c64041961e8bc27ea1f280eeec
BLAKE2b-256 checksum
How to use checksums
2ca88342a157e05281540b03fa974e03d0672a26769b9ae85f89de4396c04b2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Security for pymcp-logging 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page