#NEWLINE# def SetupToolLogging( debug , verbose , threadname = False , toolname = None , logfile = pathutils . LOG_TOOLS ) : #NEWLINE# #INDENT# 'Configures the logging module for tools.\n\n  All log messages are sent to the tools.log logfile.\n\n  @type toolname: string\n  @param toolname: name of the tool that\'s logging\n  @type debug: boolean\n  @param debug: Disable log message filtering\n  @type verbose: boolean\n  @param verbose: Enable verbose log messages\n  @type threadname: boolean\n  @param threadname: Whether to include thread name in output\n  @type logfile: string\n  @param logfile: the path of the log file to use, use "None"\n    for tools which don\'t necessarily run on Ganeti nodes (and\n    thus don\'t have the Ganeti log directory).\n\n  ' #NEWLINE# if ( not toolname ) : #NEWLINE# #INDENT# toolname = 'unspecified_tool' #NEWLINE# #UNINDENT# debug_int = 0 #NEWLINE# if verbose : #NEWLINE# #INDENT# debug_int = 1 #NEWLINE# #UNINDENT# SetupLogging ( logfile , program = toolname , debug = debug_int , multithreaded = threadname , verbose = verbose )