class Fluent::Logger::TextLogger

Public Class Methods

new() click to toggle source
# File lib/fluent/logger/text_logger.rb, line 21
def initialize
  require 'json'
  @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 26
def post_with_time(tag, map, time)
  a = [time.strftime(@time_format), " ", tag, ":"]
  map.each_pair { |k,v|
    a << " #{k}="
    a << JSON.dump(v)
  }
  post_text a.join
  true
end