Skip to main content

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

Project description

🐱‍👓 cobra-log 🐱‍👓

PyPI version Python codecov License

Tests Github stars

About

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

  • Python: 3.9+

Features

  • 🚀 Vivid and detailed terminal output (need cobra-color).
  • 🚀 Optional file persistence with rotation.
  • 🚀 Simple, dependency-light design.

Installation

Stable (once published):

pip install cobra-log

Quick Start

  • Simple warning

    from cobra_log import warning, log_init
    
    log_init("your_log_file.log")
    
    warning("warning message")
    

Example

from cobra_log import (log_init, info, warning)

# 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("This is the main exception")
except Exception as e:
    warning("A warning occurred.", e)
    info("Continuing execution after warning.")

Requirements

  • Python >= 3.9
  • (Optional) cobra-color >= 1.2.0

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-1.0.0.tar.gz (11.9 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-1.0.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for cobra_log-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8cc724bb73436738d0868d26c0f7556b9392acb208e0a6ab0f22ce0586722405
MD5 8548f4e5a68ccff49da0c58489415fe2
BLAKE2b-256 6fd03d7f0d5d69c363c2909cd297c53967cfde23b041ae3c12b77f9e3d107f80

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cobra_log-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.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-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa88429c4f0ac22009bcb9ac2e597578af70cd2fc5d1c8ef9a9f1b07bf48ba85
MD5 4a7ba49c7398022c9474c6b638c396cb
BLAKE2b-256 3523faa6168c4aa75c999dc7684a76315bdca6635266a16d4b011901a1d5af11

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