{"id":28169271,"url":"https://github.com/iveevi/howler","last_synced_at":"2025-05-15T16:16:38.784Z","repository":{"id":274891125,"uuid":"924400051","full_name":"iveevi/howler","owner":"iveevi","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-09T01:23:42.000Z","size":68,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-09T02:34:03.779Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/iveevi.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-29T23:36:29.000Z","updated_at":"2025-05-09T01:23:45.000Z","dependencies_parsed_at":"2025-04-29T23:20:01.390Z","dependency_job_id":"6935cc8b-b6fa-4275-9fbc-0b2e561935ec","html_url":"https://github.com/iveevi/howler","commit_stats":null,"previous_names":["iveevi/howler"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iveevi%2Fhowler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iveevi%2Fhowler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iveevi%2Fhowler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iveevi%2Fhowler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iveevi","download_url":"https://codeload.github.com/iveevi/howler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254374543,"owners_count":22060614,"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":[],"created_at":"2025-05-15T16:16:18.529Z","updated_at":"2025-05-15T16:16:38.779Z","avatar_url":"https://github.com/iveevi.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\t\u003cimg src=\"media/logo.png\" width=\"256\"\u003e\n\u003c/p\u003e\n\n# Howler\n\n## Overview\n\nHowler is a lightweight logging system for C++20 that provides different levels of logging messages, including assertions, fatal errors, errors, warnings, and informational messages. It leverages `fmt` for formatted output and `std::source_location` for capturing source file details automatically.\n\n## Features\n\n- Provides formatted logging messages with optional timestamps.\n- Supports different levels of logging: assertion, fatal, error, warning, and info.\n- Captures source location (file, line, function) for assertions and fatal errors.\n- Uses `fmt` for efficient string formatting and colored terminal output.\n- `__builtin_trap()` is used for assertion failures and fatal errors to halt execution.\n\n## Building\n\nHowler relies on the `fmt` printing library to format and style terminal\nmessages. We recommend users to use Howler via CMake with the `add_subdirectory`\ncommand. See the example below, which also indicates configuration options for\nHowler.\n\n```cmake\n# Optional: set the project name for Howler to use\nadd_compile_definitions(HOWLER_PREFIX=\"myproject\")\n\n# Optional: tell Howler not to use its local fmt repository\nset(HOWLER_FMT_EXTERNAL TRUE)\n\n# Optional: include an independant repository of fmt\nadd_subdirectory(thirdparty/fmt)\n\n# REQUIRED: tell CMake to include Howler\nadd_subdirectory(thirdparty/howler)\n```\n\nFinally, simply include `howler.hpp` in your source file:\n\n```cpp\n#include \"howler.hpp\"\n\n// ...\n```\n\n## Usage\n\n### Initialization\n\nBefore logging, you can enable or disable timestamps:\n\n```cpp\nhowler::reset(true);  // Enable timestamps\n```\n\n### Logging Macros\n\n#### Assertions\n\n```cpp\nhowl_assert(condition, \"Message: {}\", value);\n```\n\nTriggers an assertion failure if `condition` is false and prints the message\nalong with the source file details.\n\n#### Fatal Errors\n\n```cpp\nhowl_fatal(\"Critical failure: {}\", error_code);\n```\n\nLogs a fatal error and terminates execution.\n\n#### Errors\n\n```cpp\nhowl_error(\"An error occurred: {}\", error_code);\n```\n\nLogs an error message without terminating execution.\n\n#### Warnings\n\n```cpp\nhowl_warning(\"Warning: {}\", warning_message);\n```\n\nLogs a warning message.\n\n#### Information\n\n```cpp\nhowl_info(\"Info: {}\", info_message);\n```\n\nLogs an informational message.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiveevi%2Fhowler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiveevi%2Fhowler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiveevi%2Fhowler/lists"}