{"id":22614360,"url":"https://github.com/cwahn/efp-logger","last_synced_at":"2026-03-19T23:14:38.873Z","repository":{"id":209322062,"uuid":"723745086","full_name":"cwahn/efp-logger","owner":"cwahn","description":"High performance logging system for real-time application","archived":false,"fork":false,"pushed_at":"2024-11-24T02:45:24.000Z","size":82,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-03T10:33:39.045Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CMake","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/cwahn.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":"2023-11-26T16:31:09.000Z","updated_at":"2024-03-08T16:24:34.000Z","dependencies_parsed_at":"2023-12-11T12:56:35.416Z","dependency_job_id":"d9388010-d2bd-4640-8888-8288fe2bc080","html_url":"https://github.com/cwahn/efp-logger","commit_stats":null,"previous_names":["cwahn/efp-rt-log","cwahn/efp-logger"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwahn%2Fefp-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwahn%2Fefp-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwahn%2Fefp-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwahn%2Fefp-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cwahn","download_url":"https://codeload.github.com/cwahn/efp-logger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246119414,"owners_count":20726372,"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":"2024-12-08T18:09:30.766Z","updated_at":"2026-01-08T02:04:02.333Z","avatar_url":"https://github.com/cwahn.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EFP Logger\n\n## Overview\n\nEFP Logger is a C++ logging library designed for real-time concurrency application. The typical log-writing takes only \"tens of nano seconds\". \n\n## Exmaple\n\n```c++\nint main()\n{\n    using namespace efp;\n\n    // Optional log level setting. Default is LogLevel::Info\n    Logger::set_log_level(LogLevel::Trace);\n\n    // Optional log output setting. // default is stdout\n    Logger::set_output(\"./efp_logger_test.log\");\n    // Logger::set_output(stdout);\n\n    // Use the logging functions\n    trace(\"This is a trace message with no formating\");\n    debug(\"This is a debug message with a pointer: {:p}\", (void *)nullptr);\n    info(\"This is a info message with a float: {}\", 3.14f);\n    warn(\"This is a warn message with a int: {}\", 42);\n    error(\"This is a error message with a string literal: {}\", \"error\");\n    // ! Sending std::string to the buffer is O(n) and may increase risk of buffer overflow\n    // ! Every 20 ~ 30 char will take one buffer space.\n    fatal(\"This is a fatal message with a std::string: {}\", std::string(\"fatal error\"));\n\n    // Since the logging is done in a separate thread, wait for a while to see the logs\n    std::this_thread::sleep_for(std::chrono::milliseconds(10));\n\n    return 0;\n}\n```\n\n```log\n2023-12-02 03:25:28 TRACE This is a trace message with no formating\n2023-12-02 03:25:28 DEBUG This is a debug message with a pointer: 0x0\n2023-12-02 03:25:28 INFO  This is a info message with a float: 3.14\n2023-12-02 03:25:28 WARN  This is a warn message with a int: 42\n2023-12-02 03:25:28 ERROR This is a error message with a string literal: error\n2023-12-02 03:25:28 FATAL This is a fatal message with a std::string: fatal error\n```\n\n## Features\n\nIn order to implement such functionality a few techniques are combined.\n\n- **Asynchronous Processing**: Festival the lock is processed by separate external thread. Regardless of the destination of log, overhead of making side effect is not acceptable. By utilizing `efp::Enum` type, parsing, and printing will be handled by external thread.\n\n- **Zero Allocation Logging**: Allocation often cause unbounded amount of overhead, which is not acceptable for real time application. EFP RtLog utilize zero allocation ring, buffer, which guarantees uniform operation. The small cost is doubled memory and dual copy.\n\n- **Double Buffering with Spinlock**: Synchronization Should be also minimized in real time application. EFP RtLog Implement double buffering, Which will make logging sync free and non-blocking. Upper bound of blocking time would be approximately the same with a single pointer swap.\n\n- **Formatting**: By utilizing the excellent `fmt` internally, `efp::RtLog`  buffers virtually the same core API with `fmt::format` and `fmt::print`.\n\n\n## Performance\n\nEFP RT Log's design is benchmarked to handle high-throughput scenarios, ensuring efficient logging even under heavy load.\n\n```plaintext\nLogged 1000000 messages in 0.0203815 seconds.\nAverage time per message: 2.03815e-08 seconds.\nMessages per second: 4.90641e+07\n```\n\n## Todo\n- Pointer type auto conversion to void *\n\n## Integration\n\nTo use EFP RT Log, include `logger.hpp` in your project and ensure dependencies, especially the `fmt` library, are correctly linked.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcwahn%2Fefp-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcwahn%2Fefp-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcwahn%2Fefp-logger/lists"}