{"id":20081873,"url":"https://github.com/jke94/custom-logger","last_synced_at":"2026-06-08T12:31:25.903Z","repository":{"id":199114194,"uuid":"692702041","full_name":"jke94/custom-logger","owner":"jke94","description":"A proof of concept about how to write a custom logger in C++ to be consumed by a client in delivered in dynamic library with implicit linking.","archived":false,"fork":false,"pushed_at":"2023-12-03T21:14:16.000Z","size":52,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-02T13:50:33.034Z","etag":null,"topics":["cpp","logger"],"latest_commit_sha":null,"homepage":"","language":"C++","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/jke94.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-17T10:12:14.000Z","updated_at":"2023-12-03T12:36:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"40347232-8b41-47c6-80b1-1b178b046334","html_url":"https://github.com/jke94/custom-logger","commit_stats":null,"previous_names":["jke94/custom-logger"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jke94/custom-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jke94%2Fcustom-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jke94%2Fcustom-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jke94%2Fcustom-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jke94%2Fcustom-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jke94","download_url":"https://codeload.github.com/jke94/custom-logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jke94%2Fcustom-logger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34063149,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","logger"],"created_at":"2024-11-13T15:40:41.591Z","updated_at":"2026-06-08T12:31:25.886Z","avatar_url":"https://github.com/jke94.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Custom logger\n\nA proof of concept about how to write a custom logger in C++ to be consumed by a client in delivered in dynamic library with implicit linking.\n\nStatus:\n\n| Command | Description |\n| --- | --- |\n| Linux build | [![Linux build](https://github.com/jke94/custom-logger/actions/workflows/cmake.yml/badge.svg)](https://github.com/jke94/custom-logger/actions/workflows/cmake.yml) |\n| Docker Compose Builder | [![Docker Compose Builder](https://github.com/jke94/custom-logger/actions/workflows/dockercomposebuild.yml/badge.svg)](https://github.com/jke94/custom-logger/actions/workflows/dockercomposebuild.yml) |\n\n\n## A. Quick start: How to use it.\n\nSample code:\n\n```\n#include \u003cstring\u003e\n#include \"logger_api.h\"\n\nint main()\n{\n    // Set the log channels that you want use.\n    init_logger(\"application.log\", LoggerLevel::TRACE_CHANNEL | LoggerLevel::INFO_CHANNEL);\n\n    WRITE_TRACE(\"This message wtriten in TRACE channel.\");           // Channel activated: YES\n    WRITE_INFO(\"This message wtriten in INFO channel.\");             // Channel activated: YES\n    WRITE_WARNING(\"This message wtriten in WARNING channel.\");       // Channel activated: NO\n    WRITE_ERROR(\"This message wtriten in ERROR channel.\");           // Channel activated: NO\n    WRITE_CRITICAL(\"This message wtriten in CRITICAL channel.\");     // Channel activated: NO\n\n    end_logger();\n\n    return 0;\n}\n```\nThe **application.log** file will be created will a content similar like this:\n\n```\n2023-10-08 16:45:18.718 | [TRACE] | [main.cpp:main:18] This message wtriten in TRACE channel.\n2023-10-08 16:45:18.719 | [INFO] | [main.cpp:main:19] This message wtriten in INFO channel.\n```\n\n## B. Docker compose (as linux builder and custom logger library client)\n\n- Linux:\n\n```\nsudo docker compose -f ./docker-compose.yml -p custom-logger-lib up --build\n```\n\n- Windows:\n\n```\ndocker-compose -f ./docker-compose.yml -p custom-logger-lib up --build\n```\n\n## C. Interesting links as posible examples.\n\n- [stackoverflow - c-wrapping-a-wrapper-macro-with-variable-arguments](https://stackoverflow.com/questions/22395738/c-wrapping-a-wrapper-macro-with-variable-arguments)\n\n- [Improving Print Logging with Line Pos Info \u0026 Modern C+](https://www.cppstories.com/2019/04/file-pos-log/)\n\n- [What are __FILE__, __LINE__, and __FUNCTION__ in C++](https://www.tutorialspoint.com/what-are-file-line-and-function-in-cplusplus)\n\nUseful info to install NuGet package using CMake.\n- [A bit of C++ and CMake linking help, please](https://community.gigperformer.com/t/a-bit-of-c-and-cmake-linking-help-please/11710)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjke94%2Fcustom-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjke94%2Fcustom-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjke94%2Fcustom-logger/lists"}