Class: OMF::Web::Widget::Log::WebFormatter
- Inherits:
-
Log4r::BasicFormatter
- Object
- Log4r::BasicFormatter
- OMF::Web::Widget::Log::WebFormatter
- Defined in:
- lib/omf-web/widget/UNUSED/log/log_outputter.rb
Overview
LogOutputter
Instance Method Summary collapse
Instance Method Details
#format(event) ⇒ Object
39 40 41 42 43 44 45 46 47 |
# File 'lib/omf-web/widget/UNUSED/log/log_outputter.rb', line 39 def format(event) lname = Log4r::LNAMES[event.level] fs = "<tr class=\"log_#{lname.downcase}\"><td class='%s'>%s</td><td class='name'>%s" buff = sprintf(fs, lname.downcase, lname, event.name) buff += (event.tracer.nil? ? "" : "(#{event.tracer[0]})") + ":</td>" data = format_object(event.data).gsub(/</, '<') buff += sprintf("<td class='data'>%*s</td></tr>", Log4r::MaxLevelLength, data) buff end |