Skip to content

是否可以提供调试信息分组的功能 #7

@heheda123123

Description

@heheda123123

最近半年高强度使用debug-hpp, 感觉确实存在一些不便之处
比如程序里使用debug()太多之后, 输出调试信息太多, 不方便定位问题
之前提了一个issue #5 ,
但是感觉用法很繁琐,

我设想了一种新的用法

debug(), "我的变量是", your_variable
debug(1), "我的变量是1", your_variable1
debug(2), "我的变量是2", your_variable2

当定义了宏 #define DEBUG_GROUP 1 的时候只有debug(1)有效,其他的调试语句都无效
当定义了宏 #define DEBUG_GROUP 2 的时候只有debug(2)有效,其他的调试语句都无效
当不定义 DEBUG_GROUP 宏的时候,所有调试语句都有效
这样的话, 当我想针对性调试某个问题的时候就可以使用一个新的分组, 也不影响之前的调试信息

我尝试做了实现, 也使用了claude 4 opus等大语言模型, 还是写不出来, 希望小彭老师考虑下这方面的需求

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions