def get_log_line(req, res, trans_time, additional_info):
 policy_index = get_policy_index(req.headers, res.headers)
 return ('%s - - [%s] "%s %s" %s %s "%s" "%s" "%s" %.4f "%s" %d %s' % (req.remote_addr, time.strftime('%d/%b/%Y:%H:%M:%S +0000', time.gmtime()), req.method, req.path, res.status.split()[0], (res.content_length or '-'), (req.referer or '-'), req.headers.get('x-trans-id', '-'), (req.user_agent or '-'), trans_time, (additional_info or '-'), os.getpid(), (policy_index or '-')))

def get_log_line ( req , res , trans_time , additional_info ) : policy_index = get_policy_index ( req . headers , res . headers ) return ( '%s - - [%s] "%s %s" %s %s "%s" "%s" "%s" %.4f "%s" %d %s' % ( req . remote_addr , time . strftime ( '%d/%b/%Y:%H:%M:%S +0000' , time . gmtime ( ) ) , req . method , req . path , res . status . split ( ) [ 0 ] , ( res . content_length or '-' ) , ( req . referer or '-' ) , req . headers . get ( 'x-trans-id' , '-' ) , ( req . user_agent or '-' ) , trans_time , ( additional_info or '-' ) , os . getpid ( ) , ( policy_index or '-' ) ) )
make a line for logging that matches the documented log line format for backend servers .