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!
15
14
16
15
## Getting Started
17
16
@@ -27,68 +26,61 @@ int main() {
27
26
```
28
27
29
28
> [!IMPORTANT]
30
-
> You must let the `Logger` object live until all events are logged. It flushes automatically when destructed (end of scope).
31
-
32
-
---
29
+
> 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).
33
30
34
31
## Install
35
-
Just add `include/` to your project. No dependencies outside C++17 STL and bundled nlohmann/json.
32
+
Just add `include/` to your project. No dependencies except C++17 STL and the bundled nlohmann/json.
36
33
37
34
> [!CAUTION]
38
-
> If compiling on Windows, ensure your compiler supports at least C++17. See [CI status](https://github.com/mbn-code/cLog/actions) for tested environments.
39
-
40
-
---
35
+
> 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.
> For highest multi-threading performance, prefer the default async mode.
46
+
> For the best multithreaded performance, stick with the default async mode.
52
47
53
48
<details>
54
-
<summary><strong>Advanced</strong>: Add your own sink/output</summary>
49
+
<summary><strong>Advanced</strong>: Add a custom sink/output</summary>
55
50
56
-
Implement your own sink by inheriting from `c_log::Sink`:
51
+
You can write your own sink by inheriting from `c_log::Sink`:
57
52
58
53
```cpp
59
54
structMySink : c_log::Sink {
60
55
void log(const std::string& msg) override {
61
-
// Custom output here
56
+
// Custom output
62
57
}
63
58
};
64
59
```
65
-
Then add it to the logger:
60
+
And then add it to the logger:
66
61
```cpp
67
62
log.add_sink(std::make_unique<MySink>());
68
63
```
69
64
</details>
70
65
71
-
---
72
-
73
66
## Issues and Contributing
74
-
- Please [open an Issue](https://github.com/mbn-code/cLog/issues) for bugs, features, or questions!
75
-
- Star the repo if you find it useful
76
-
-[Contributing Guide](CONTRIBUTING.md)
77
-
-See current and planned items below:
67
+
- Please [open an Issue](https://github.com/mbn-code/cLog/issues) for bugs, feature ideas, or questions!
68
+
- Star the repo if you find it useful.
69
+
-See the [Contributing Guide](CONTRIBUTING.md).
70
+
-You can also check out what's next below:
78
71
79
72
### Project Roadmap
80
-
-[x] Robust async log draining/thread lifecycle
73
+
-[x] Robust async log draining and thread lifecycle
81
74
-[x] File and console sinks
82
75
-[x] CI/test coverage (Linux/Ubuntu)
83
-
-[ ] Easy external sink/plugin system
84
-
-[ ] Windows, Mac CI runs
85
-
-[ ] Clean config file support
86
-
87
-
---
76
+
-[ ] More flexible external sink/plugin system
77
+
-[ ] Windows and Mac CI
78
+
-[ ] Simple config file support
88
79
89
80
## License
90
81
MIT - see [LICENSE](LICENSE)
91
82
92
-
---
83
+
*Project status: Alpha. The API will become more stable as people try it out and give feedback.*
93
84
94
-
*Project status: Alpha. API will stabilize with community use.*
85
+
## Why cLog?
86
+
I originally built cLog for myself. After a while, I realized other folks 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!
0 commit comments