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

Uploaded Python 3

File details

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

File metadata

  • Download URL: cobra_log-1.0.1.tar.gz
  • Upload date:
  • Size: 12.0 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.1.tar.gz
Algorithm Hash digest
SHA256 29cc3ea3eda2feedd490686805d33ec97d3347fe2b7440ea83639c575cbd7b6e
MD5 e51befb769a59f69c2f2cf9ed0453082
BLAKE2b-256 2fd49290e8368a78072478f3e9b3086febd5b94625a279e24858d459f99696d7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cobra_log-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 64a7452a85a0a8acc38c9a11261c2a3a29e10ec1d588166580295dddc56baa80
MD5 9800de6c3d0c456a00ef0ec511d9f127
BLAKE2b-256 6d4bbc6b32068f9919e9c44ed5133e0c76b4bd582e6c0bc17247f65595235cce

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