Created
May 24, 2012 20:35
-
-
Save rxbynerd/2784058 to your computer and use it in GitHub Desktop.
Nero
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "logger" | |
module Nero | |
class IO | |
def initialize(redis, tag) | |
@redis = redis | |
@tag = tag | |
end | |
def write(line) | |
@redis.rpush "matrix:queue:#{@tag}", line | |
@redis.publish "matrix:pipe:#{@tag}", line | |
end | |
def close | |
@redis.close | |
end | |
end | |
class Formatter < Logger::Formatter | |
def call(severity, time, program, msg) | |
"#{time.utc.iso8601} [#{severity.upcase}] #{msg}" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment