Real-time log streaming SDK for Python
Project description
slogx
Real-time log streaming SDK for Python. (Read more on GitHub!)
Installation
pip install slogx
Usage
import os
from slogx import slogx
# Start the log server (is_dev prevents accidental prod use)
slogx.init(
is_dev=os.environ.get('ENV') != 'production',
port=8080,
service_name='my-service'
)
# Log anywhere in your app
slogx.info("Server started", {"env": "dev"})
slogx.debug("Debug info", {"key": "value"})
slogx.warn("Warning message")
slogx.error("Error occurred", {"code": 500})
CI Mode
In CI environments, you can write logs to a file instead of starting a WebSocket server. CI mode is auto-detected via common CI env vars, or can be forced explicitly.
import os
from slogx import slogx
slogx.init(
is_dev=True,
service_name='my-service',
ci_mode=True,
log_file_path='./slogx_logs/my-service.ndjson',
max_entries=10000
)
slogx.info("CI log entry", {"ok": True})
Features
- WebSocket-based real-time log streaming
- Structured logging with metadata (file, line, function)
- Stack trace capture for all log levels
- Zero-config setup for local development
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
slogx-0.0.3.tar.gz
(4.5 kB
view details)
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
slogx-0.0.3-py3-none-any.whl
(4.7 kB
view details)
File details
Details for the file slogx-0.0.3.tar.gz.
File metadata
- Download URL: slogx-0.0.3.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fad0c19be2e24943a99e51d2f7f1bf55c504d380261590773a9f87da32103389
|
|
| MD5 |
66ae3594471703549bb825dab11d7875
|
|
| BLAKE2b-256 |
86b0bbaee236f2e38b735a2cf8462c8598c1d672f2f3bebf909bb6c4ae1f1c55
|
File details
Details for the file slogx-0.0.3-py3-none-any.whl.
File metadata
- Download URL: slogx-0.0.3-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c4b920df772ebc477bad7e6cf9b98c8571959a943402b989195f1e756b420bc
|
|
| MD5 |
edaec202cb0fbc5497492f561f37559c
|
|
| BLAKE2b-256 |
84b5d364f4ff7c840a2278a2e786a7bc6b0bfedf6e5b0edc1c593134e5d39540
|