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:

pip install grimoire_logger

Usage

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

from grimoire_logger 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.1.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.1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: grimoire_logger-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 4f7b807898ed1664849b715cd8659268293e79365eb617d0beba870756570d40
MD5 dc8d4147b621ba04fc0c19d993770c46
BLAKE2b-256 4c7228aca320f2b5e8fb736909548a54ba416724b54ab3e3393df32020394777

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for grimoire_logger-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 db695c468029f3668ad4f4fe8b923dca6160b8f8ea547157823c274b82e4fd25
MD5 514c1f19479d148b48038530c54db20e
BLAKE2b-256 a4df9dd32a36196caac818e6909229612869e692a5be97c3a2eda180fbd61368

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