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")
Use getLogger() for diagnostics, getConsole() for formatted stdout, and
getPlainConsole() for exact result lines. See stream behavior
for filtering, caller-owned streams, and configuration ownership.
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.
Enforced output policy
The logging distribution owns PS-220's shared AST detector, auditor plugin,
linter plugin, and executable scitex_dev.hooks provider. Besides raw print
and stdlib logger acquisition, it rejects logging.basicConfig and direct
logging.StreamHandler construction outside individually proved logger-backend
operations. Importing a helper must not install an extra console handler.
With a scitex-dev version exposing federated provider installation:
scitex-dev dev hooks install --provider scitex-logging --harness claude --config .claude/settings.local.json --dry-run
scitex-dev dev hooks install --provider scitex-logging --harness claude --config .claude/settings.local.json
For Hermes use --harness hermes --config <profile>/config.yaml from an
environment with Hermes' atomic configuration writer available. --python
selects the interpreter inside the target environment; it must have both
packages installed. Discovery alone does not install or activate a hook.
Hermes' own first-use command consent also applies.
Native Write/Edit/MultiEdit and Hermes write_file/patch are checked against the complete proposed source before execution. Shell/patch-tool changes are checked against tracked diffs and untracked Python source; a post-tool report cannot undo a completed shell command, while the next guarded shell invocation and the auditor enforce the resulting source. A missing required provider fails closed. Tests exercise actual entry-point discovery, subprocess exit status, and shared detector results. The detector is static; dynamically generated calls are outside its proof.
Project audits inventory tracked files plus nonignored untracked files under
src/, including hidden authored Python and tracked files matching ignore
patterns. Ignored dependencies installed there (for example by npm ci) are
outside that Git inventory. Archives without Git retain the full src/
walk. Native edits remain targeted; shell hooks inspect changed and untracked
source rather than all unchanged tracked files.
Metadata
Release files for scitex-logging 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| scitex_logging-0.3.0.tar.gz | 8.3 MB | Without provenance | Details for scitex_logging-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scitex_logging-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for scitex_logging-0.3.0-py3-none-any.whl |
Total release size: 16.1 MB
Release files / scitex_logging-0.3.0.tar.gz
| Download URL | scitex_logging-0.3.0.tar.gz |
|---|---|
| Size | 8.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ea648ab8a491e67242b1bf7d90e8069724342a98517f462904dcedff2b7df0e7
|
|
BLAKE2b-256 checksum How to use checksums |
ccaf53a6b864526949ff83bfc55006b2e0c84e18b06446ea10f5fdfb9d8ab3a9
|
| 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.3.0-py3-none-any.whl
| Download URL | scitex_logging-0.3.0-py3-none-any.whl |
|---|---|
| Size | 7.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dc9b81c4c0d929c4fbcc519e3254ba969442421832ce84692f5a755a190be8a6
|
|
BLAKE2b-256 checksum How to use checksums |
510612af474eeb24d75952e13a7e5e3b385b231a29926aef156f35dbee2b0fce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Security for scitex-logging 0.3.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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.