{"id":23354098,"url":"https://github.com/leo-aa88/logtard","last_synced_at":"2025-10-28T22:31:00.876Z","repository":{"id":229592201,"uuid":"777128868","full_name":"araujo88/logtard","owner":"araujo88","description":"A simple, portable and dumb logging library in C++ with no bloatness nor mambo-jambo","archived":false,"fork":false,"pushed_at":"2024-04-01T21:15:15.000Z","size":136,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-21T09:19:03.169Z","etag":null,"topics":["cpp","cpp-library","cpp-logger","logger","logging-framework","logging-library"],"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/araujo88.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}},"created_at":"2024-03-25T09:00:11.000Z","updated_at":"2024-06-15T09:35:15.000Z","dependencies_parsed_at":"2024-04-01T04:30:10.567Z","dependency_job_id":null,"html_url":"https://github.com/araujo88/logtard","commit_stats":null,"previous_names":["araujo88/logtard"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/araujo88%2Flogtard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/araujo88%2Flogtard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/araujo88%2Flogtard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/araujo88%2Flogtard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/araujo88","download_url":"https://codeload.github.com/araujo88/logtard/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238734075,"owners_count":19521557,"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","cpp-library","cpp-logger","logger","logging-framework","logging-library"],"created_at":"2024-12-21T09:18:49.754Z","updated_at":"2025-10-28T22:30:55.530Z","avatar_url":"https://github.com/araujo88.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Logtard Logging Library\n\n[![license](https://img.shields.io/badge/license-MIT-green)](https://raw.githubusercontent.com/araujo88/logtard/main/LICENSE)\n[![build](https://github.com/araujo88/logtard/actions/workflows/cmake-multi-platform.yml/badge.svg?branch=main)](https://github.com/araujo88/logtard/actions/workflows/cmake-multi-platform.yml)\n\nThe Logtard Logging Library provides a flexible and easy-to-use logging system for C++ applications. It supports multiple log levels and can be extended to log messages to various outputs, with the default implementation focusing on console output with colored log levels for enhanced readability.\n\n## Features\n\n- **Multiple Log Levels:** Supports `DEBUG`, `INFO`, `WARNING`, `ERROR`, and `CRITICAL` log levels to suit different verbosity needs.\n- **Colored Output:** Enhances log readability in the console with colored log levels.\n- **Extensible Design:** Designed with extensibility in mind, allowing for the implementation of additional loggers by extending the base `Logger` class.\n- **Macro-based Logging:** Simplifies logging syntax with macros for different log levels.\n- **File Logging Support:** Introduces the `FileLogger` class for easy logging to files, enabling persistent log storage and advanced log management strategies.\n\n## Getting Started\n\n### Prerequisites\n\n- C++17 compiler (GCC, Clang, MSVC, etc.)\n- Make (optional for building examples)\n- CMake (optional)\n- Gtest (optional for testing)\n\n### Installation\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/araujo88/logtard.git\ncd logtard\n```\n\n2. Include the `logtard` library in your C++ project. There's no need to build `logtard` separately as it's header-only. Just include the relevant headers in your project.\n\n### Usage\n\n#### Console Logging\n\n1. Include the `ConsoleLogger` in your C++ file:\n\n```cpp\n#include \"console_logger.hpp\"\n```\n\n2. Create an instance of `ConsoleLogger` and use the provided macros to log messages:\n\n```cpp\nlogtard::ConsoleLogger logger;\nLOG_INFO(logger, \"This is an informational message.\");\nLOG_ERROR(logger, \"This is an error message.\");\n```\n\n#### File Logging\n\n1. Include the `FileLogger` in your C++ file:\n\n```cpp\n#include \"file_logger.hpp\"\n```\n\n2. Create an instance of `FileLogger`, specifying the log file path:\n\n```cpp\nlogtard::FileLogger logger(\"application.log\");\nLOG_INFO(logger, \"This is an informational message logged to a file.\");\nLOG_ERROR(logger, \"This is an error message logged to a file.\");\n```\n\n## Building project with CMake\n\n```cpp\ncmake -S . -B build\ncmake --build build\n```\n\n## Extending Logtard\n\nTo create a custom logger, extend the `Logger` class and implement the `log` method. Refer to `console_logger.hpp` and `console_logger.cpp` for implementation examples.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit pull requests, report bugs, and suggest features.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://raw.githubusercontent.com/araujo88/logtard/main/LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleo-aa88%2Flogtard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleo-aa88%2Flogtard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleo-aa88%2Flogtard/lists"}