method
format
format(format_string, params)
public
Hide source
# File lib/webrick/accesslog.rb, line 49 def format(format_string, params) format_string.gsub(/\%(?:\{(.*?)\})?>?([a-zA-Z%])/){ param, spec = $1, $2 case spec[0] when ?e, ?i, ?n, ?o raise AccessLogError, "parameter is required for \"#{spec}\"" unless param params[spec][param] || "-" when ?t params[spec].strftime(param || CLF_TIME_FORMAT) when ?% "%" else params[spec] end } end