A faster, safer way to log and debug live code.
Project description
ProdWatch
A faster, safer way to log and debug live code.
Installation & Setup
You can install prodwatch using pip:
pip install prodwatch
Prerequisites
- Python >= 3.13.
- A live monitoring server (host your own, or use ours).
- Environment variables:
PRODWATCH_API_TOKEN: Authentication for the monitoring server.PRODWATCH_API_URL: Base URL (optional) for the monitoring server (yours or ours).
Basic Usage
from prodwatch import start_prodwatch
# Your application code
def some_function(a, b):
return a + b
if __name__ == "__main__":
start_prodwatch()
# Hover over this function in your editor, and click to turn on logging.
# ProdWatch will start logging these function calls immediately.
# Wait a few moments, and you'll start seeing logs.
# No added logging code, no config changes, no deploy required!
some_function(4, 2)
Configuration
Environment Variables
Required for ProdWatch Operation
| Variable | Description | Default | Required |
|---|---|---|---|
PRODWATCH_API_TOKEN |
Authentication token for monitoring server | None | Yes |
PRODWATCH_API_URL |
Base URL of monitoring server | https://getprodwatch.com | No |
Optional for ProdWatch Internal Logging
These control how ProdWatch logs its own behavior (not your application's logs):
| Variable | Description | Default | Required |
|---|---|---|---|
PRODWATCH_LOG_LEVEL |
Logging level (DEBUG, INFO, WARNING, ERROR) | INFO | No |
PRODWATCH_LOG_FORMAT |
Log output format (text, json) | text | No |
PRODWATCH_LOG_FILE |
Path to log file (enables file logging) | None | No |
ProdWatch Internal Logging Configuration
You can configure logging for ProdWatch itself (as mentioned above, this is not to be confused with the logging ProdWatch does for your code).
Configuration Files
Place a prodwatch_logging.json file in your project root for custom logging setup:
{
"version": 1,
"formatters": {
"standard": {
"format": "%(asctime)s [%(name)s] [%(levelname)s] %(message)s"
},
"json": {
"()": "prodwatch.logging_config.StructuredFormatter"
}
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"formatter": "standard"
},
"file": {
"class": "logging.handlers.RotatingFileHandler",
"filename": "prodwatch.log",
"formatter": "json",
"maxBytes": 10485760,
"backupCount": 5
}
},
"loggers": {
"prodwatch": {
"level": "DEBUG",
"handlers": ["console", "file"]
}
}
}
Environment-Based Configuration
PRODWATCH_LOG_FORMAT=jsonenables JSON structured loggingPRODWATCH_LOG_FILE=app.logenables file logging with rotation
Server Endpoints
The monitoring server should implement the following endpoints:
GET /pending-function-names?process_id={id}: Returns list of functions to monitor.POST /events: Receives monitoring events (process registration, function calls, confirmations).
API Reference
Just One Function!
start_prodwatch()
Initializes and starts ProdWatch.
Behavior:
- Creates Manager instance with monitoring server URL
- Checks server connection
- Starts polling loop in a background thread
- Listens for requests (from VS Code) to monitor specific functions.
- Sends function-call data to the monitoring server.
Exception Classes
ProdwatchError
Base exception for all Prodwatch-related errors.
TokenError
Raised when API token is missing or invalid.
Project details
Release history Release notifications | RSS feed
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 prodwatch-0.1.0.tar.gz.
File metadata
- Download URL: prodwatch-0.1.0.tar.gz
- Upload date:
- Size: 28.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e7350c6e31b75bb9ce613361742db6bb2bbfcf63a1136f8d52d03b05bf17148
|
|
| MD5 |
59c6e95a63dcdbfaee459651322dffe9
|
|
| BLAKE2b-256 |
e5bfb44aba458e7ad7e3bb3de79832b4738c69a364669e035e9051e2dec27018
|
File details
Details for the file prodwatch-0.1.0-py3-none-any.whl.
File metadata
- Download URL: prodwatch-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca338c1e6a2c2a559e9047908f8c3acdccda3a275a87354d298cc6d159621813
|
|
| MD5 |
d7f770d90ce0042d64a6980c45cec981
|
|
| BLAKE2b-256 |
651fd87c07e416965e338f230b853677059e2d6755acb06cf4b3579059a3205b
|