Skip to content

Commit 637e2e9

Browse files
committed
docs: rewrite README for end users, improve tone and instructions
1 parent f494087 commit 637e2e9

1 file changed

Lines changed: 30 additions & 29 deletions

File tree

README.md

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
> Extensible sinks, structured JSON out, robust thread lifecycle, and lossless shutdown.
1111
1212
> [!IMPORTANT]
13-
> 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.
1414
1515
## Getting Started
1616

@@ -34,17 +34,17 @@ int main() {
3434
```
3535

3636
> [!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).
3838
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.
4141

4242
> [!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.
4444
4545
## Benchmarks
4646

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):
4848

4949
<p align="center">
5050
<img src="./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
6464
| **spdlog** | async | 10 | File | 0.37 | 2,700,000 | [spdlog README](https://github.com/gabime/spdlog#benchmarks) |
6565
| **spdlog** | sync | 10 | File | 0.60 | 1,660,000 | [spdlog README](https://github.com/gabime/spdlog#benchmarks) |
6666

67-
<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>
6868

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.
7373

7474
---
7575

7676
---
7777

7878
## Features
79-
- Async and sync modes (`Logger::Mode`)
79+
- Asynchronous and synchronous operation modes (`Logger::Mode`)
8080
- 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
8585

8686
> [!TIP]
87-
> For the best multithreaded performance, stick with the default async mode.
87+
> For optimal multi-threaded performance, asynchronous mode is recommended.
8888
8989
<details>
90-
<summary><strong>Advanced</strong>: Add a custom sink/output</summary>
90+
<summary><strong>Advanced: Custom Sink/Output Support</strong></summary>
9191

92-
You can write your own sink by inheriting from `c_log::Sink`:
92+
Custom sinks can be implemented by inheriting from `c_log::Sink`:
9393

9494
```cpp
9595
struct MySink : c_log::Sink {
@@ -98,17 +98,17 @@ struct MySink : c_log::Sink {
9898
}
9999
};
100100
```
101-
And then add it to the logger:
101+
Add the custom sink to the logger:
102102
```cpp
103103
log.add_sink(std::make_unique<MySink>());
104104
```
105105
</details>
106106

107-
## Issues and Contributing
108-
- Please [open an Issue](https://github.com/mbn-code/cLog/issues) for bugs, feature ideas, or questions!
109-
- Star the repo if you find it useful.
110-
- See the [Contributing Guide](CONTRIBUTING.md).
111-
- You can also check out what's next below:
107+
## Issues and Contributions
108+
- For bugs, feature suggestions, or questions, please [open an Issue](https://github.com/mbn-code/cLog/issues).
109+
- Star the repository if cLog is useful.
110+
- Contribution guidelines are available in the [Contributing Guide](CONTRIBUTING.md).
111+
- The project roadmap is listed below:
112112

113113
### Project Roadmap
114114
- [x] Robust async log draining and thread lifecycle
@@ -121,14 +121,15 @@ log.add_sink(std::make_unique<MySink>());
121121
## License
122122
MIT - see [LICENSE](LICENSE)
123123

124-
*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.*
125125

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.
128129

129130
<details>
130131
<summary><strong>Note on AI Involvement</strong></summary>
131132

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.
133134

134135
</details>

0 commit comments

Comments
 (0)