format(format_string, params) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/webrick/accesslog.rb, line 118
    def format(format_string, params)
      format_string.gsub(/\%(?:\{(.*?)\})?>?([a-zA-Z%])/){
         param, spec = $1, $2
         case spec[0]
         when ee, ii, nn, oo
           raise AccessLogError,
             "parameter is required for \"#{spec}\"" unless param
           (param = params[spec][param]) ? escape(param) : "-"
         when tt
           params[spec].strftime(param || CLF_TIME_FORMAT)
         when pp
           case param
           when 'remote'
             escape(params["i"].peeraddr[1].to_s)
           else
             escape(params["p"].to_s)
           end
         when %%
           "%"
         else
           escape(params[spec].to_s)
         end
      }
    end
Register or log in to add new notes.