Skip to main content

A stylish and colorful Python logging module with customizable console output

Project description

BeamLogger

A stylish and colorful Python logging module with customizable console output.

Features

  • Beautiful colorized log output with different colors for each log level
  • Custom time stamps in 12-hour format
  • Stylish banners with gradient colors using pystyle
  • Custom console window title
  • Input prompt with styled formatting
  • Multiple log levels: info, debug, log, success, input, output, error, critical, warn

Requirements

  • colorama
  • pystyle
  • Python 3.6+

Installation

pip install colorama pystyle

Usage

from beamlogger import BeamLogger

# Initialize logger with custom title
logger = BeamLogger("My Application")

# Display a banner
banner = """
██████╗ ███████╗ █████╗ ███╗   ███╗██╗      ██████╗  ██████╗  ██████╗ ███████╗██████╗ 
██╔══██╗██╔════╝██╔══██╗████╗ ████║██║     ██╔═══██╗██╔════╝ ██╔════╝ ██╔════╝██╔══██╗
██████╔╝█████╗  ███████║██╔████╔██║██║     ██║   ██║██║  ███╗██║  ███╗█████╗  ██████╔╝
██╔══██╗██╔══╝  ██╔══██║██║╚██╔╝██║██║     ██║   ██║██║   ██║██║   ██║██╔══╝  ██╔══██╗
██████╔╝███████╗██║  ██║██║ ╚═╝ ██║███████╗╚██████╔╝╚██████╔╝╚██████╔╝███████╗██║  ██║
╚═════╝ ╚══════╝╚═╝  ╚═╝╚═╝     ╚═╝╚══════╝ ╚═════╝  ╚═════╝  ╚═════╝ ╚══════╝╚═╝  ╚═╝
"""
logger.banner(banner)

# Different log levels
logger.info("This is an information message")
logger.debug("This is a debug message")
logger.log("This is a regular log message")
logger.success("This is a success message")
logger.warn("This is a warning message")
logger.error("This is an error message")
logger.critical("This is a critical message")

# Get user input
name = logger.input("Please enter your name", "Name")
logger.info(f"Hello, {name}!")

# Change console title
logger.set_title(f"New Title - {name}")

Log Format

The log format follows this pattern:

[Time stamp in 12hrs] ❆ [PREFIX] ➔ Message

For example:

[09:45:32 AM] ❆ [INFO] ➔ This is an information message

Custom Banners

You can create custom banners with different colors:

logger.banner("Your ASCII Art Here", color=pystyle.Colors.purple_to_blue, spacing=10)

Running the Example

To see BeamLogger in action, run the included example:

py example.py

Crafted With <3 By Bhaskar

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

BeamLogger-0.1.2.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

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

BeamLogger-0.1.2-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file BeamLogger-0.1.2.tar.gz.

File metadata

  • Download URL: BeamLogger-0.1.2.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.6

File hashes

Hashes for BeamLogger-0.1.2.tar.gz
Algorithm Hash digest
SHA256 18704be5805c4387c1c31fb518364bf019b111ce027b9c470007a684c42273ad
MD5 8d2c6cfc662593179d397aebd81ffedb
BLAKE2b-256 478083d5d5adc5fa82a4bffe7fdfa0f86e0c7141cdb20edb4ee2ee35cd6d5ddc

See more details on using hashes here.

File details

Details for the file BeamLogger-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: BeamLogger-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.6

File hashes

Hashes for BeamLogger-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 01d028c6a61e4ae11757546fb5d41294777dbe3bd83120fb1d0dd3c565f626e1
MD5 ace1067df7818a7df34ff45e5753a86d
BLAKE2b-256 442f9052e8f790e6eb4b39505ecc6dc7f8f88fbb6f60d0fb9a67cc7c874620f0

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