Skip to content

Releases: affromero/klogr

klogr 0.2.0 — to_file, timed, kv

Choose a tag to compare

@affromero affromero released this 17 May 17:08

Four new ergonomic helpers on LoggingRich. No breaking changes.

New

  • with logger.to_file("run.log"): — mirror logs to a file for the duration of a block, auto-restored on exit.
  • with logger.timed("train epoch"): — entry + exit + elapsed, no time.perf_counter() boilerplate.
  • logger.kv(epoch=12, lr=3e-4, loss=0.21) — one-line structured key=value logging.
  • logger.exception("msg") documented (already existed) — error + Rich traceback.

Install

uv add klogr      # or: pip install --upgrade klogr

See CHANGELOG.md for full notes.

klogr 0.1.6

Choose a tag to compare

@affromero affromero released this 17 May 16:50

Highlights

  • One-line dual output: logger.enable_dual_output("run.log") mirrors every log line to both the Rich console and a file — perfect for batch jobs and CI runs.

Install / upgrade

```bash
uv add klogr

or

pip install --upgrade klogr
```

What changed since 0.1.3 (rename release)

  • 0.1.4 — loosened sha256sum>=2022.6.11 so uv resolves on macOS.
  • 0.1.5 — added LICENSE.md so the wheel ships the license text.
  • 0.1.6 — README + Why-use-it now document enable_dual_output().

Full notes: CHANGELOG.md.

klogr 0.1.5

Choose a tag to compare

@affromero affromero released this 17 May 16:37

First release of klogr with a proper LICENSE file in the source tree.

Highlights so far (since fork from difflogtest)

  • Renamed: difflogtest → klogr (PyPI blocked the shorter klog).
  • Scope shrunk: dropped the snapshot-test framework (UnitTests, @register_unittest, LogReplacement, is_unittest_mode, run-unittests CLI). Use pytest directly.
  • Layout flattened: top-level logger.py, cache.py, time.py, plus path/ subpackage split into ops/io/query/env.
  • Dependencies trimmed: dropped GitPython, tyro, pytz, json5, torch, torchvision, wget. Runtime deps now: rich, pydantic, python-dotenv, beartype, jaxtyping, natsort, sha256sum.
  • README polished: badges, ASCII overview, runnable examples/.
  • PyPI ready: MIT license (SPDX), full classifiers + URLs metadata.

What you get

from klogr import get_logger

logger = get_logger()
logger.info("loaded %d samples", 1024)         # auto file:line prefix
logger.success("training converged")            # green check

Plus @lru_cache with a disable hook, path_join / path_exists / path_mkdir that handle local and s3:// paths transparently, and get_elapsed_time(seconds) for human-readable durations.

Install

uv add klogr
# or
pip install klogr

See CHANGELOG.md for the full 0.1.x history.

v0.0.1

Choose a tag to compare

@affromero affromero released this 27 Sep 17:04