Skip to main content

Colorful Debug

Author: Nabil El Ouaamari (nabil.elouaamari.dev@gmail.com)

Description

Colorful Debug is a Python module that provides colorful and customizable debug print messages with timestamps. It's designed to make debugging your applications more user-friendly and visually appealing.

Installation

You can install Colorful Debug using pip:

pip install colorful_debug

Usage

from colorful_debug import ColorfulDebug

# As default, timestamp and bold font are enabled
debug = ColorfulDebug(show_timestamp=True, all_bold=False)

# Print debug messages with different message types
debug.print(message, msg_type="normal", ov_bold=None)           # default behavior, 'ov_bold' overrides all_bold
debug.print("This is a normal message")                         # color is 'white' by default
debug.print("This is a warning message", msg_type="warning")    # color is 'yellow' by default
debug.print("This is an info message", msg_type="info")         # color is 'cyan' by default
debug.print("This is an error message", msg_type="error")       # color is 'red' by default

Customization

# Customize color and prefix for different message types
debug.set_color("warning", "yellow")
debug.set_prefix("info", "[Info]")

# Disable timestamp
debug.set_show_timestamp(False)

# Create a new message type
debug.new_message_type("success", prefix="[Success]", suffix="", color="green", bold=False)

# Use the new message type
debug.print("This is a success message", msg_type="success")

# Update the new message type
debug.set_color("success", "blue")
debug.set_prefix("success", "[OK]")
debug.set_suffix("success", " (OK)")
debug.set_bold("success", True)

Configuration

You can configure Colorful Debug to fit your needs. Customize colors, prefixes, timestamps, and more.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Contact / Support

If you have any questions, suggestions, or concerns, feel free to contact me at nabil.elouaamari.dev@gmail.com.

Acknowledgements

Metadata

Release files for colorful-debug 1.0.2

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

Built distribution (wheel)

Table of built distributions (wheels) for colorful-debug 1.0.2
File Interpreter ABI Platform
colorful_debug-1.0.2-py3-none-any.whl Python 3 none any Details

Release files / colorful_debug-1.0.2-py3-none-any.whl

Download URL colorful_debug-1.0.2-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ee16124053dfa4743f250820d081490e182e5deb7173eb435d3d3c19cea9c47
BLAKE2b-256 checksum
How to use checksums
0bc9b1cb786729d616018b6ebe7c1404e36aebfd06bd35be4d81b7e9e1301acf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release history Release notifications | RSS feed

This release

1.0.2 This release

1 release file

1.0.1

2 release files

1.0.0

2 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