def __init__(self, msg=None): showErrorMsg = '\nIxLoadRestApiException error: {0}\n\n'.format(msg) print(showErrorMsg) if Main.enableDebugLogFile: with open(Main.debugLogFile, 'a') as restLogFile: restLogFile.write(showErrorMsg) class Main(): debugLogFile = None enableDebugLogFile = False