Skip to content

Instantly share code, notes, and snippets.

View billmers's full-sized avatar

Bill Mers billmers

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>elasticsearch</string>
<key>ProgramArguments</key>
<array>
@billmers
billmers / colorized_formatter.rb
Created February 16, 2013 00:54
colorized logger #ruby #rails
module Logging
class ColorizedFormatter
SEVERITY_TO_ANSI_CODE ||= {'DEBUG'=>'0;37', 'INFO'=>'1;37', 'WARN'=>'1;33', 'ERROR'=>'0;31', 'FATAL'=>'1;31', 'UNKNOWN'=>'1;34'}
def call(severity, time, progname, msg)
return "#{msg}\n" if Rails.application.config.colorize_logging == false
reset_code = "\033[0m"
color_code = "\033[" + SEVERITY_TO_ANSI_CODE[severity] + "m"