{"id":22701910,"url":"https://github.com/saphereye/herr-log","last_synced_at":"2025-07-25T09:33:50.465Z","repository":{"id":214759916,"uuid":"737262663","full_name":"Saphereye/herr-log","owner":"Saphereye","description":"Simple header logging library","archived":false,"fork":false,"pushed_at":"2024-01-02T13:03:19.000Z","size":225,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-04T20:17:48.610Z","etag":null,"topics":["cpp17","logging-library"],"latest_commit_sha":null,"homepage":"https://saphereye.github.io/herr-log/","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/Saphereye.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}},"created_at":"2023-12-30T11:47:56.000Z","updated_at":"2023-12-30T17:41:53.000Z","dependencies_parsed_at":"2024-01-02T14:24:59.241Z","dependency_job_id":null,"html_url":"https://github.com/Saphereye/herr-log","commit_stats":null,"previous_names":["saphereye/herr-log"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saphereye%2Fherr-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saphereye%2Fherr-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saphereye%2Fherr-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saphereye%2Fherr-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Saphereye","download_url":"https://codeload.github.com/Saphereye/herr-log/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246232776,"owners_count":20744711,"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":["cpp17","logging-library"],"created_at":"2024-12-10T07:11:03.255Z","updated_at":"2025-03-29T19:25:56.946Z","avatar_url":"https://github.com/Saphereye.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Herr Log\nA single header lightweight logging library.\n\n## Download\nSimply download the project and import `herrlog.hh`. Or run the below given curl command in your directory.\n```bash\ncurl -o herrlog.hh -L https://raw.githubusercontent.com/Saphereye/herr-log/main/herrlog.hh\n```\n\n## Usage\nHerr Log supports the following log levels.\n| Log Level | Use Case |\n| --------- | -------- |\n| Trace     | Capture fine-grained details and trace specific actions, offering insights into the program's behavior (e.g., variable values, function calls). |\n| Info      | Report significant events, milestones, or key actions in the program's execution (e.g., program start, major processes). |\n| Debug     | Intended for temporary and detailed reporting during development or debugging phases to comprehend and analyze specific parts of the code. Use sparingly in production. |\n| Warn | Report errors or potential areas where errors have not been handled gracefully. Does not terminate the program. |\n| Error     | Report critical errors requiring immediate attention. Results in program termination. |\n| Fatal | Report critical errors, terminate the program, and generate a crash dump (abort). |\n\nAll these can be activated/deactivated independently by setting the style using `Logger::set_type`.\n\n### Basic usage\n```cpp\n#include \"herrlog.hh\"\n\nint main() {\n    Logger::trace(\"This is trace message number 1\"); // Initialization is not required\n}\n```\nBy default, the style is `LogStyle::All`, i.e. all log types are enabled. The output is directed to the console using anse colors and the datetime format is \"%Y-%m-%d %H:%M:%S\".\n\n### Custom output stream (e.g. logfiles)\nIn place of log_file, any other stream can also be put.\n\n```cpp\n#include \"herrlog.hh\"\n\nint main() {\n    Logger::set_output_file_name(\"test.log\"); // The output will be redirected to \"test.log\"\n    Logger::trace(\"This is trace message number 1\");\n}\n```\n\n### Custom output message types\nFor example, if only error and info messages are needed.\n\n```cpp\n#include \"herrlog.hh\"\n\nint main() {\n    Logger::set_output_file_name(\"test.log\");\n    Logger::set_type(LogType::Error | LogType::Debug); // Only Error and Debug logs will be shown\n    Logger::error(\"Erroneous error\"); // This will be printed\n    Logger::trace(\"Tracing something\"); // This wouldn't be printed\n}\n```\n\n### Inbuilt formatting\n```cpp\n#include \"herrlog.hh\"\n\nint main() {\n    Logger::trace(\"This is {} message number {}\", \"trace\", 1); // Will be printed as \"[TRACE 2023-12-31 12:41:09] This is trace message number 1\"\n}\n```\n\n### Custom datetime format\nThe default datetime format is `%Y-%m-%d %H:%M:%S`. These variables can then be used to specify a custom date time format.\n```cpp\n#include \"herrlog.hh\"\n\nint main() {\n    Logger::set_datetime_format(\"%H:%M:%S\");\n    Logger::trace(\"Hello World\"); // Will be printed as \"[TRACE 12:35:24] Hello World\"\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaphereye%2Fherr-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaphereye%2Fherr-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaphereye%2Fherr-log/lists"}