Skip to main content

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 (Cross-platform - Windows, Linux, macOS)
  • 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 BeamLogger

Usage

from beamlogger import BeamLogger
import platform

# Initialize logger with custom title
system = platform.system()
logger = BeamLogger(f"My Application on {system}")

# 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

Changelog

v0.1.3

  • Added cross-platform support for console title setting (Windows, Linux, macOS)
  • Fixed console title setting errors on Linux systems
  • Improved error handling for platform-specific features

Crafted With <3 By Bhaskar

Metadata

Release files for BeamLogger 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for BeamLogger 0.1.5
File Size Uploaded
BeamLogger-0.1.5.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for BeamLogger 0.1.5
File Interpreter ABI Platform
BeamLogger-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 12.4 kB

Release files / BeamLogger-0.1.5.tar.gz

Download URL BeamLogger-0.1.5.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fa96a5cbc4db3c6a295eb3176740a2ea262d38ebb79c7617dd6d383cd4296d5d
BLAKE2b-256 checksum
How to use checksums
0fb4f94b2d8ca7b1c32c10dc619a0e4fcbddbd5ad39ecbba6d41f8c6edc7ae5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.6

Release files / BeamLogger-0.1.5-py3-none-any.whl

Download URL BeamLogger-0.1.5-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f31d41414d0ca6c9dcd6848887f69fbab9f07e36712ef756be8b71f78f3e80ae
BLAKE2b-256 checksum
How to use checksums
024d1f45ac4f46d43adda911649b9f564e8ec43fdb70b5fb7a3d672dcf2cdeab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.6

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page