#NEWLINE# def __init__( self , log_format = None , log_dir = 'logs' ) : #NEWLINE# #INDENT# if ( not log_format ) : #NEWLINE# #INDENT# self . format_string = '%h %l %u %t %r %>s %b %{Referer}i %{User-Agent}i' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . format_string = log_format #NEWLINE# #UNINDENT# self . log_dir = log_dir #NEWLINE# self . re_tsquote = re . compile ( '(\\[|\\])' ) #NEWLINE# self . field_list = [ ] #NEWLINE# for directive in self . format_string . split ( ' ' ) : #NEWLINE# #INDENT# self . field_list . append ( DIRECTIVE_MAP [ directive ] )