{"id":23946048,"url":"https://github.com/vincent-devine/omlogger","last_synced_at":"2026-04-13T21:32:14.137Z","repository":{"id":271110275,"uuid":"912414697","full_name":"Vincent-Devine/OMLogger","owner":"Vincent-Devine","description":"OMLogger (One More Logger) is a single-header logging library for C++20.","archived":false,"fork":false,"pushed_at":"2025-04-24T20:05:07.000Z","size":96,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-08T13:04:43.884Z","etag":null,"topics":["cpp20","library","logger","windows"],"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/Vincent-Devine.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,"zenodo":null}},"created_at":"2025-01-05T14:11:05.000Z","updated_at":"2025-04-24T20:03:42.000Z","dependencies_parsed_at":"2025-06-08T13:14:59.314Z","dependency_job_id":null,"html_url":"https://github.com/Vincent-Devine/OMLogger","commit_stats":null,"previous_names":["vincent-devine/omlogger"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Vincent-Devine/OMLogger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vincent-Devine%2FOMLogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vincent-Devine%2FOMLogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vincent-Devine%2FOMLogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vincent-Devine%2FOMLogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vincent-Devine","download_url":"https://codeload.github.com/Vincent-Devine/OMLogger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vincent-Devine%2FOMLogger/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267842988,"owners_count":24153134,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"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":["cpp20","library","logger","windows"],"created_at":"2025-01-06T08:21:37.851Z","updated_at":"2026-04-13T21:32:14.128Z","avatar_url":"https://github.com/Vincent-Devine.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OMLogger\n\n![Header-Only](https://img.shields.io/badge/header--only-blue)\n![Version](https://img.shields.io/badge/version-2.1.0-blue)\n![C++20](https://img.shields.io/badge/C%2B%2B-20-orange)\n![Windows](https://img.shields.io/badge/platform-Windows-lightgrey)\n![License: MIT](https://img.shields.io/badge/license-MIT-green)\n\n**OMLogger** (One More Logger) is a single-header **logging library** for C++20, designed for clarity, flexibility, and ease of use.  \nIt supports **console and file outputs**, **verbosity filtering**, **color-coded messages**, **tag-based categorization**, and more — all with zero dependencies.\n\n![png](./Screenshot/Exemple.png)\n\n## Table of Contents\n- [Features](#features)\n- [Add to your project](#add-to-your-project)\n- [Usage](#usage)\n  - [Basic logging](#basic-logging)\n  - [Verbosity levels](#verbosity-levels)\n  - [Tags](#tags)\n  - [Display Settings](#display-settings)\n  - [File output](#file-output)\n  - [Custom data](#custom-data)\n  - [Assertion](#assertion)\n- [Requirements](#requirements)\n- [Credit](#credit)\n\n## Features\n- Console output with **colored logs**\n- Optional **file output**\n- Configurable **verbosity levels**\n- **Tag system** for filtering and categorizing logs\n- **Assertion** macro with custom error messages\n- Lightweight and **header-only**\n\n## Add to your project  \nAdd the [`OMLogger/Logger.hpp`](./OMLogger/Logger.hpp) file to your project and include it where needed.  \n```cpp\n#include \"OMLogger/Logger.hpp\"\n```   \nThere are no external dependencies.\n\n## Usage\n\n### Basic logging\nUse the macros to log your messages:\n```cpp\nint main()\n{\n\tOM_LOG_DEBUG(\"your text here\");\n\tOM_LOG_INFO(\"your text here\");\n\tOM_LOG_WARNING(\"your text here\");\n\tOM_LOG_ERROR(\"your text here\");\n\tOM_LOG_CRITICAL(\"your text here\");\n\n\tOM::Logger::Logger::GetInstance()-\u003eDestroy(); // Important!\n}\n```\n\n### Verbosity Levels\nUse the `SetVerbosity()` method to filter log messages:\n```cpp\nint main()\n{\n\tOM::Logger::Logger::GetInstance()-\u003eSetVerbosity(OM::Logger::VerbosityDebug | OM::Logger::VerbosityInfo);\n\tOM_LOG_DEBUG(\"Only debug and info verbosity\");\t\t// Displayed\n\tOM_LOG_INFO(\"Only debug and info verbosity\");\t\t// Displayed \n\tOM_LOG_WARNING(\"Only debug and info verbosity\");\t// Not displayed\n\tOM_LOG_ERROR(\"Only debug and info verbosity\");\t\t// Not displayed\n\tOM_LOG_CRITICAL(\"Only debug and info verbosity\");\t// Not displayed\n}\n```\n\n### Tags\n**Tags**: Engine, Core, Render, Input, Physics, Audio, Animation, UI, AI, Resource, Scripting, Tools, Scene\u003cbr\u003e \nUse the macros to log and tag your messages:\n```cpp\nint main()\n{\n\tOM_LOG_INFO_TAG(\"your text here\", OM::Logger::TagCore);\n}\n```\n\n### Display Settings\n**Settings**: Date, Time, Thread, FileInfo, Verbosity, Tag \u003cbr\u003e\nUse the `SetDisplaySettings()` method to configure what log information is shown:\n```cpp\nint main()\n{\n\tOM::Logger::Logger::GetInstance()-\u003eSetDisplaySettings(OM::Logger::DisplayTime);\n\tOM_LOG_INFO(\"Displays only date + message\");\n\n\tOM::Logger::Logger::GetInstance()-\u003eSetDisplaySettings(OM::Logger::DisplayDate | OM::Logger::DisplayTime | OM::Logger::DisplayFileInfo);\n\tOM_LOG_INFO(\"Displays date + time + file info + message\");\n}\n```\n\nResult:  \n![png](./Screenshot/DisplaySettings.png)\n\n### File Output\nUse the `OpenLogFile()` and `CloseLogFile()` methods to enable or disable file output:\n```cpp\nint main()\n{\n\t// Beginning of the project\n\tOM::Logger::Logger* logger = OM::Logger::Logger::GetInstance();\n\tlogger-\u003eOpenLogFile(\"log.txt\");\n\n\tOM_LOG_DEBUG(\"Message written to console and log file\");\n\n\t// End of the project\n\tlogger-\u003eCloseLogFile();\n}\n```\nBy default, writing to the file will overwrite the existing contents of the log file. You can pass an additional parameter when calling the function to keep the existing entries instead of deleting them.\n```cpp\nlogger-\u003eOpenLogFile(\"log.txt\", false);\n```\n\n### Custom Data\nTo manually specify the file, function, and line, consider using helper functions. Make sure that the log entry corresponds to the function calling the helper, not the helper itself.\n```cpp\nvoid Helper(std::string message, const char* file, int line, const char* function)\n{\n\tOM_LOG_INFO_CUSTOM_DATA(message, OM::Logger::TagNone, file, line, function);\n}\n#define CUSTOM_LOG(message) Helper(message, __FILE__, __LINE__, __func__)\n\nint main()\n{\n\t// file, line and func are on the main and not on the Helper() function\n\tCUSTOM_LOG(\"Custom log\");\n}\n```\n\n### Assertion\nUse the `OM_ASSERTION` macro to assert your code:\n```cpp\nint main()\n{\n\t// If _DEBUG is defined: logs a critical message + triggers a breakpoint\n\t// Else: logs a critical message + aborts\n\n\tOM_ASSERTION(1 + 1 == 2, \"your text here\"); // Passes\n\tOM_ASSERTION(1 + 1 == 3, \"your text here\"); // Fails\n}\n```\nAssertions support **tags** `OM_ASSERTION_TAG` and **custom data** `OM_ASSERTION_CUSTOM_DATA`, allowing you to categorize failures and specify the file, line, and function manually when needed.\n\n## Requirements\n- **C++20**\n- Windows OS *(for console color support via WinAPI)*\n\n## Credit\nMade by: [Vincent DEVINE](https://github.com/Vincent-Devine)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvincent-devine%2Fomlogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvincent-devine%2Fomlogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvincent-devine%2Fomlogger/lists"}