{"id":38967518,"url":"https://github.com/efmsoft/logme","last_synced_at":"2026-01-17T16:32:26.881Z","repository":{"id":50728908,"uuid":"393603194","full_name":"efmsoft/logme","owner":"efmsoft","description":"Runtime-controlled logging for C/C++ applications. Selectively enable, route, and limit logs at runtime — without restarting","archived":false,"fork":false,"pushed_at":"2026-01-12T13:38:28.000Z","size":1704,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-12T13:51:28.897Z","etag":null,"topics":["c-plus-plus","console","cpp","cross-platform","file","file-log","linux","logger","logging","logging-library","macos","windows"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/efmsoft.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-08-07T06:43:06.000Z","updated_at":"2026-01-12T13:43:52.000Z","dependencies_parsed_at":"2024-07-13T09:31:40.768Z","dependency_job_id":"210f45b3-0ec6-44b4-b1d1-a2d4c621dd78","html_url":"https://github.com/efmsoft/logme","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/efmsoft/logme","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efmsoft%2Flogme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efmsoft%2Flogme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efmsoft%2Flogme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efmsoft%2Flogme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/efmsoft","download_url":"https://codeload.github.com/efmsoft/logme/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efmsoft%2Flogme/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28511868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["c-plus-plus","console","cpp","cross-platform","file","file-log","linux","logger","logging","logging-library","macos","windows"],"created_at":"2026-01-17T16:32:26.438Z","updated_at":"2026-01-17T16:32:26.854Z","avatar_url":"https://github.com/efmsoft.png","language":"C++","readme":"# logme\n\n![Colored console output example](docs/assets/example.png)\n\n**logme** is a cross-platform C/C++ logging framework that allows applications to dynamically control what is logged and where, without restarting or recompiling.\n\nIt is designed for both high-load servers and simple applications, providing selective, on-demand logging with minimal overhead and full runtime control.\n\n- 📚 **Documentation (Wiki):** https://github.com/efmsoft/logme/wiki\n- 💬 **Support / feedback:** [GitHub issues](https://github.com/efmsoft/logme/issues) and [discussions](https://github.com/efmsoft/logme/discussions) are welcome.\n\n---\n\n## Key features\n\n- **Runtime control** via a built-in control server: enable, disable, and reconfigure logging dynamically without restarting or recompiling the application.\n- **Channels and subsystems**: logically separate log output by component, module, or functional area.\n- **Hierarchical channels**: build structured logging trees and control groups of components together.\n- **Flexible verbosity control**: fine-grained filtering using log levels (Debug / Info / Warn / Error), subsystems, and channel hierarchy.\n- **Multiple backends per channel**: console, debugger, files, and other output destinations.\n- **Channel links**: redirect or fan-out log messages between channels without duplicating backend configuration.\n- **Retention rules**: limit the size of individual log files and the total disk usage across all logs.\n- **Log file obfuscation**: optional obfuscation of log data written to files.\n- **Multiple APIs**: C-style macros, C++ stream-style logging, and optional `std::format`-based formatting.\n- **Cross-platform**: Windows, Linux and macOS support.\n\n---\n\n## Quick start\n\n### Minimal usage (out of the box)\n\nThe simplest possible usage. This works **out of the box** and requires no configuration.\n\n```cpp\n#include \u003cLogme/Logme.h\u003e\n\nint main()\n{\n  LogmeI(\"Hello from logme (%s style)\", \"C\");\n  LogmeW() \u003c\u003c \"Hello from logme (C++ stream style)\";\n\n#ifndef LOGME_DISABLE_STD_FORMAT\n  fLogmeE(\"Hello from logme ({} style)\", \"std::format\");\n#endif\n\n  return 0;\n}\n```\n\nThis produces colored console output similar to the following:\n\n![Output result](docs/assets/base.png)\n\n---\n\n## Configuration files (recommended)\n\nFor most applications, logme is configured via a JSON configuration file, which can describe the following elements:\n\n- channels\n- backends\n- links\n- levels\n- flags\n- subsystems\n\nThis lets you adjust logging behavior at runtime or between runs without recompiling.\n\nFor details and examples, see the project Wiki.\n\n---\n\n### Programmatic configuration (advanced)\n\nAll aspects of logme behavior can be configured directly from C++ application code. This approach is useful for small tools, embedded scenarios, or when configuration files are not desired.\n```cpp\n#include \u003cLogme/Logme.h\u003e\n#include \u003cLogme/Backend/ConsoleBackend.h\u003e\n\n#include \u003cmemory\u003e\n\nint main()\n{\n  auto ch = Logme::Instance-\u003eCreateChannel(\"http\");\n  ch-\u003eAddBackend(std::make_shared\u003cLogme::ConsoleBackend\u003e(ch));\n\n  fLogmeI(ch, \"GET {} -\u003e {}\", \"/index.html\", 200);\n  return 0;\n}\n```\n\n---\n\n## Runtime control (built-in control server)\n\nApplications using **logme** can optionally enable a **built-in control server** that allows logging behavior to be **fully managed at runtime**.\n\nThe control server exposes a management interface for:\n\n- creating and removing channels,\n- attaching or detaching backends,\n- enabling, disabling, or blocking channels,\n- controlling subsystems, levels, and routing.\n\nA command-line utility is provided with the library to send control commands to a running process, but the **specific tool is not important** — the key point is that logging can be **reconfigured dynamically while the application is running**.\n\n### Why this matters\n\nA common use case is a modular application where each component writes to its own channel.\n\nAt startup:\n- channels may **not exist at all**,\n- messages sent to non-existent or inactive channels are **silently dropped**,\n- no log files are created,\n- no console output is produced.\n\nWhen diagnostics are required:\n- a channel can be **created remotely**,\n- backends can be attached (file, console, debugger),\n- messages from the selected component immediately start appearing.\n\nLater:\n- the channel can be removed,\n- blocked,\n- or detached from all backends,\n- instantly stopping further output.\n\n### Result\n\nThis model allows **selective, on-demand logging**:\n\n- only for specific components,\n- only when needed,\n- only to selected destinations.\n\nIt keeps production systems quiet by default while still allowing **deep, targeted diagnostics** without restarting the application or recompiling it.\n\n---\n\n## Concepts\n\n### Channel\n\nA **channel** is where you write messages. A channel can have:\n\n- one or more **backends** (output destinations),\n- optional **links** to other channels (redirect / fan-out).\n\n### Backend\n\nA **backend** defines where messages go (console, debugger, file, etc.).\nMultiple backends can be attached to the same channel.\n\n### Subsystem\n\nA **subsystem** is an optional identifier that provides an additional level of classification inside a channel.\nSubsystems allow grouping and filtering messages within the same channel, making it possible to enable or disable logging for specific functional parts of a component without affecting the entire channel.\n\n### Link (redirect)\n\nA **link** forwards messages from one channel to another after local backends are processed.\nThis is useful for building routing trees (e.g., `http` → `root`).\n\n---\n\n## Installation\n\n### Option A: CMake FetchContent\n\n```cmake\ninclude(FetchContent)\n\nFetchContent_Declare(\n  logme\n  GIT_REPOSITORY https://github.com/efmsoft/logme.git\n  GIT_TAG        main  # Prefer a release tag when available\n)\n\nFetchContent_MakeAvailable(logme)\n\ntarget_link_libraries(your_target PRIVATE logme)\n```\n\n### Option B: Add as a subdirectory\n\n```cmake\nadd_subdirectory(external/logme)\n\ntarget_link_libraries(your_target PRIVATE logme)\n```\nAn example of integrating logme as a git submodule can be found here: https://github.com/efmsoft/logme_cmake_submodule_example\n\n---\n\n## Build\n\n### Configure and build\n\n```bash\ncmake -S . -B build\ncmake --build build\n```\n\n### Tests\n\n```bash\ncmake -S . -B build -DLOGME_BUILD_TESTS=ON\ncmake --build build\nctest --test-dir build\n```\n\n---\n\n## CMake options\n\n- `LOGME_BUILD_EXAMPLES` (ON/OFF)\n- `LOGME_BUILD_TESTS` (ON/OFF)\n- `LOGME_BUILD_STATIC` (ON/OFF)\n- `LOGME_BUILD_DYNAMIC` (ON/OFF)\n- `LOGME_STD_FORMAT` (`AUTO`, `ON`, `OFF`)\n\n---\n\n## Requirements and compatibility\n\n### Language standard\n\n- C++20 is used.\n\n### `std::format` support\n\n`std::format` is optional. If your standard library does not provide `\u003cformat\u003e`, disable it via:\n\n- `-DLOGME_STD_FORMAT=OFF` (or define `LOGME_DISABLE_STD_FORMAT`)\n\n---\n\n## Roadmap\n\n- More backends and routing presets\n- Improved documentation and more integration examples\n\n---\n\n## Contributing\n\nContributions are welcome via issues and pull requests.\n\nPlease include:\n- OS and compiler version,\n- CMake options used,\n- minimal reproduction steps if applicable.\n\n---\n\n## License\n\nSee the `LICENSE` file.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefmsoft%2Flogme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fefmsoft%2Flogme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefmsoft%2Flogme/lists"}