def activate_debug(module):
"""
activates the given module for debugging
:param module: the module name to activate
:return: None
"""
module = str(module)
if module not in AVAILABLE_DEBUG_MODULES:
print_error("debug module '{}' is unknown, cannot activate it".format(module))
return
if module in ACTIVATED_DEBUG_MODULES:
print_error("debug module '{}' is already active".format(module))
return
# if this is the first activation set LOGFILE and print it
if not ACTIVATED_DEBUG_MODULES:
import os
global LOGFILE
LOGFILE = str(os.path.join(tempfile.gettempdir(), "outis.log"))
print_message("DEBUGGING is active, writing to debug file " + str(LOGFILE))
# add module to ACTIVATED_DEBUG_MODULES
ACTIVATED_DEBUG_MODULES.append(module)
评论列表
文章目录