log.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:outis 作者: SySS-Research 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号