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, error)

# Initialize the log system
log_init("log_save_path.log", use_color=True)

try:
    try:
        try:
            1 / 0
        except Exception as e:
            raise error("An error occurred during the test.", throw=None) from e
    except Exception as ee:
        raise error("An error(TimeoutError) occurred during the test.", throw=TimeoutError) from ee
except Exception:
    critical("A critical error occurred during the test.", throw=None)

Requirements

  • Python >= 3.9
  • (Optional) cobra-color >= 1.3.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.2.0.tar.gz (12.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.2.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cobra_log-1.2.0.tar.gz
  • Upload date:
  • Size: 12.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.2.0.tar.gz
Algorithm Hash digest
SHA256 8c1872e8bceb0f57a23124354301f54f58b46eca312dd62ce3bace3f05adbae1
MD5 bb7d9ba50888ef51d84a7dc64a25b1b8
BLAKE2b-256 4d7fe040f828d87b81f3ed59ad31185140abc3c6018437bb8f85c4bcffa1a481

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cobra_log-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.1 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 339aab2779afdef2b19424289dddb1613200446dc6c025c23964e0a9ff541fe3
MD5 58fb12c210b87f0ef4410196634bc958
BLAKE2b-256 46b35d3c325cded8098aac278eaf500cf6ff53a70af6993aa3a87fa253ce9d37

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