Colorful Consoles

20 years after my first experience with Windows (3.11, for workgroups!) I still find myself staring at gray terminal windows and console output. Even in the age of APIs & UI/UX designers, log files remain ugly and hard to grok.

Fortunately, things are looking up. Last week, Twilio announced that it was experimenting with color coded error reports, putting critical debug information front and center. This is great news for developers exploring the API for the first time.

So, how can you be part of the solution? If you’re writing in Ruby, get the Crayon gem from Michael Berkowitz. With its ‘format’ driven API, Crayon is like CSS for ANSI escape codes.

Crayon supports eight colors, foregrounds & backgrounds, and bold & underline styling. It’s also a lot of fun:

Happy Valentine's Day from Git@Me!

```ruby require ‘crayon’

a = Crayon.cyan_on_magenta_bold(“I’d”) b = Crayon.red_on_white(“mark”) c = Crayon.yellow(“you”) d = Crayon.blue_on_white(“down”) e = Crayon.green_bold(“any day”)

puts “\n”+a+” “+b+” “+c+” “+d+” “+e+”.\n\n” puts “Happy Valentine’s Day from [email protected] - we “ + Crayon.red_bold(“\xe2\x99\xa5”) +” you.\n\n” ```

Join the discussion

2017 Neal Shyam