You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Like cLog? Please consider [starring the repo](https://github.com/mbn-code/cLog) or sharing your feedback. It really helps!
13
+
> If you find cLog helpful, please consider [starring the repository](https://github.com/mbn-code/cLog) or sharing feedback. Community support helps drive improvement.
14
14
15
15
## Getting Started
16
16
@@ -34,17 +34,17 @@ int main() {
34
34
```
35
35
36
36
> [!IMPORTANT]
37
-
> Let the `Logger` object live until all events are logged. It flushes automatically when the object is destroyed (which happens when it goes out of scope).
37
+
> Allow the `Logger` object to remain in scope until all events are logged. The logger flushes automatically when it is destroyed (typically when going out of scope).
38
38
39
-
## Install
40
-
Just add`include/` to your project. No dependencies except C++17 STL and the bundled nlohmann/json.
39
+
## Installation
40
+
Add the`include/`directory to the project's include paths. The only requirements are a compiler supporting at least C++17 and the bundled nlohmann/json. No external dependencies are needed.
41
41
42
42
> [!CAUTION]
43
-
> If you're compiling on Windows, make sure your compiler supports at least C++17. See[CI status](https://github.com/mbn-code/cLog/actions) for tested environments.
43
+
> When compiling on Windows, ensure the compiler supports at least C++17. Consult[CI status](https://github.com/mbn-code/cLog/actions) for verified environments.
44
44
45
45
## Benchmarks
46
46
47
-
The following graph shows the average time (in microseconds) to log a single entry under different modes and sinks (lower is better):
47
+
The graph below presents the average time (in microseconds) to log a single entry under different modes and sinks (lower is better):
48
48
49
49
<palign="center">
50
50
<imgsrc="./benchmarks/benchmark.png"alt="cLog benchmarks bar graph"width="500">
@@ -64,32 +64,32 @@ Benchmarks were performed locally on an AMD Ryzen 9 9800X3D with 32GB DDR5-6000
<sub>Numbers from spdlog are for Ubuntu 64-bit, i7-4770 3.4GHz. For cLog, sync/async and file/console modes were tested with 100,000 logs per variant on a modern Linux system. “Logs/sec” is approximate, calculated as 1,000,000 / μs-per-log (higher is better).</sub>
67
+
<sub>Numbers for spdlog are for Ubuntu 64-bit, i7-4770 3.4GHz. cLog benchmarks were run with 100,000 logs per variant on a modern Linux system. 'Logs/sec' values are approximate, calculated as 1,000,000 / μs-per-log (higher is better).</sub>
68
68
69
-
**In context:**
70
-
- spdlog is widely recognized as one of the fastest C++ loggers, especially in minimal-formatting scenarios.
71
-
- cLog’s performance is within a small multiple of spdlog, making it *more than fast enough* for the vast majority of high-performance needs. For many applications, sub-2μs logging throughput is essentially “free.”
72
-
-Your code also provides richer structured logging and a modern, easy-to-use API.
69
+
**Performance Context:**
70
+
- spdlog is recognized for leading performance in minimal-formatting settings.
71
+
- cLog offers performance within a small multiple of spdlog. For most high-throughput applications, sub-2μs throughput is suitable for demanding scenarios.
72
+
-Structured logging and a modern, expressive API are provided out of the box.
73
73
74
74
---
75
75
76
76
---
77
77
78
78
## Features
79
-
-Async and sync modes (`Logger::Mode`)
79
+
-Asynchronous and synchronous operation modes (`Logger::Mode`)
80
80
- Safe, automatic background flushing and shutdown
81
-
- Console and file sinks out of the box
82
-
- Fully structured JSON logs
83
-
-Clean, chainable API: `info().kv().kv()`, now with `debug()`, `warn()`, `error()` and all levels
84
-
-Lossless, race-free, and cross-platform
81
+
- Console and file sinks included
82
+
- Fully structured JSON output
83
+
-Chainable API: `info().kv().kv()` and all standard log levels (`debug()`, `warn()`, `error()`, etc.)
84
+
-Race-free, lossless, and cross-platform operation
85
85
86
86
> [!TIP]
87
-
> For the best multithreaded performance, stick with the default async mode.
87
+
> For optimal multi-threaded performance, asynchronous mode is recommended.
88
88
89
89
<details>
90
-
<summary><strong>Advanced</strong>: Add a custom sink/output</summary>
*Project status: Alpha. The API will become more stable as people try it out and give feedback.*
124
+
*Project status: Alpha. The API will become more stable as users provide feedback and as adoption increases.*
125
125
126
-
## Why cLog?
127
-
I originally built cLog for myself. After a while, I realized other might want a modern C++ logger that's simple and just works (that's the goal, anyway! If it doesn't, please [open an issue](https://github.com/mbn-code/cLog/issues)). So, I decided to share it here. If it's useful to you, that's great. PRs and issues are always welcome!
126
+
## About cLog
127
+
128
+
cLog was originally developed as a practical structured logging solution for modern C++. The aim is to provide a robust, easy-to-use, and high-performance logger for projects requiring structured logs and safe multithreaded operation. Community feedback, issues, and contributions are welcome and greatly appreciated.
128
129
129
130
<details>
130
131
<summary><strong>Note on AI Involvement</strong></summary>
131
132
132
-
This project was originally meant for personal use and not publication. Some parts were implemented with the help of an AI language model (LLM). Because of that, the design and code may not follow the same conventions as community-driven or "clean-room" open source tools. Your reviews, suggestions, issues, and contributions are especially valued—and will help shape cLog into something better for everyone.
133
+
Some portions of this project were implemented with the aid of AI language modeling tools. As a result, some aspects of the code and design may differ from conventionally developed open source tools. User reviews, suggestions, and contributions are essential to shaping the future of cLog.
0 commit comments