{"id":19715690,"url":"https://github.com/mickaelblet/loggator","last_synced_at":"2026-06-08T01:32:15.643Z","repository":{"id":101617872,"uuid":"129638205","full_name":"MickaelBlet/Loggator","owner":"MickaelBlet","description":"Logger for c++11","archived":false,"fork":false,"pushed_at":"2019-04-05T20:01:02.000Z","size":2901,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-27T21:52:21.597Z","etag":null,"topics":["cpp","header-only","log","threadsafe"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MickaelBlet.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":"2018-04-15T18:21:46.000Z","updated_at":"2019-04-05T20:01:03.000Z","dependencies_parsed_at":"2023-06-06T15:00:19.708Z","dependency_job_id":null,"html_url":"https://github.com/MickaelBlet/Loggator","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/MickaelBlet/Loggator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MickaelBlet%2FLoggator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MickaelBlet%2FLoggator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MickaelBlet%2FLoggator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MickaelBlet%2FLoggator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MickaelBlet","download_url":"https://codeload.github.com/MickaelBlet/Loggator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MickaelBlet%2FLoggator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34044919,"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-07T02:00:07.652Z","response_time":124,"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","header-only","log","threadsafe"],"created_at":"2024-11-11T22:39:08.048Z","updated_at":"2026-06-08T01:32:15.638Z","avatar_url":"https://github.com/MickaelBlet.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/MickaelBlet/Loggator.svg?branch=master)](https://travis-ci.org/MickaelBlet/Loggator) ![GitHub release](https://img.shields.io/github/release/MickaelBlet/Loggator.svg) ![GitHub](https://img.shields.io/github/license/MickaelBlet/Loggator.svg)\n# Loggator \n\n**Logger** for **C++11**.\n\n## Example\n\n```cpp\n#include \"loggator.hpp\"\n\nusing namespace Log;\n\nvoid test()\n{\n    LOGGATOR(\"example\") \u003c\u003c \"macro LOGGATOR\";\n    LOGGATOR(\"example\").setName(\"main\");\n}\n\nint main()\n{\n    Loggator logExample(\"example\", std::cout);\n    logExample.setFormat(\"{TYPE:%-5s} {TIME:%y/%m/%d %X.%N}: {NAME:%s: }{FILE:%s:}{LINE:%s: }\");\n    logExample.debug() \u003c\u003c \"function\";\n    logExample.debug(LOGGATOR_SOURCEINFOS) \u003c\u003c \"source infos macro\";\n    test();\n    LOGGATOR(\"main\", WARN) \u003c\u003c \"macro LOGGATOR with type\" \u003c\u003c std::endl;\n    LOGGATOR(logExample, INFO, \"style %s \", \"printf\") \u003c\u003c \"LOGGATOR\";\n    return (0);\n}\n\n// output:\n// DEBUG 70/01/01 01:23:45.678910: example: function\n// DEBUG 70/01/01 01:23:45.678910: example: main.cpp:16: source infos macro\n// DEBUG 70/01/01 01:23:45.678910: example: macro LOGGATOR\n// DEBUG 70/01/01 01:23:45.678910: main: main.cpp:18: macro LOGGATOR with type\n// INFO  70/01/01 01:23:45.678910: main: main.cpp:19: style printf LOGGATOR\n```\n\n## Log Types\n\n|Log Types            |methodes             |\n|:-------------------:|:-------------------:|\n|**DEBUG**            |debug()              |\n|**INFO**             |info()               |\n|**WARN / WARNING**   |warn() / warning()   |\n|**ERROR**            |error()              |\n|**CRIT / CRITICAL**  |crit() / critical()  |\n|**ALERT**            |alert()              |\n|**EMERG / EMERGENCY**|emerg() / emergency()|\n|**FATAL**            |fatal()              |\n\n## Custom Format\n\n|Key          |Description            |Exemple          |Output|\n|-------------|-----------------------|:---------------:|------|\n|**TIME**     |Time from **strftime** |`{TIME:%x %X.%N}`|`01/01/70 01:23:45.678910`|\n|**TYPE**     |Type of log            |`{TYPE}`         |`DEBUG`/`INFO`/`WARN`/`ERROR`/ `CRIT`/`ALERT`/`FATAL`/`EMERG`|\n|**NAME**     |Name of loggator       |`{NAME}`         |`loggator`|\n|**FUNC**     |Name of scope function |`{FUNC}`         |`main`|\n|**PATH**     |Path of source file    |`{PATH}`         |`src/main.cpp`|\n|**FILE**     |Filename of source file|`{FILE}`         |`main.cpp`|\n|**LINE**     |Line at source file    |`{LINE}`         |`42`|\n|**THREAD_ID**|Thread id              |`{THREAD_ID}`    |`7F4768D40700`|\n\n## Filter\n\nUse bit composition:\n```cpp\nLoggator logExample();\nlogExample.setFilter(eFilterLog::EQUAL_DEBUG | eFilterLog::EQUAL_WARN | eFilterLog::EQUAL_FATAL);\nLOGGATOR(logExample, DEBUG) \u003c\u003c \"example Debug\"; // OK\nLOGGATOR(logExample, INFO)  \u003c\u003c \"example Info\";  //    KO\nLOGGATOR(logExample, WARN)  \u003c\u003c \"example Warn\";  // OK\nLOGGATOR(logExample, DEBUG) \u003c\u003c \"example Error\"; //    KO\nLOGGATOR(logExample, CRIT)  \u003c\u003c \"example Crit\";  //    KO\nLOGGATOR(logExample, ALERT) \u003c\u003c \"example Alert\"; //    KO\nLOGGATOR(logExample, EMERG) \u003c\u003c \"example Emerg\"; //    KO\nLOGGATOR(logExample, FATAL) \u003c\u003c \"example Fatal\"; // OK\n```\n\n## Configuration FILE\n\nloggator.ini\n```ini\n# comment\n[Loggator:debug]\nFilter  = \"EQUAL_DEBUG\"\nFormat  = \"{TIME:%y/%m/%d %X.%N: }\"\nFile    = \"debug.log\"\nOpenMode= TRUNCATE\nChild   = \"test\" # call loggator \"test\" when \"debug\" is call\nListen  = \"test\" # call loggator \"debug\" when \"test\" is call\n\n[Loggator:test]\nFilter  = INFO, DEBUG, WARN ; separator |,+\nFile    = \"test.log\"\nOpenMode= \"TRUNC\"\n\n[loggator:default]\nName    = \"main\" ; change name \"default\" to \"main\"\nChild   = \"test,debug\" ; separator |,+\nMute    = true\n```\nmain.cpp\n```cpp\n#include \"loggator.hpp\"\n\nusing namespace Log;\n\nint main()\n{\n    if (Loggator::openConfig(\"loggator.ini\") == false)\n    {\n        std::cerr \u003c\u003c \"Open LOGGATOR config Fail\" \u003c\u003c std::endl;\n        return (1);\n    }\n    Loggator \u0026mainLog = LOGGATOR(\"main\");\n    LOGGATOR(mainLog, DEBUG) \u003c\u003c \"(main)  =\u003e test =\u003e debug\"; // main is mute\n    LOGGATOR(\"test\",  DEBUG) \u003c\u003c \"test    =\u003e debug\";\n    LOGGATOR(\"debug\", DEBUG) \u003c\u003c \"debug   =\u003e test\";\n    LOGGATOR(\"main\",  INFO)  \u003c\u003c \"(main)  =\u003e test =\u003e (debug)\"; // debug has not good filter\n    LOGGATOR(\"test\",  INFO)  \u003c\u003c \"test    =\u003e (debug)\";\n    LOGGATOR(\"debug\", INFO)  \u003c\u003c \"(debug) =\u003e test\";\n    return (0);\n}\n\n// debug.log:\n// 70/01/01 01:23:45.678910: (main)  =\u003e test =\u003e debug\"\n// 70/01/01 01:23:45.678910: test    =\u003e debug\n// 70/01/01 01:23:45.678910: debug   =\u003e test\n\n// test.log:\n// 70/01/01 01:23:45.678910 [DEBUG] main.cpp:13:main: main: (main)  =\u003e test =\u003e debug\n// 70/01/01 01:23:45.678910 [DEBUG] main.cpp:14:main: test: test    =\u003e debug\n// 70/01/01 01:23:45.678910 [DEBUG] main.cpp:15:main: debug: debug   =\u003e test\n// 70/01/01 01:23:45.678910 [INFO ] main.cpp:16:main: main: (main)  =\u003e test =\u003e (debug)\n// 70/01/01 01:23:45.678910 [INFO ] main.cpp:17:main: test: test    =\u003e (debug)\n// 70/01/01 01:23:45.678910 [INFO ] main.cpp:18:main: debug: (debug) =\u003e test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmickaelblet%2Floggator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmickaelblet%2Floggator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmickaelblet%2Floggator/lists"}