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.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distributions

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

beamlogger-0.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

BeamLogger-0.1.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: BeamLogger-0.1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.12.1.2 readme-renderer/44.0 requests/2.31.0 requests-toolbelt/1.0.0 urllib3/2.0.7 tqdm/4.66.1 importlib-metadata/8.7.0 keyring/25.6.0 rfc3986/1.5.0 colorama/0.4.6 CPython/3.11.6

File hashes

Hashes for BeamLogger-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f944c91c9a92e9a51176691ca1c9931d54c30f2082be4920853d6e3a7114f0bb
MD5 3056823b3704e156e0a67aee887974b3
BLAKE2b-256 3c268903d6876ddaba4d53e6e80e522cb3c9e8c25b4f3cc6b0117ec7d09da21a

See more details on using hashes here.

File details

Details for the file beamlogger-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: beamlogger-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f9629f69d9df3f84f163c28a2ea68e3f313a82f20446783db9b6c744aaa9aa3
MD5 bd84c03b40c46aff74ca8265545fece4
BLAKE2b-256 e186a98fb6f4d0d29092f8f1d3e7ef040a271ce3aa3457e4f3ff7a786a1bba75

See more details on using hashes here.

File details

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

File metadata

  • Download URL: BeamLogger-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.12.1.2 readme-renderer/44.0 requests/2.31.0 requests-toolbelt/1.0.0 urllib3/2.0.7 tqdm/4.66.1 importlib-metadata/8.7.0 keyring/25.6.0 rfc3986/1.5.0 colorama/0.4.6 CPython/3.11.6

File hashes

Hashes for BeamLogger-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dc0b60ce622383683cf4eca06d90ef6f4d6d61ec66d76581e0b84a04fa455fc8
MD5 dc6d4ff6aed6d1283ba8bde5e74ea608
BLAKE2b-256 1f9f40196e9271d9de712cc3d9b02e6c9599c21bc2010f490efeb4bb6828e003

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