Skip to main content

A simple Python logger, that prints in a JSON format

Project description

Grimoire Logger

Grimoire Logger is a lightweight Python logging library that outputs logs in a structured JSON format. It is designed to make log parsing and analysis easier, especially in distributed systems or environments where structured logging is essential.

Features

  • JSON-formatted logs: Logs are output in a machine-readable JSON format.
  • Multiple log levels: Supports info, warn, error, and debug levels.
  • Timestamped logs: Each log entry includes a timestamp for better traceability.
  • Source identification: Automatically includes the source file in the log output.

Installation

You can install Grimoire Logger by cloning this repository to a local place or by using pip:

git clone https://github.com/luquor/grimoire.git
---
pip install grimoire_logger

Usage

Here’s a quick example of how to use Grimoire Logger:

from grimoire import Logger

logger = Logger()

logger.info("This is an info message.")
logger.warn("This is a warning message.")
logger.error("This is an error message.")
logger.debug("This is a debug message.")

Example Output

{
  "timestamp": "2023-10-01 12:34:56",
  "level": "info",
  "source": "example.py",
  "message": "This is an info message."
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grimoire_logger-1.0.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grimoire_logger-1.0.0-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file grimoire_logger-1.0.0.tar.gz.

File metadata

  • Download URL: grimoire_logger-1.0.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for grimoire_logger-1.0.0.tar.gz
Algorithm Hash digest
SHA256 32c6851c2a7e1015df7d0e4d1d4d884d5685d8c555bc0f0e643e855098fb0dd9
MD5 f00d29f7167370636426f72c465c07d5
BLAKE2b-256 851bea536fd2c9e3ec85dd7dfd3822888fba808b278d87ffb87d341c63c8ccf3

See more details on using hashes here.

File details

Details for the file grimoire_logger-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for grimoire_logger-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0108bab8d76d8a59225cca46984c59933637f7b40383c04972cf95cbd7342fe7
MD5 80117e3d77bfcf0a40184839b9ac893d
BLAKE2b-256 bfc77e9860cbcdf7e2a3a3e23598d46b5071f9b3285ecd5eb726e321e0ed171f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page