Skip to main content

A lightweight and easy-to-use logging library for Python.

Project description

🐱‍👓 cobra-log 🐱‍👓

PyPI version Python Tests codecov License

Pull Requests Welcome Github stars

About

A lightweight and easy-to-use logging library for Python.

  • Python: 3.9+
  • Runtime dependency: cobra-color.

Features

  • 🚀 Colorful or styled terminal output (color, style, plain).
  • 🚀 Optional file persistence with rotation.
  • 🚀 Concise exception chaining via trace_exc.
  • 🚀 Simple, dependency-light design.

Installation

Stable (once published):

pip install cobra-log

Quick Start

  • Simple warning

    from cobra_log import warning
    
    warning("warning message")
    

Example

from cobra_log import (log_init, info, warning, trace_exc)

# Initialize the log system
log_init("log_save_path", display_type="style")

try:
    try:
        1 / 0  # This will raise a ZeroDivisionError
    except Exception as e1:
        raise RuntimeError(trace_exc("This is the main exception", e1))
except Exception as e:
    warning("A warning occurred.", e)
    info("Continuing execution after warning.")

Requirements

  • Python >= 3.9
  • cobra-color >= 0.2.5

License

See LICENSE in the repository.

Links

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

cobra_log-0.1.1.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

cobra_log-0.1.1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file cobra_log-0.1.1.tar.gz.

File metadata

  • Download URL: cobra_log-0.1.1.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for cobra_log-0.1.1.tar.gz
Algorithm Hash digest
SHA256 88b501ac218121f6dc833838836955cc6caffe6fbac78df42486d05bae11c0e0
MD5 f681fe2fc796993b8fd9f379dfeb7fee
BLAKE2b-256 925a5b81cf330437f659bcfba326456cc6fcece329c9c0648c06c069b3a10193

See more details on using hashes here.

File details

Details for the file cobra_log-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cobra_log-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for cobra_log-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7250ea9922805fabc09cb3dc76519ca4735cb819900465958892cda3d57a0107
MD5 d87d2236540c0678c461c961929c1f79
BLAKE2b-256 d381c245a199632aa839c287b9a6b68daa0f0c54399db8c2a344363d2ec6c310

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