
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
color_debug_messages
Advanced tools
= NAME
Color Debug Messages - A way to add nicer output to your script.
= DESCRIPTION
I got tired of plain output on STDOUT, and wanted a nicer way to add debug/informational messages to my scripts. This works with the idea that it is easier for our eyes to notice changes in color than changes in glyph/shape. A red error message is notices more easily than a "*****" prefix or similar.
To get this effect, we rely on Term::ANSIColor
== Install
gem install color_debug_messages
== Usage
The basic use of this script is very simple - you just include the module into your class, and call the various "puts" wrappers.
class Foo
include ColorDebugMessages
def bar(baz)
debug "This is a debug message!"
end
end
Which produces:
[Foo#bar] >>> This is a debug message!
The part in square-brackets at the beginning will be in read, which I unfortunately am having a hard time making RDoc produce.
The available message types, by default, are:
debug(msg) # ">>>" prefix, in cyan
warn(msg) # "**>" prefix, in red
info(msg) # "-->" prefix, in green
These can be changed by adding lines like this to the top of your class:
class Foo
include ColorDebugMessages
color_debug_message_type :quux, '~', :blue
def bar
quux "Test message!"
end
end
Which will produce yellow output, with the "~~>" prefix instead.
= COPYRIGHT
Copyright (c) 2010 Brent Sanders. See LICENSE for details.
FAQs
Unknown package
We found that color_debug_messages demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.