class Loggerman::Formatters::Formatter
Public Instance Methods
clean_message(message)
click to toggle source
# File lib/loggerman/formatters/formatter.rb, line 11 def clean_message(message) if message.is_a?(String) message = message.strip.gsub(/\e\[(\d+)m/, '') message = eval(message) end message rescue Exception => e message end
convert_exception(exception)
click to toggle source
# File lib/loggerman/formatters/formatter.rb, line 8 def convert_exception(exception) ; raise NotImplementedError end
convert_hash(args)
click to toggle source
# File lib/loggerman/formatters/formatter.rb, line 7 def convert_hash(args) ; raise NotImplementedError end
convert_other(message)
click to toggle source
# File lib/loggerman/formatters/formatter.rb, line 9 def convert_other(message) ; raise NotImplementedError end
convert_string(message)
click to toggle source
# File lib/loggerman/formatters/formatter.rb, line 6 def convert_string(message) ; raise NotImplementedError end
format_log(severity, timestamp, progname, message)
click to toggle source
# File lib/loggerman/formatters/formatter.rb, line 5 def format_log(severity, timestamp, progname, message) ; raise NotImplementedError end
format_message(message)
click to toggle source
# File lib/loggerman/formatters/formatter.rb, line 21 def format_message(message) message = clean_message(message) case message when ::String convert_string(message) when ::Hash convert_hash(message) when ::Exception convert_exception(message) else convert_other(message) end end