{"id":21684065,"url":"https://github.com/cgkantidis/cpp_dbg_out","last_synced_at":"2025-03-20T11:24:36.470Z","repository":{"id":62802051,"uuid":"562617506","full_name":"cgkantidis/cpp_dbg_out","owner":"cgkantidis","description":"A dbg_out variadic macro that prints the function, file, line and the rest of the arguments from where it's called, to the standard output.","archived":false,"fork":false,"pushed_at":"2022-12-01T00:24:44.000Z","size":19,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-25T11:43:10.536Z","etag":null,"topics":["cpp","debug","variadic-function","variadic-macro"],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cgkantidis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-06T21:57:35.000Z","updated_at":"2023-01-23T16:19:28.000Z","dependencies_parsed_at":"2023-01-22T08:15:34.719Z","dependency_job_id":null,"html_url":"https://github.com/cgkantidis/cpp_dbg_out","commit_stats":null,"previous_names":["cgkantidis/cpp_dbg_out","christosg88/cpp_dbg_out"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgkantidis%2Fcpp_dbg_out","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgkantidis%2Fcpp_dbg_out/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgkantidis%2Fcpp_dbg_out/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgkantidis%2Fcpp_dbg_out/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cgkantidis","download_url":"https://codeload.github.com/cgkantidis/cpp_dbg_out/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244602193,"owners_count":20479577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","debug","variadic-function","variadic-macro"],"created_at":"2024-11-25T16:14:28.474Z","updated_at":"2025-03-20T11:24:36.446Z","avatar_url":"https://github.com/cgkantidis.png","language":"CMake","readme":"## cpp_dbg_out\nA `dbg_out` [variadic macro](https://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html) that prints the function, file, line and the rest of the arguments from where it's called, to the standard output.\n\nThe developer can enable the debug messages by defining `ENABLE_DBG_OUT`, and change the call to a no-op by not defining `ENABLE_DBG_OUT`.\n\nIt is thread-safe to call this macro from multiple threads.\n\nIt works both in gcc and clang, and requires C++17.\n\n## Compile and run\n\n```bash\ncmake -S . -B build\ncmake --build build\n./build/main\n```\n\nSo this call inside main(), in the main.cpp file at line 29\n\n```cpp\ndbg_out(\"Hello\", \"World\", 3);\n```\n\nWill print:\n\n```\nmain main.cpp:29 Hello World 3\n```\n\n## Disable the `dbg_out`\n\nTo disable the printing of the debug messages, just comment out the\n\n```cpp\n#define ENABLE_DBG_OUT\n```\n\nThe definition of `ENABLE_DBG_OUT` can also be done from the terminal, by adding the `-DENABLE_DBG_OUT` compilation option.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgkantidis%2Fcpp_dbg_out","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcgkantidis%2Fcpp_dbg_out","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgkantidis%2Fcpp_dbg_out/lists"}