#NEWLINE# def __init__( self , name , start = False , profile_sql = False , connection_names = ( 'default' , ) ) : #NEWLINE# #INDENT# 'Constructor\n\n        :param name: name of the Profiler instance\n        :type name: string\n        :param start: whether to start immediately after Profiler instantiation\n        :type start: bool\n        :param profile_sql: whether to profile sql queries or not\n        :type profile_sql: bool\n        :param connection_names: names of database connections to profile\n        :type connection_names: tuple\n        :returns: Profiler instance\n        :rtype: profiling.Profiler\n\n        ' #NEWLINE# if ( ( settings is not None ) and hasattr ( settings , 'PROFILING_LOGGER_NAME' ) ) : #NEWLINE# #INDENT# logger_name = settings . PROFILING_LOGGER_NAME #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logger_name = __name__ #NEWLINE# #UNINDENT# if ( name . find ( ' ' ) == ( - 1 ) ) : #NEWLINE# #INDENT# logger_name += '.{0}' . format ( name ) #NEWLINE# #UNINDENT# self . log = logging . getLogger ( logger_name ) #NEWLINE# self . name = name #NEWLINE# self . pre_queries_cnt = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . profile_sql = profile_sql #NEWLINE# try : #NEWLINE# #INDENT# assert isinstance ( connection_names , tuple ) #NEWLINE# self . connection_names = connection_names #NEWLINE# #UNINDENT# except AssertionError : #NEWLINE# #INDENT# self . connection_names = ( 'default' , ) #NEWLINE# #UNINDENT# if start : #NEWLINE# #INDENT# self . start ( )