puppetlabs/puppet — pull request #390 by kelseyhightower (2012-01-23 16:12:25+00:00)
Title: Ticket/2.7.x/12080 add custom console logging to faces

Without this patch, Face commands do not support custom formatting of
console output.

This patch fixes this issue by enhancing the current console logging
destination with support for custom formatting of messages that
originate from `Puppet::Interface`.

This patch enables the ability to log warnings, errors, and notices to
stderr with better formatting and colors:

Puppet::Face.err "This error will go to stderr with nice formatting"

This patch enables the ability to color specific sections of a given string:

"This is a red #{Puppet::Face.colorize(:red, 'string'}"

Related spec tests are included.