scitex-logging
Logging utilities for SciTeX — SUCCESS/FAIL log levels, typed exception hierarchy, Tee context-manager.
Full Documentation · uv pip install scitex-logging[all]
Problem and Solution
| # | Problem | Solution |
|---|---|---|
| 1 | stdlib logging has only 5 levels -- experiment scripts want a distinct SUCCESS and FAIL signal that stands out in grep |
SUCCESS + FAIL levels added -- color-coded, level-aware handlers; drop-in compatible with getLogger(__name__) |
| 2 | raise ValueError("shape mismatch") loses context -- every package rolls its own exception hierarchy |
30+ typed exceptions -- SciTeXError root + ShapeError, DTypeError, ConfigKeyError, PDFDownloadError, ...; isinstance(e, DataError) catches the whole class |
| 3 | Tee stdout-to-file is a recipe -- every script implements it differently | Tee("run.log") context-manager -- one import, no boilerplate |
Installation
pip install scitex-logging
1 Interfaces
Python API
import scitex_logging
# Configure logging
scitex_logging.configure(level=scitex_logging.INFO, enable_file=True)
# Get a logger
import logging
logger = logging.getLogger(__name__)
logger.info("Hello from SciTeX logging")
# Tee stdout/stderr to log files
import sys
sys.stdout, sys.stderr = scitex_logging.tee(sys)
# Custom error classes
from scitex_logging import SciTeXError, SaveError
# Warning utilities
from scitex_logging import warn_deprecated, warn_performance
# LLM session log parsing
log = scitex_logging.llm.load("session.jsonl")
log.summary()
log.render("out.html")
Architecture
scitex_logging/
├── _config.py ← `configure()` entry point + level registration
├── _levels.py ← SUCCESS / FAIL custom log levels
├── _Tee.py ← stdout/stderr Tee context-manager
├── _errors.py ← 30+ typed `SciTeXError` subclasses
├── _warnings.py ← `warn_deprecated`, `warn_performance`
└── llm/ ← Claude / LLM session-log parsers
Demo
flowchart LR
A[script.py] -->|getLogger| B[scitex_logging]
B --> C{level}
C -->|SUCCESS| D[green log + Tee → run.log]
C -->|FAIL| E[red log + Tee → run.log]
C -->|ERROR| F[typed SciTeXError raised]
import logging, scitex_logging as sxl
sxl.configure(level=sxl.INFO, enable_file=True)
log = logging.getLogger(__name__)
log.success("model converged") # green
log.fail("validation failed") # red, distinct from ERROR
2026-05-07 12:00:00 SUCCESS model converged
2026-05-07 12:00:01 FAIL validation failed
Part of SciTeX
scitex-logging is part of SciTeX. Install via
the umbrella with pip install scitex[logging] to use as
scitex.logging (Python).
Four Freedoms for Research
- The freedom to run your research anywhere — your machine, your terms.
- The freedom to study how every step works — from raw data to final manuscript.
- The freedom to redistribute your workflows, not just your papers.
- The freedom to modify any module and share improvements with the community.
AGPL-3.0 — because we believe research infrastructure deserves the same freedoms as the software it runs on.
License
AGPL-3.0-only — see LICENSE.
Metadata
Release files for scitex-logging 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| scitex_logging-0.2.2.tar.gz | 487.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| scitex_logging-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 568.4 kB
Release files / scitex_logging-0.2.2.tar.gz
| Download URL | scitex_logging-0.2.2.tar.gz |
|---|---|
| Size | 487.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ff1791f6e6ed7a667ebe0e8a68dba603b14b01257a0d629725c4b064ca979213
|
|
BLAKE2b-256 checksum How to use checksums |
e47e92dd3c4fe6d870183ae9de4209f5c5416d3232c4b20ecad2bc1597fb7627
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / scitex_logging-0.2.2-py3-none-any.whl
| Download URL | scitex_logging-0.2.2-py3-none-any.whl |
|---|---|
| Size | 80.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
15f0fae43dfc6bed11ea6c6927093f5e583b792f995823422e92d1459885595c
|
|
BLAKE2b-256 checksum How to use checksums |
b1c62618a721c34c6acdea9ee7840f2ef9f983118faef2a4e4b2a183cb2c2e2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|