Skip to content

Instantly share code, notes, and snippets.

@rxbynerd
Created May 24, 2012 20:35
Show Gist options
  • Save rxbynerd/2784058 to your computer and use it in GitHub Desktop.
Save rxbynerd/2784058 to your computer and use it in GitHub Desktop.
Nero

Nero

Logging client for Matrix

Welcome to Second Reality. In Second Reality, You make the decisions.

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