Fluent::Logger::TextLogger

Public Class Methods

new() click to toggle source
# File lib/fluent/logger/text_logger.rb, line 22
def initialize
  require 'yajl'
  @time_format = "%b %e %H:%M:%S"
end

Public Instance Methods

post_with_time(tag, map, time) click to toggle source
# File lib/fluent/logger/text_logger.rb, line 27
def post_with_time(tag, map, time)
  a = [time.strftime(@time_format), " ", tag, ":"]
  map.each_pair {|k,v|
    a << " #{k}="
    a << Yajl::Encoder.encode(v)
  }
  post_text a.join
  true
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.