Releases: rfxn/tlog_lib
Releases · rfxn/tlog_lib
v2.0.4
Bug Fixes
- Replace bare
rm/mvwithcommand rm/command mvintlog_lib.shandtlogCLI for shell alias safety on all target platforms - Add inline comments to all
2>/dev/nulland|| truesuppressions per shell standards convention
Full Changelog: v2.0.3...v2.0.4
tlog_lib v2.0.2
tlog_lib v2.0.2
New Features
- CLI version cross-check — warns when tlog and tlog_lib.sh versions diverge after sourcing
- Baserun advisory warnings — library warns when baserun directory is world-writable; CLI warns when running as root with default
/tmpcursor storage; non-fatal, directs to-b/--baserun - Journal flock support —
tlog_journal_read()supports optional cursor locking viaTLOG_FLOCK=1; returns exit 4 on contention - 67 new BATS tests (129 → 196 total)
Bug Fixes
- Rotation pipe fallback — when mktemp fails or decompression write fails, fall back to pipe-based decompression instead of silently dropping rotated content
- Baserun directory validation — validated before processing in
tlog_read(),tlog_journal_read(), andtlog_advance_cursors() - Arithmetic input validation —
SCAN_MAX_LINES,SCAN_TIMEOUT, andmax_linesarguments validated; non-numeric values default to 0 with stderr warning --statussubcommand — correctly display corrupt cursor state with raw content for diagnosis; add exit code note to help text--resetsubcommand — clean up orphaned journal timestamp temp files alongside cursor temp files- README — document return codes for journal read functions
Changes
- Extract rotation into
_tlog_handle_rotation()helper; decompress once to temp file - Internal code cleanup: consolidate duplicated helpers, remove CLI/library function collision, add stderr warnings on cursor write failures
- CLI
--first-runflag validates value (must beskiporfull) - CI and test infrastructure: lint gating,
bash -nin CI, dynamic version assertions, test dedup
Full Changelog
See CHANGELOG
tlog_lib v2.0.1
tlog_lib v2.0.1 — Incremental Log Reader for Bash
Shared Bash library for cursor-based incremental log file reading with multi-mode tracking, rotation-aware delta reads, systemd journal fallback, and atomic cursor writes.
Highlights
- Two tracking modes — byte-offset (
tail -c) for throughput or line-count (tail -n) for whole-line output - Log rotation aware —
.1and compressed variants (.gz,.xz,.bz2,.zst,.lz4) with runtime tool detection; supports bothcreateandcopytruncatelogrotate strategies - Atomic cursor writes —
mktemp+mv -fensures cursors never corrupt on crash - Optional flock locking — prevents cursor races between cron and daemon
- Standalone CLI —
tlogwrapper with option flags, subcommands (--full,--status,--reset,--adjust), and backward-compatible positional interface - Cursor validation — regex check, auto-reset on corruption, path traversal rejection, mode validation
- 133 BATS tests across 9 OS targets (CentOS 6 through Rocky 10)
- Zero external dependencies beyond POSIX coreutils
Changelog
See CHANGELOG.RELEASE for the full tagged entry list (13 [New], 4 [Fix]).
Platform Support
| Distribution | Versions | Bash |
|---|---|---|
| CentOS | 6, 7 | 4.1, 4.2 |
| Rocky Linux | 8, 9, 10 | 4.4, 5.1, 5.2 |
| Debian | 12 | 5.2 |
| Ubuntu | 12.04, 14.04, 20.04, 24.04 | 4.2–5.2 |
Minimum: Bash 4.1 (CentOS 6, 2011). No Bash 4.2+ features used.