{"id":22574765,"url":"https://github.com/rbento/cpp-visual-studio-log","last_synced_at":"2025-04-10T16:10:28.801Z","repository":{"id":169927715,"uuid":"326973087","full_name":"rbento/cpp-visual-studio-log","owner":"rbento","description":"Quick logging to the Visual Studio Output window.","archived":false,"fork":false,"pushed_at":"2024-07-11T16:49:12.000Z","size":29,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-24T13:51:22.349Z","etag":null,"topics":["cpp","visual-studio"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rbento.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-05T11:07:48.000Z","updated_at":"2024-07-11T16:49:15.000Z","dependencies_parsed_at":"2024-07-11T19:15:08.149Z","dependency_job_id":null,"html_url":"https://github.com/rbento/cpp-visual-studio-log","commit_stats":null,"previous_names":["rbento/cpp-visual-studio-log"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbento%2Fcpp-visual-studio-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbento%2Fcpp-visual-studio-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbento%2Fcpp-visual-studio-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbento%2Fcpp-visual-studio-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rbento","download_url":"https://codeload.github.com/rbento/cpp-visual-studio-log/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248250765,"owners_count":21072683,"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","visual-studio"],"created_at":"2024-12-08T03:07:57.195Z","updated_at":"2025-04-10T16:10:28.783Z","avatar_url":"https://github.com/rbento.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OutputDebug.h\n\nConvenience debug logging macros for C++ projects.\n\nBased on the [OutputDebugStringA](https://learn.microsoft.com/en-us/windows/win32/api/debugapi/nf-debugapi-outputdebugstringa) that sends a string to the debugger for display, which then shows up in the Visual Studio Output window.\n\n### Usage\n---\n\n```\n#include \"OutputDebug.h\"\n\nint main() \n{ \n    Info(\"GameObject.Id %d\", 42); \n}\n```\n\n###### The Visual Studio flag `_DEBUG` controls whether OutputDebug is enabled\n\nThis flag is present by default in Visual Studio C/C++ projects in Debug configuration and not present in Release, so nothing has to be configured.\n\nJust in case, it is set at `Project Properties` \u003e `Configuration Properties` \u003e `C/C++` \u003e `Preprocessor` \u003e `Preprocessor Definitions`.\n\nWhen disabled, calls are replaced with a noop version of the logging function.\n\n###### Customize the output debug string and format length\n\n```\n#define _OUTPUT_DEBUG_FORMAT_LENGTH 384\n#define _OUTPUT_DEBUG_STRING_LENGTH 1024\n```\n\n### Disable the external Command Prompt Console Window in Visual Studio \n---\n \nFor a C++ project on Visual Studio, one can avoid launching the separate Command prompt and keeping all log in the Visual Studio Output window with the following Project Properties:\n\n##### Linker \u003e System \u003e SubSystem\n \n```\n/SUBSYSTEM:WINDOWS\n```\n  \n##### Linker \u003e Command Line \u003e Additional Options\n \n```\n/ENTRY:mainCRTStartup\n```\n\n##### Or alternatively add the preprocessor comment\n \n```\n#pragma comment(linker, \"/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup\")\n```\n \nSee: [https://docs.microsoft.com/en-us/cpp/build/reference/entry-entry-point-symbol][1]\n\n [1]: https://docs.microsoft.com/en-us/cpp/build/reference/entry-entry-point-symbol\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbento%2Fcpp-visual-studio-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frbento%2Fcpp-visual-studio-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbento%2Fcpp-visual-studio-log/lists"}