Skip to content

Commit 87f133c

Browse files
committed
docs: align README/CHANGELOG with real behavior; fix GitHub templates
Rewrite the docs to match what the code now does and drop the claims it never backed: no more "lock-free" (the async path is a mutex-synchronized MPSC queue), no "sub-microsecond / fastest" framing, and the benchmark section now explains async's actual tradeoff (hot-path offload + losslessness, not higher end-to-end throughput) with re-measured numbers and stated hardware. Document the output format, the threading model, rotation, and flush(); fix the broken Benchmarks anchor and the stderr-vs-stdout wording. Add a v0.2.0 changelog entry and correct the build steps in CONTRIBUTING. Fix the GitHub templates: issue forms now use a valid top-level description and drop the unsupported "about:" key; the PR template moves from .yml (which GitHub ignores) to Markdown. Extend .gitignore to cover benchmark artifacts and locally-built test binaries.
1 parent b166e77 commit 87f133c

8 files changed

Lines changed: 233 additions & 115 deletions

File tree

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,37 @@
1-
name: Bug report
2-
about: Create a bug report to help us improve
3-
labels: bug
1+
name: Bug report
2+
description: Report a problem so we can fix it
3+
labels: [bug]
44
body:
5-
- type: input
5+
- type: textarea
6+
id: what-happened
67
attributes:
78
label: What happened?
8-
description: Describe the bug in detail.
9+
description: Describe the bug clearly.
910
validations:
1011
required: true
11-
- type: input
12+
- type: textarea
13+
id: repro
1214
attributes:
1315
label: Steps to reproduce
14-
description: Include code, platform, and reproduction steps.
16+
description: Include a minimal code sample, the compile/run command, and what you observed.
1517
placeholder: |
1618
1. Code sample
17-
2. Compile/run this way
18-
3. Observe...
19+
2. Compile/run command
20+
3. Observed vs. expected
1921
validations:
2022
required: true
2123
- type: input
24+
id: expected
2225
attributes:
2326
label: Expected behavior
2427
description: What should have happened?
25-
placeholder: Clear statement of correct behavior...
26-
validations:
27-
required: true
28+
validations:
29+
required: true
2830
- type: textarea
31+
id: environment
2932
attributes:
30-
label: System details
31-
description: OS, compiler, and library versions
32-
placeholder: Ubuntu 22.04, g++ v10, ...
33+
label: Environment
34+
description: OS, compiler and version, C++ standard, and cLog++ version/commit.
35+
placeholder: "Ubuntu 22.04, g++ 12, -std=c++17, cLog++ @ <commit>"
3336
validations:
3437
required: false
Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
name: Feature request
2-
about: Suggest an idea for cLog
3-
labels: enhancement
2+
description: Suggest an idea or improvement for cLog++
3+
labels: [enhancement]
44
body:
5-
- type: input
5+
- type: textarea
6+
id: feature
67
attributes:
78
label: What feature do you want?
89
description: Be as specific as possible.
910
validations:
1011
required: true
1112
- type: textarea
13+
id: motivation
1214
attributes:
1315
label: Motivation
1416
description: Why is this needed? What problem does it solve?
15-
validations:
16-
required: false
17+
validations:
18+
required: false
1719
- type: textarea
20+
id: solution
1821
attributes:
1922
label: Possible solution
20-
description: Optional: sketch or describe how this could work.
21-
validations:
22-
required: false
23+
description: Optional sketch of how this could work.
24+
validations:
25+
required: false

.github/pull_request_template.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## What changed?
2+
3+
<!-- Describe the change and link any related issues, e.g. "Fixes #12". -->
4+
5+
## Checklist
6+
7+
- [ ] Builds and tests pass: `cmake -S . -B build && cmake --build build && ctest --test-dir build`
8+
- [ ] Added or updated tests for the change
9+
- [ ] Code is clear and commented where non-obvious
10+
- [ ] I license my contribution under the MIT license

