Skip to content

增加了调试信息分组的功能#8

Open
heheda123123 wants to merge 3 commits into
archibate:mainfrom
heheda123123:main
Open

增加了调试信息分组的功能#8
heheda123123 wants to merge 3 commits into
archibate:mainfrom
heheda123123:main

Conversation

@heheda123123
Copy link
Copy Markdown

@heheda123123 heheda123123 commented May 30, 2025

#7
修改不影响现有功能

没有定义DEBUG_GROUP 则所有debug都有效
如果定义了DEBUG_GROUP ,则只有指定分组的debug会有效
示例代码


#define DEBUG_GROUP 2
#include "debug.hpp"
#include <iostream>
#include <vector>

int main(int argc, char **argv) {
  // 测试原始debug()功能
  debug(), "xxx", "hello";

  // 测试debug分组功能
  int my_var = 100;
  std::vector<int> my_vec = {10, 20, 30};

  debug(), "123", my_var;

  debug(1), "222", my_var;
  debug(1), "333", my_var;
  debug(2), "444", my_var;
  return 0;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant