Skip to main content

Bring visual effect to your logging message.

Project description

Documentation Status https://github.com/MacHu-GWU/vislog-project/actions/workflows/main.yml/badge.svg https://codecov.io/gh/MacHu-GWU/vislog-project/branch/main/graph/badge.svg https://img.shields.io/pypi/v/vislog.svg https://img.shields.io/pypi/l/vislog.svg https://img.shields.io/pypi/pyversions/vislog.svg https://img.shields.io/badge/Release_History!--None.svg?style=social https://img.shields.io/badge/STAR_Me_on_GitHub!--None.svg?style=social
https://img.shields.io/badge/Link-Document-blue.svg https://img.shields.io/badge/Link-API-blue.svg https://img.shields.io/badge/Link-Install-blue.svg https://img.shields.io/badge/Link-GitHub-blue.svg https://img.shields.io/badge/Link-Submit_Issue-blue.svg https://img.shields.io/badge/Link-Request_Feature-blue.svg https://img.shields.io/badge/Link-Download-blue.svg

Welcome to vislog Documentation

https://vislog.readthedocs.io/en/latest/_static/vislog-logo.png

vislog is a ZERO-dependency logging library that brings visual effect to your logging message. It allows you to use any logging library you like, and just add visual effect.

@logger.emoji_block(msg="build", emoji="🏭")
def run_build():
    time.sleep(1)
    logger.info("run build")

@logger.emoji_block(msg="test", emoji="🧪")
def run_test():
    time.sleep(1)
    logger.info("run test")
    with logger.nested():
        run_build()

@logger.emoji_block(msg="deploy", emoji="🚀")
def run_deploy():
    time.sleep(1)
    logger.info("run deploy")
    with logger.nested():
        run_test()

run_deploy()

Will show:

[User 2024-06-16 15:06:44] +----- 🕑 🚀 Start 'deploy' -----------------------------------------------------+
[User 2024-06-16 15:06:44] 🚀
[User 2024-06-16 15:06:45] 🚀 run deploy
[User 2024-06-16 15:06:45] 🚀 +----- 🕑 🧪 Start 'test' -----------------------------------------------------+
[User 2024-06-16 15:06:45] 🚀 🧪
[User 2024-06-16 15:06:46] 🚀 🧪 run test
[User 2024-06-16 15:06:46] 🚀 🧪 +----- 🕑 🏭 Start 'build' --------------------------------------------------+
[User 2024-06-16 15:06:46] 🚀 🧪 🏭
[User 2024-06-16 15:06:47] 🚀 🧪 🏭 run build
[User 2024-06-16 15:06:47] 🚀 🧪 🏭
[User 2024-06-16 15:06:47] 🚀 🧪 +----- ⏰ ✅ 🏭 End 'build', elapsed = 1.01 sec ------------------------------+
[User 2024-06-16 15:06:47] 🚀 🧪
[User 2024-06-16 15:06:47] 🚀 +----- ⏰ ✅ 🧪 End 'test', elapsed = 2.02 sec ---------------------------------+
[User 2024-06-16 15:06:47] 🚀
[User 2024-06-16 15:06:47] +----- ⏰ ✅ 🚀 End 'deploy', elapsed = 3.03 sec ---------------------------------+

Install

vislog is released on PyPI, so all you need is to:

$ pip install vislog

To upgrade to latest version:

$ pip install --upgrade vislog

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

vislog-0.1.2.tar.gz (14.4 kB view hashes)

Uploaded Source

Built Distribution

vislog-0.1.2-py3-none-any.whl (12.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page