.github/pull_request_template.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,12 @@ cmake-build*/
2929
.turd*
3030
__pycache__/
3131
.env
32+
33+
# Benchmark artifacts
34+
benchmark_results.csv
35+
bench_cLogpp_file.txt
36+
37+
# Locally-built binaries dropped next to sources (CMake builds go in build/).
38+
# Keep the sources; ignore everything else that lands in tests/.
39+
tests/*
40+
!tests/*.cpp

CHANGELOG.md

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,41 @@
11
# cLog++ Changelog
22

3-
## [v0.1.0] - 2026-02-10
3+
All notable changes are documented in this file.
4+
5+
## [v0.2.0] - 2026-06-09
46
### Added
5-
- First public release: async by default, robust background log draining, JSON output.
6-
- File/console sink, chainable API for log creation.
7-
- Test suite for async flush, sync mode, file sink, and crash-avoidance.
8-
- Modern, minimal, single-header main implementation.
7+
- Timestamp (`ts`, ISO-8601 UTC) and `level` fields in every JSON line.
8+
- Native JSON typing for fields: integers, unsigned integers, `double`, and `bool`
9+
are emitted unquoted (e.g. `{"n":42}`); `kv` gained overloads for these types and `const char*`.
10+
- `RotatingFileSink` (size-based rotation with a bounded number of backups).
11+
- `Logger::flush()` to block until everything submitted so far is written, plus a
12+
`Sink::flush()` hook (default no-op) honored on flush and destruction.
13+
- `clear_sinks()` to drop the default console sink, and a configurable async queue
14+
capacity via `Logger(Mode, capacity)`.
15+
- CMake build (`clogpp::clogpp` interface target), `ctest` integration, and CI on
16+
Linux, macOS, and Windows.
17+
- Regression tests for level filtering, async losslessness, JSON field shape, and rotation.
918

1019
### Fixed
11-
- Thread shutdown is now completely lossless. The background logging thread always fully drains before the logger is destroyed.
20+
- **Level filtering now works.** `set_level()` was previously never consulted, so all
21+
levels were emitted regardless.
22+
- **Async logging is now lossless.** Earlier versions ignored the queue-full signal and
23+
silently dropped entries under load (a tight loop could lose the large majority of its
24+
logs), and the shutdown drain discarded entries. The queue now applies backpressure and
25+
drains completely before the worker exits.
26+
- **Concurrent logging is now safe.** Per-entry state moved onto a per-statement
27+
`LogRecord`, removing the shared mutable builder that races when multiple threads log
28+
on one `Logger`.
29+
30+
### Changed
31+
- `info()`/`error()`/etc. now return a `LogRecord` (which emits when it goes out of
32+
scope) instead of `Logger&`. Existing chained usage — `log.info("e").kv("k", v);`
33+
is unchanged.
34+
- Documentation no longer describes the async path as "lock-free"; it is a
35+
mutex-synchronized multi-producer queue. Benchmarks were re-measured end-to-end.
1236

13-
---
14-
All changes will be documented in this file.
37+
## [v0.1.0] - 2026-02-10
38+
### Added
39+
- First public release: async-by-default logger with background draining and JSON output.
40+
- File/console sinks and a chainable API.
41+
- Initial test suite and CI.

CONTRIBUTING.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ Thank you for your interest in contributing!
66
1. **Fork the repository** and clone it locally.
77
2. **Create a new branch** for each feature or fix.
88
3. **Write clear code** and **add tests** for any new behavior.
9-
4. **Run all tests** (`g++ -std=c++17 -pthread -Iinclude tests/*.cpp && ./...`) before submitting.
9+
4. **Build and run the tests** before submitting:
10+
```bash
11+
cmake -S . -B build
12+
cmake --build build
13+
ctest --test-dir build --output-on-failure
14+
```
15+
To compile a single test directly: `g++ -std=c++17 -pthread -Iinclude tests/levels.cpp -o levels && ./levels`
1016
5. **Open a pull request** (PR) with a clear, descriptive title and summary.
1117
6. **Participate in code review. Please be responsive, constructive, and open!**
1218

0 commit comments

Comments
 (0)