Log tool (Create / Log / Read / etc...)
Project description
๐ฆ Jarbin-ToolKit:Log v0.2.1.5
Deterministic file-based logging system with structured formatting, filtering, and dual output modes (jar-log / JSON)
๐น Short Description
Jarbin-ToolKit Log is a lightweight logging system that writes structured log entries to file-based outputs with support for formatted text logs and JSON logs, including filtering, cleaning, and terminal rendering.
It provides:
- structured log file creation
- dual format support (
jar-log/json) - runtime log writing and reading
- filtering and formatting utilities
- log compression and cleaning tools
- terminal-rendered log visualization
It is not a monitoring system, but a deterministic file-based logging abstraction layer.
๐น Authors
- Nathan (Jarjarbin06)
- Jarbin Studio
๐น License
GPL v3
๐น Target Audience
This library is intended for:
- Python developers needing structured logging systems
- projects requiring file-based audit trails
- CLI tools needing formatted terminal logs
- systems requiring lightweight observability layers
- developers building debugging or tracing utilities
๐น Platform Support
- Python โฅ 3.10
- Standard library only
- Cross-platform (Linux / Windows / macOS)
- No external dependencies
๐น Purpose
Jarbin-ToolKit Log aims to:
- provide deterministic log file creation
- support structured and human-readable logging formats
- enable filtering and post-processing of logs
- offer terminal-friendly log visualization
- support lightweight JSON logging pipelines
It is not a distributed logging system, but a local deterministic logging abstraction layer over file I/O.
๐น Key Features
- Dual format logging (
jar-log,json) - Timestamped structured log entries
- Severity-based log levels (INFO, DEBUG, WARN, ERROR, CRIT, VALID)
- Terminal rendering with ANSI coloring
- Filtering system (keyword-based)
- Log compression and deduplication
- Comment insertion in logs
- File lifecycle management (create, read, close, delete)
- Log existence detection utility
๐น Architecture Overview
User Code
โ
โผ
Log(path, file_name, format)
โ
โโโโโโโโโโโโโโโโโ
โผ โผ
jar-log JSON mode
โ โ
โผ โผ
Formatted lines Structured objects
โ โ
โโโโโโโโโฌโโโโโโโโ
โผ
File storage layer
โ
โผ
Read / Filter / Render
๐น Core Concept
The system is based on a single entity:
Log
A file-backed logging object responsible for writing, formatting, and managing log entries.
Log(path, file_name=None, json=False)
Execution model:
- logs are appended immediately to file
- formatting depends on file type
- logs are immutable once written
- post-processing is read-based
๐น API / Function Documentation
๐น Log
| Name | Description |
|---|---|
__init__ |
Creates log file and initializes format |
log |
Writes structured log entry |
comment |
Writes non-structured comment lines |
save |
Internal write operation |
close |
Finalizes and closes log file |
delete |
Removes log file |
read |
Reads raw log content |
__str__ |
Returns formatted log view |
str_filtered |
Returns filtered formatted logs |
_jar_log_str |
Terminal rendering for jar-log |
_json_str |
Terminal rendering for JSON logs |
clean |
Compresses and simplifies logs |
exist |
Static file existence checker |
__repr__ |
Debug representation |
๐น Project Structure
jarbin_toolkit_log/
โโโ log.py
โโโ __init__.py
๐น Usage Section
๐น Basic Logging
from jarbin_toolkit_log import Log
log = Log("./logs", "app")
log.log("INFO", "startup", "Application initialized")
log.log("ERROR", "db", "Connection failed")
log.close()
๐น JSON Mode
log = Log("./logs", "app", json=True)
log.log("INFO", "server", "Started successfully")
log.close()
๐น Filtering Output
print(log.str_filtered(["ERROR"]))
๐น Terminal Rendering
print(str(log))
๐น Cleaning Logs
cleaned = log.clean(compress_repeats=True)
print(cleaned)
๐น Build / Installation
Installation
pip install jarbin-toolkit-log
๐น Execution Behavior
- log creation is immediate and file-backed
- logs are appended sequentially
- formatting depends on selected backend
- JSON mode produces structured arrays
- jar-log mode produces human-readable streams
- close() finalizes file integrity (especially JSON)
๐น Memory Model
-
Logstores:- file path
- file name
- format mode (jar-log / json)
- closed state flag
No in-memory log buffering (writes are immediate).
๐น Design Philosophy
- deterministic file output over runtime buffering
- explicit log lifecycle management
- dual-format compatibility
- post-processing over runtime transformation
- minimal dependency design
๐น Current State
โ ๏ธ Core logging engine is functional and stable
Status:
- jar-log format implemented
- JSON format implemented
- filtering system implemented
- terminal rendering implemented
- log cleaning and compression implemented
Limitations:
- JSON comment support incomplete
- no asynchronous logging
- no rotation system
- no concurrency protection
- no streaming/log tailing support
๐น Limitations
- no multi-process safety
- no automatic log rotation
- JSON format sensitive to manual corruption
- performance not optimized for high-frequency logging
- filtering is post-read only (not indexed)
๐น Extension / Contribution
Possible extensions:
- log rotation system
- async logging backend
- multi-thread safe writes
- structured query system
- real-time log streaming
- indexing for faster filtering
๐น Notes
This system is designed as a lightweight deterministic logging abstraction, not a production-grade distributed observability stack.
It prioritizes:
- simplicity
- transparency
- structured output
- predictable file behavior
๐น Identity Summary
Jarbin-ToolKit Log is:
- a structured file logging system
- a deterministic logging abstraction layer
- a dual-format log writer (text + JSON)
- a lightweight debugging and tracing utility
๐น Final Rule
If a log entry is not explicitly written, it does not exist.
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
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
File details
Details for the file jarbin_toolkit_log-0.2.1.5.tar.gz.
File metadata
- Download URL: jarbin_toolkit_log-0.2.1.5.tar.gz
- Upload date:
- Size: 32.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1afec3869b388fe46c6391dc82dfee192e9c76f6607e51833fe8efb4ba02a54
|
|
| MD5 |
d4890a290581f995f731deb6a7dac12f
|
|
| BLAKE2b-256 |
ebe1838738548ee4b02c4f873f0504beaf8598bc86b9b3004e30991145687d66
|
File details
Details for the file jarbin_toolkit_log-0.2.1.5-py3-none-any.whl.
File metadata
- Download URL: jarbin_toolkit_log-0.2.1.5-py3-none-any.whl
- Upload date:
- Size: 20.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16f30faee8a28278b9c68d6e20c0fdadba15a75b64c6b524b73547e3af58cd00
|
|
| MD5 |
6c2c0d1622f4a2da837e2b2b75506e72
|
|
| BLAKE2b-256 |
bb52fd3a5f10e33e09d44d1242755e191fe07edc68b50388e0515cabfd919574
|