An alternate formatter for Logger instances that outputs div
HTML fragments.
The default HTML fragment that’ll be used as the template for each log message.
The HTML fragment that will be used as a format() string for the log
Return a log message composed out of the arguments formatted using the formatter’s format string
# File lib/treequel/utils.rb, line 160
def call( severity, time, progname, msg )
args = [
time.strftime( '%Y-%m-%d %H:%M:%S' ), # %1$s
time.usec, # %2$d
Process.pid, # %3$d
Thread.current == Thread.main ? 'main' : Thread.object_id, # %4$s
severity.downcase, # %5$s
progname, # %6$s
html_escape( msg ).gsub(%r\n/, '<br />') # %7$s
]
return self.format % args
end
Override the logging formats with ones that generate HTML fragments
# File lib/treequel/utils.rb, line 143
def initialize( logger, format=HTML_LOG_FORMAT ) # :notnew:
@logger = logger
@format = format
super()
end
| / | Search |
|---|---|
| ? | Show this help |