Skip to main content
error loading Epitech Logo error loading Jarbin-ToolKit Logo

📦 Jarbin-ToolKit:Log v0.2.3.1

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

  • Log stores:

    • 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.


Metadata

Release files for jarbin-toolkit-log 0.2.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jarbin-toolkit-log 0.2.3.1
File Size Uploaded Provenance Actions
jarbin_toolkit_log-0.2.3.1.tar.gz 33.1 kB Without provenance Details for jarbin_toolkit_log-0.2.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jarbin-toolkit-log 0.2.3.1
File Interpreter ABI Platform Actions
jarbin_toolkit_log-0.2.3.1-py3-none-any.whl Python 3 none any Details for jarbin_toolkit_log-0.2.3.1-py3-none-any.whl

Total release size: 53.7 kB

Release files / jarbin_toolkit_log-0.2.3.1.tar.gz

Download URL jarbin_toolkit_log-0.2.3.1.tar.gz
Size 33.1 kB
Tags Source
SHA-256 checksum
How to use checksums
183afef6521a875ef5f28fd78e1e50ee2d2b65fd07523cf65c9c454879831050
BLAKE2b-256 checksum
How to use checksums
b489cb3a1fede6abd1db0695a50f39fdd0c91c81b647cc8b91dd29b54b490643
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release files / jarbin_toolkit_log-0.2.3.1-py3-none-any.whl

Download URL jarbin_toolkit_log-0.2.3.1-py3-none-any.whl
Size 20.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
238e06e8bea14c5355d1100376e75ad7436cdc354192608a4a7b61ff3b143fc7
BLAKE2b-256 checksum
How to use checksums
3cc5615aa2fb3af8d7e0168d56067b6981ebd5254eccfe065343320105e56103
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Security for jarbin-toolkit-log 0.2.3.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page