{"id":16690718,"url":"https://github.com/nixman/nanolog","last_synced_at":"2025-08-02T01:34:29.106Z","repository":{"id":146230385,"uuid":"66250159","full_name":"niXman/nanolog","owner":"niXman","description":"C++20 Nano logging library with std::format","archived":false,"fork":false,"pushed_at":"2024-03-18T12:26:31.000Z","size":32,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T00:51:17.364Z","etag":null,"topics":["cplusplus","logger","logging"],"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/niXman.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}},"created_at":"2016-08-22T07:37:53.000Z","updated_at":"2025-03-16T14:11:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"6d954e2c-985d-4bc2-be3b-51201dfcc199","html_url":"https://github.com/niXman/nanolog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/niXman/nanolog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niXman%2Fnanolog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niXman%2Fnanolog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niXman%2Fnanolog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niXman%2Fnanolog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niXman","download_url":"https://codeload.github.com/niXman/nanolog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niXman%2Fnanolog/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268326278,"owners_count":24232464,"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-08-01T02:00:08.611Z","response_time":67,"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":["cplusplus","logger","logging"],"created_at":"2024-10-12T16:05:04.292Z","updated_at":"2025-08-02T01:34:29.071Z","avatar_url":"https://github.com/niXman.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NanoLog\nC++20 Nano logging library which uses `std::format`\n\n# NanoLog is not the fastest nor the most convenient\n\n# Examples\n\n```cpp\n    // print some message with different error level\n    NNL_LOGI(std::cout, \"message with one arg: \\\"{}\\\"\\n\", \"arg0\");\n    NNL_LOGD(std::cout, \"message with one arg: \\\"{}\\\"\\n\", \"arg0\");\n    NNL_LOGW(std::cout, \"message with one arg: \\\"{}\\\"\\n\", \"arg0\");\n    NNL_LOGE(std::cout, \"message with one arg: \\\"{}\\\"\\n\", \"arg0\");\n    // the fully qualified macros can also be used:\n    // NNL_LOG_INFO, NNL_LOG_DEBUG, NNL_LOG_WARNING, NNL_LOG_ERROR\n\n    // conditional print some message with different error level\n    NNL_LOGI_IF(true, std::cout, \"message with one arg: \\\"{}\\\"\\n\", \"arg0\");\n    NNL_LOGD_IF(true, std::cout, \"message with one arg: \\\"{}\\\"\\n\", \"arg0\");\n    NNL_LOGW_IF(true, std::cout, \"message with one arg: \\\"{}\\\"\\n\", \"arg0\");\n    NNL_LOGE_IF(true, std::cout, \"message with one arg: \\\"{}\\\"\\n\", \"arg0\");\n    // the fully qualified macros can also be used:\n    // NNL_LOG_INFO_IF, NNL_LOG_DEBUG_IF, NNL_LOG_WARNING_IF, NNL_LOG_ERROR_IF\n\n    // try-catch wrapper with logging\n    std::string str;\n    NNL_TRY_CATCH(std::cout, str = \"some string\";);\n\n    // try-catch-rethrow wrapper with logging\n    std::string str2;\n    NNL_TRY_CATCH_RETHROW(std::cout, str2 = \"another string\";);\n\n    // try-catch-abort wrapper with logging\n    std::string str3;\n    NNL_TRY_CATCH_ABORT(std::cout, str3 = \"different string\";);\n\n    // FILE-IO for logging\n    // open log-file (always in append mode if they exists)\n    NNL_CREATE_LOG_STREAM(\n         logfile // var name\n        ,\"logfile.log\" // file name\n    );\n    // logging to file\n    NNL_LOGI(logfile, \"message with one arg: \\\"{}\\\"\\n\", \"arg0\");\n    // close log-file\n    NNL_CLOSE_LOG_STREAM(logfile);\n```\n# Output example\n```\n/home/nixman/projects/nanolog/test.cpp(  49)[2023.02.12-12:04:51.240][I]: message with one arg: \"arg0\"\n/home/nixman/projects/nanolog/test.cpp(  50)[2023.02.12-12:04:51.240][D]: message with one arg: \"arg0\"\n/home/nixman/projects/nanolog/test.cpp(  51)[2023.02.12-12:04:51.240][W]: message with one arg: \"arg0\"\n/home/nixman/projects/nanolog/test.cpp(  52)[2023.02.12-12:04:51.240][E]: message with one arg: \"arg0\"\n```\n\n# Useful macro\n - `NNL_USE_STDIO` - to work with FILE streams like `stdout`/`stderr`.\n - `NNL_DONT_SHOW_DATETIME` - omit date-time in messages.\n - `NNL_CONSIDER_TIMEZONE` - take into account the time-zone instead of using UTC+0.\n - `NNL_SHORT_FILEPATH` - show file-name only instead of full file-path.\n - `NNL_FLUSH_EACH_RECORD` - forcibly flush each message to used IO-stream.\n - `NNL_DISABLE_LOG_INFO` - disable any `INFO`-level logging without any code changes.\n - `NNL_DISABLE_LOG_DEBUG` - disable any `DEBUG`-level logging without any code changes.\n - `NNL_DISABLE_LOG_WARNING` - disable any `WARNING`-level logging without any code changes.\n - `NNL_DISABLE_LOG_ERROR` - disable any `ERROR`-level logging without any code changes.\n - `NNL_DISABLE_LOGGING` - disable any logging functionality without any code changes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnixman%2Fnanolog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnixman%2Fnanolog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnixman%2Fnanolog/lists"}