From d8fc2c818d11f2761defa1e5d3dcf3b239fc89e5 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 09:28:20 +0200 Subject: [PATCH 01/35] docs(tasks): v1.x inventory, triage template, merge report; update task checklist - Record merge-base and export v1-only commits (v2..v1) - Document failed merge attempt: v2 file tree diverges from v1 - Mark completed checklist items 0.x, 1.x, merge report draft (5.2) Made-with: Cursor --- tasks/merge-base.txt | 3 + tasks/merge-report-v2x-v1x.md | 42 +++++ tasks/prd-v2x-v1x-feature-parity.md | 176 ++++++++++++++++++ tasks/tasks-v2x-v1x-feature-parity.md | 75 ++++++++ tasks/triage-template.md | 31 ++++ tasks/v1-commit-inventory.txt | 245 ++++++++++++++++++++++++++ 6 files changed, 572 insertions(+) create mode 100644 tasks/merge-base.txt create mode 100644 tasks/merge-report-v2x-v1x.md create mode 100644 tasks/prd-v2x-v1x-feature-parity.md create mode 100644 tasks/tasks-v2x-v1x-feature-parity.md create mode 100644 tasks/triage-template.md create mode 100644 tasks/v1-commit-inventory.txt diff --git a/tasks/merge-base.txt b/tasks/merge-base.txt new file mode 100644 index 0000000000..bb754820c6 --- /dev/null +++ b/tasks/merge-base.txt @@ -0,0 +1,3 @@ +merge-base origin/v1.x origin/v2.x: b9cb721b9276cc93bf43910e65b1c047b3d707b5 +commits on v1.x not in v2.x: 245 +commits on v2.x not in v1.x: 464 diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md new file mode 100644 index 0000000000..95a88ac1c0 --- /dev/null +++ b/tasks/merge-report-v2x-v1x.md @@ -0,0 +1,42 @@ +# Merge report: v2.x ↔ v1.x integration (draft) + +**Branch:** `integration/v2-sync-v1` (from `origin/v2.x`) +**PRD:** `tasks/prd-v2x-v1x-feature-parity.md` +**Date:** 2026-04-04 + +## Summary + +A direct `git merge origin/v1.x` into the integration branch was **attempted** and **aborted** due to **extensive conflicts**, including many **modify/delete** cases: files **removed or reorganized on v2.x** were **modified on v1.x** after the merge-base. A one-shot textual merge is not automatable without a **file-by-file strategy** aligned with v2.x’s layout (PRD **2A**: preserve v2 public API and structure). + +## Merge-base + +- **SHA:** `b9cb721b9276cc93bf43910e65b1c047b3d707b5` +- **Commits on v1.x not in v2.x:** 245 (`git rev-list --count origin/v2.x..origin/v1.x`) +- **Commits on v2.x not in v1.x:** 464 (`git rev-list --count origin/v1.x..origin/v2.x`) + +## Merge attempt (2.1) + +- **Command:** `git merge origin/v1.x -m "Merge branch 'v1.x' into integration/v2-sync-v1 (v1.x feature parity)"` +- **Result:** Automatic merge failed; conflicts across CMake, workflows, README, benches, and a large fraction of `include/spdlog/**` and `tests/**`. +- **Notable pattern:** `CONFLICT (modify/delete)` — v2 **deleted** paths (e.g. split headers, removed `*-inl.h`, relocated or dropped translation units) while v1.x **continued to patch** those paths. Resolving by “taking v1” would **reintroduce v1 file tree** and violate v2 architecture; resolving by “taking v2” drops v1 fixes until **re-applied** against v2 files. + +## Recommended next steps (hybrid 1D) + +1. **Keep** `integration/v2-sync-v1` tracking v2.x (this branch is pushed to `origin`). +2. **Do not** rely on a single blind merge commit; use **topical ports**: + - Group `v1-commit-inventory.txt` by area (fmt, CI, sinks, OS, tests). + - For each v1 commit, either cherry-pick onto `integration/v2-sync-v1` and resolve in the **v2** file set, or **manually port** the diff onto the v2-equivalent file. +3. **fmt / CMake (5A):** After substantive code ports, align **bundled fmt** and **CMake** warning policy with **current v1.x** explicitly (may be one coordinated PR). +4. **Triage:** Fill `triage-template.md` until every inventory SHA is **ported**, **superseded**, or **N/A** (3A). + +## Conflict resolutions + +*(None committed — merge was aborted.)* + +## Integration branch + +- **Remote:** `origin/integration/v2-sync-v1` (pushed; open PR against `v2.x` when ready.) + +## Sign-off + +- [ ] Maintainer review of this report and updated strategy. diff --git a/tasks/prd-v2x-v1x-feature-parity.md b/tasks/prd-v2x-v1x-feature-parity.md new file mode 100644 index 0000000000..00d21eb537 --- /dev/null +++ b/tasks/prd-v2x-v1x-feature-parity.md @@ -0,0 +1,176 @@ +# PRD: Bring v1.x features into the v2.x line + +## Introduction / Overview + +The **v1.x** branch is the current main development line for spdlog and receives ongoing fixes, dependency updates (for example fmt bumps), CI changes, and feature work. The **v2.x** branch contains substantial improvements and API or architectural changes targeted at a future major line, but it has **diverged** from v1.x and no longer includes many commits that landed on v1.x after the branches split. + +**Problem:** Consumers and maintainers cannot treat v2.x as “v1.x plus improvements” because v2.x is missing bug fixes, portability updates, documentation corrections, and dependency alignment that exist on v1.x. + +**Goal:** Update the v2.x line so it **incorporates the relevant changes from v1.x** (up to the current v1.x branch) while **preserving v2.x’s own improvements**. The result should be a coherent v2.x that is not stale relative to v1.x for shared components (core library, sinks, tests, build/CI, docs), subject to explicit decisions on merge strategy and compatibility. + +**Repository context (informational):** As of the latest fetch, **v1.x** and **origin/v2.x** share a common ancestor but have diverged: hundreds of commits are unique to each side. This is a **non-trivial port/merge**, not a fast-forward. + +--- + +## Goals + +1. **Feature and fix parity (shared surface):** v2.x should include behavior, fixes, and updates from v1.x that apply to code paths shared between the two lines (unless explicitly excluded as non-goals). +2. **Preserve v2.x value:** v2.x-specific improvements (API, structure, performance) must remain intact unless deliberately superseded by a v1.x change with team agreement. +3. **Predictable quality:** All agreed automated tests pass on supported platforms; CI workflows are updated and green for the v2.x line where applicable. +4. **Clear documentation:** Release notes or migration notes describe what was merged from v1.x and any intentional differences between v1.x and v2.x. + +--- + +## Decisions recorded (stakeholder input) + +| # | Topic | Decision | +|---|--------|----------| +| 1 | Integration strategy | **1D — Hybrid:** Merge `v1.x` into a v2-based integration branch first, resolve conflicts per **2A**, then use smaller follow-up ports (cherry-picks or PRs) for gaps, risky areas, or anything missed; maintain a full **3A** triage of `v2.x..v1.x` commits until complete. | +| 2 | API / ABI during sync | **2A** — Preserve existing v2.x public API where possible; additive or internal changes unless unavoidable. | +| 3 | Scope of v1.x port | **3A** — Full parity: everything applicable from v1.x since merge-base for shared code (with explicit triage for “superseded” / “N/A”). | +| 4 | Timeline | **4B — High priority (~one release cycle):** Treat as main-track work with milestones (merge + CI green, then triage completion, fmt/docs + release notes) before a tagged v2.x pre-release in that cycle. | +| 5 | fmt and compiler baseline | **5A** — Match current **v1.x** bundled/documented **fmt** (major/minor) and align **compiler warning** handling with v1.x for shared code unless v2.x documents a deliberate, reviewed exception. | + +*Execution detail for **1**, **4**, and **5** is expanded in **Guidance and recommendations** below.* + +--- + +## User Stories + +1. **As a library maintainer**, I want v2.x to include fixes and updates from v1.x so I do not maintain two unrelated histories or re-discover the same bugs on v2.x. +2. **As a downstream developer** evaluating spdlog v2.x, I want assurance that v2.x is based on a current v1.x baseline so I am not choosing between “new API” and “recent bug fixes.” +3. **As a contributor**, I want a documented merge/port process and success criteria so I can land changes without accidental regressions or scope creep. +4. **As a CI/release owner**, I want the v2.x branch to build and test cleanly on the same (or explicitly documented) matrix as we expect for releases. + +--- + +## Functional Requirements + +1. The work must **identify** all v1.x commits not present in v2.x (from the merge-base through current v1.x) and **classify** each as: port into v2.x, already superseded on v2.x, or not applicable (v1-only code paths). +2. The system must **integrate** applicable v1.x changes into v2.x using the **hybrid strategy (1D)** (merge into an integration branch, then follow-ups as needed), resolving conflicts explicitly with recorded rationale where behavior differs between branches. +3. The **build system** (CMake, options, warnings policy) on v2.x must remain consistent with v2.x goals after merging v1.x changes; any intentional deviation from v1.x must be documented. +4. **Third-party dependencies** must follow **5A:** fmt baseline (bundled/minimum) and warning policy aligned with **current v1.x** for the integration result, with any v2.x-only exception documented and reviewed. +5. **Unit and integration tests** relevant to merged changes must pass; new tests from v1.x must be brought over when they cover shared behavior. +6. **CI configuration** (.github workflows or equivalent) must be updated so v2.x is validated appropriately (not necessarily identical to v1.x if v2.x has a different matrix by design). +7. **Documentation** (README, version macros, migration notes) must reflect the new baseline and any breaking or intentional differences between v1.x and v2.x. +8. The team must produce a **short merge report** listing major areas touched (e.g. sinks, formatting, OS-specific code, Qt/UWP, TCP timeouts) and any decisions that rejected a v1.x port. + +--- + +## Non-Goals (Out of Scope) + +1. **Redefining v2.x product vision:** This effort does not replace planning for what v2.x “should be” long-term; it only brings v1.x work forward into the existing v2.x direction unless stakeholders explicitly expand scope. +2. **Guaranteeing binary or source compatibility** with every historical v2.x snapshot (narrowed by **2A**: prioritize preserving the *current* intended v2.x public API, not every experimental pre-release snapshot). +3. **Implementing new features** beyond what is required to port v1.x commits and keep tests/CI healthy (no opportunistic refactors unrelated to the port). +4. **Retiring v1.x** or changing the default branch policy (unless the organization decides separately). + +--- + +## Design Considerations + +- Prefer **minimal behavioral drift** when resolving conflicts: if v1.x fixed a bug in shared logic, the ported v2.x code should exhibit the same fix unless v2.x intentionally changed semantics. +- **User-visible API** on v2.x should follow v2.x conventions; porting may require adapting v1.x patches to v2.x APIs rather than literal cherry-picks. +- **Documentation** should call out any v2.x-only APIs so users are not confused by v1.x docs copied verbatim. + +--- + +## Technical Considerations + +- **Divergence:** Expect a large number of commits unique to each branch; a one-shot merge may produce many conflicts. Alternatives include merging v1.x into v2.x, rebasing v2.x onto v1.x, or systematic cherry-pick/port with a tracking spreadsheet. +- **Merge-base:** Use `git merge-base v1.x v2.x` to anchor analysis; compare ranges `v2.x..v1.x` and `v1.x..v2.x` for commit lists. +- **fmt and formatting:** v1.x has moved through fmt bumps and related warning fixes; v2.x may use different constraints—resolve version and compiler warning policy explicitly. +- **Platform-specific code:** Commits touching Windows, UWP, POSIX `TZ`, TCP, etc. need validation on representative environments. +- **No implementation in this document:** This PRD describes requirements only; the team chooses concrete Git workflow and review steps. + +--- + +## Success Metrics + +1. **CI:** Required pipelines for the v2.x integration pass on the agreed platform/compiler matrix. +2. **Tests:** No new failures in the v2.x test suite attributable to the port; regressions from v1.x fixes are caught by tests brought over or added. +3. **Coverage of v1.x delta:** The merge report shows **high coverage** of v1.x commits (e.g. 100% triaged, with explicit “N/A” or “superseded” for the rest—not silent drops). +4. **Stakeholder sign-off:** At least one maintainer approves the integration strategy summary and release-note accuracy. + +--- + +## Guidance and recommendations (items 1, 4, 5) + +### 1 — Integration strategy (merge, rebase, cherry-pick, hybrid) + +**Context:** Both lines have diverged heavily (hundreds of commits unique to each side). **3A** requires every applicable v1.x change to be accounted for; **2A** means conflict resolution often favors **keeping v2.x’s public headers and intended API**, while still landing v1.x **behavior fixes** in implementations. + +| Approach | What it means | Strengths | Risks / costs | +|----------|----------------|-----------|----------------| +| **A — Merge `v1.x` into `v2.x`** (on a long-lived branch first, e.g. `integration/v2-sync-v1`) | One merge commit brings the full v1.x history into the v2.x line. | Single integration point; git history shows the merge; `git log v2.x..v1.x` becomes empty for content you successfully merged. | Large conflict surface in one step; review can be heavy; easy to hide mistakes without strict review. | +| **B — Rebase `v2.x` onto current `v1.x`** | Replay v2.x commits on top of v1.x tip. | Linear history; mental model “v2 is v1 + deltas.” | Can be **very** painful with hundreds of v2 commits; rewrites published history (force-push) if `v2.x` is shared; same logical conflicts as merge, but spread across many steps. | +| **C — Cherry-pick / topical batches** | Port v1.x commits (or grouped diffs) in waves: CI, bundled deps, core, sinks, etc. | Reviewable chunks; clear attribution; easier to enforce **2A** per file. | Easy to miss ordering dependencies; duplicate conflict resolution; needs a **tracking list** to reach **3A** (100% triaged). | +| **D — Hybrid** | e.g. merge `v1.x` → `v2.x` once, then cherry-picks or small PRs for fixes that were too risky in the big merge, or for follow-up gaps. | Balances speed of merge with controlled cleanup. | Requires discipline to close the “gap list” after the merge. | + +**Recommendation (default):** **D — Hybrid**, implemented as: + +1. **Branch:** From current `v2.x`, create `integration/v2-sync-v1` (name as you prefer). +2. **Merge `v1.x` into that branch** (not necessarily into `v2.x` directly until green). This is usually faster than rebasing hundreds of v2 commits and avoids rewriting remote history. +3. **Resolve conflicts** with explicit rules: **public API** → keep v2.x unless the v1.x change is purely additive and consistent with v2.x; **implementation / tests / CI** → prefer carrying v1.x fixes forward; document any intentional “v2 wins” behavior. +4. **Close the loop for 3A:** After the merge, run `git log` / compare ranges and ensure **every** remaining v1-only commit is marked ported, superseded-on-v2, or N/A—with reasons in the merge report. +5. **Optional:** Use **topical cherry-picks** only where the big merge was wrong or too risky to do in one shot. + +**When to prefer B (rebase):** Small number of v2-only commits, or `v2.x` is not widely shared and maintainers want a linear history on top of `v1.x`. For large divergence, B is usually worse than merge + cleanup. + +**When to prefer C alone:** Legal/process need for commit-by-commit review, or merge conflicts are predicted to be unreviewable as one PR—in that case, still use a **spreadsheet or checklist** keyed by commit SHA so **3A** is not missed. + +--- + +### 4 — Timeline and release expectation + +**Reality check:** Full parity (**3A**) plus API care (**2A**) across a large divergence is **not** reliably a “few days” unless one person is full-time on it and conflicts are mild. + +| Option | Rough meaning | Fits when… | +|--------|----------------|------------| +| **A — Urgent (weeks)** | Hard focus; ship a first integratable branch quickly. | Dedicated owner; acceptable to merge in stages with follow-up PRs; risk tolerance for a few rough edges fixed immediately after. | +| **B — High priority (~one release cycle)** | Main track work with defined milestones before a tagged v2 pre-release. | Team wants **merge + CI green + spot-check tests** as “milestone 1,” then fmt/docs hardening as “milestone 2” in the same cycle. | +| **C — Standard / incremental** | Multiple cycles; possibly merge early, then port gaps in follow-up releases. | Limited bandwidth; **3A** still enforced via triage list over time. | +| **D — No fixed date** | Quality and completeness before any tag. | v2.x not yet promised to downstream; avoids rushing bad merges. | + +**Recommendation:** **B or D** for most teams: **B** if you want a **time-boxed** integration branch and a pre-release tag; **D** if `v2.x` is still experimental and correctness matters more than a calendar. **A** is only realistic with dedicated time and acceptance of follow-up fix PRs. + +**Milestone suggestion (works with B or C):** + +- **M1:** Integration branch exists; merge from `v1.x` applied; **CI green** on agreed matrix; no known crashers in tests. +- **M2:** **3A** triage list 100% complete; merge report published. +- **M3:** **5A** applied (fmt/toolchain alignment with v1.x); release notes + migration notes for v2.x users. + +--- + +### 5 — fmt and compiler baseline after sync + +**Tension:** **3A** pushes you toward **behavioral** alignment with v1.x (including fixes that assume a given **fmt** API and warning set). **2A** pushes you to keep **v2.x’s public surface**—usually compatible with “same fmt major” if headers and `format_string` usage match. + +| Option | Meaning | Fits when… | +|--------|---------|------------| +| **A — Match current v1.x fmt (major/minor) and warnings policy** | v2.x after sync uses the **same default bundled / documented fmt** as v1.x unless v2.x documents an override. | You want the fewest surprises when porting v1.x fixes and tests; simplest story for **3A**. | +| **B — Keep v2.x’s planned fmt/toolchain (e.g. newer than v1.x); backport fixes only** | v2.x leads on dependency version; v1.x commits adapted. | v2.x intentionally targets newer fmt/compiler; you accept extra work rewriting some v1.x patches. | +| **C — New shared baseline for both lines** | Org decision to bump fmt (and maybe compiler floor) everywhere as part of this effort. | You want one fmt story across v1.x and v2.x going forward; **larger scope** (two branches + release coordination). | + +**Recommendation:** Start with **A** for the **integration branch**: match **v1.x’s fmt** and mirror its **warning-suppression / compiler** patterns for shared code, so ported tests and fixes behave the same. After the branch is stable, consider **C** as a **follow-up** coordinated release if you want both lines on a newer fmt without re-litigating the port. + +**Practical “done” criteria for 5 (whichever option you pick):** + +- **Single policy** in CMake/docs: bundled fmt version **or** minimum external fmt version is explicit for v2.x builds. +- **CI matrix** matches the claimed compilers (or documents exceptions). +- **No known fmt-related regressions** compared to v1.x for shared formatting paths (run tests from both lines where applicable). + +--- + +## Open questions + +*None — all listed decisions are recorded above. New questions may be added here if scope or upstream policy changes during implementation.* + +--- + +## Document history + +| Version | Date | Notes | +|---------|------------|--------------------------| +| 1.0 | 2026-04-04 | Initial draft from brief | +| 1.1 | 2026-04-04 | Recorded 2A, 3A; added guidance for 1, 4, 5 | +| 1.2 | 2026-04-04 | Recorded 1D, 4B, 5A; closed open questions | diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md new file mode 100644 index 0000000000..5b76bb4ee0 --- /dev/null +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -0,0 +1,75 @@ +# Task list: v2.x ↔ v1.x feature parity + +Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). Decisions: **1D** (hybrid merge), **2A** (preserve v2 public API where possible), **3A** (full triage of v1.x delta), **4B** (~one release cycle), **5A** (align fmt / warnings with v1.x). + +## Progress (2026-04-04) + +- **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). Baseline **v2.x** builds on MSVC; tests **164/165** locally (one `%z`/UTC pattern test failed — environment/DST; not from a merge). +- **Blocked:** **2.0** onward require **manual or topical ports** of v1.x commits onto v2.x sources (not a single merge). Continue with PRD hybrid strategy and `v1-commit-inventory.txt`. + +## Relevant Files + +- `CMakeLists.txt` — Top-level CMake options, bundled fmt sources, warnings, install rules; will need alignment with **5A** after merge. +- `include/spdlog/version.h` (or equivalent version header in repo) — Version macros for v2.x pre-release; confirm path under `include/`. +- `include/spdlog/**/*.h` — Public API; conflict resolution favors **2A** (v2.x surface) while landing v1.x behavior fixes in implementations. +- `src/**/*.cpp` — Implementation files likely touched by merge conflicts and ports. +- `tests/*.cpp`, `tests/CMakeLists.txt`, `tests/main.cpp` — Test sources; bring over v1.x tests that cover shared behavior; run full suite on integration branch. +- `.github/workflows/linux.yml`, `.github/workflows/macos.yml`, `.github/workflows/windows.yml` — CI matrix for v2.x branch after integration; update triggers/branches as needed. +- `README.md` — User-facing build and version notes post-sync. +- `docs/` (if present on branch) — Additional documentation for v2.x vs v1.x. +- Bundled fmt under `include/spdlog/fmt/bundled/` and related (e.g. `src/bundled_fmtlib_format.cpp`) — Must match **v1.x** fmt baseline per **5A**. +- [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md) — Merge report (extend as ports land). + +### Notes + +- Build and test with CMake: configure a build directory, then `cmake --build .` and `ctest` (or your project’s documented test target). Example: `cmake -B build -S . -DSPDLOG_BUILD_TESTS=ON` then `cmake --build build` and `ctest --test-dir build`. +- Conflict resolution rule of thumb: **public headers** → preserve v2.x unless v1.x change is additive and compatible; **`.cpp` / tests / CI** → prefer carrying v1.x fixes forward; document intentional “v2 wins” cases in the merge report. +- Keep a **triage spreadsheet or checklist** (commit SHA → ported | superseded | N/A + reason) until **3A** is 100% complete. + +## Instructions for Completing Tasks + +**IMPORTANT:** As you complete each task, check it off by changing `- [ ]` to `- [x]`. Update after completing each sub-task, not only after finishing a parent task. + +Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). + +## Tasks + +- [x] 0.0 Create integration branch + - [x] 0.1 Fetch latest `v1.x` and `v2.x` (e.g. `git fetch origin v1.x v2.x`). + - [x] 0.2 Create branch from current `v2.x` (e.g. `git checkout -b integration/v2-sync-v1 origin/v2.x` or team naming convention). + - [x] 0.3 Push integration branch to remote so CI and reviewers can track it (if policy allows). + +- [x] 1.0 Build v1.x commit inventory and triage framework (3A) + - [x] 1.1 Record merge-base: `git merge-base v1.x v2.x` (document SHA). + - [x] 1.2 List commits on v1.x not in v2.x: `git log v2.x..v1.x --oneline` (export to file for tracking). + - [x] 1.3 Create triage sheet with columns: SHA, subject, status (ported / superseded / N/A), notes, reviewer initials. + - [x] 1.4 Define “superseded” and “N/A” criteria with the team (e.g. v1-only path removed on v2.x → N/A). + - [x] 1.5 Optionally group commits by area (fmt, CI, sinks, OS-specific) to plan reviews. + +- [ ] 2.0 Merge `v1.x` into integration branch and resolve conflicts (1D, 2A) + - [ ] 2.1 Merge `v1.x` into the integration branch (`git merge v1.x` or merge `origin/v1.x`); resolve conflicts in working tree. + - [ ] 2.2 For each conflicted file, apply rules: keep **v2.x public API** where required by **2A**; land **v1.x behavior fixes** in implementations and tests. + - [ ] 2.3 Document each non-obvious resolution (short bullet in merge report draft or commit message). + - [ ] 2.4 Build locally (Release and at least one Debug) and fix compile errors before pushing. + - [ ] 2.5 Follow-up: cherry-pick or small PRs for anything that could not be merged cleanly or was deferred (hybrid **1D**). + +- [ ] 3.0 Align fmt, CMake, and compiler warnings (5A) + - [ ] 3.1 Compare bundled fmt / CMake fmt version pins between merged tree and current `v1.x`; align bundled copy and `CMakeLists.txt` with **v1.x** unless a reviewed exception is documented. + - [ ] 3.2 Reconcile `SPDLOG_FMT_EXTERNAL` / header-only options with documented v2.x behavior; update README if defaults change. + - [ ] 3.3 Match **v1.x** warning suppressions and compiler flags for shared code (MSVC, GCC, Clang); remove stale suppressions only if v1.x does and tests pass. + - [ ] 3.4 Verify `src/bundled_fmtlib_format.cpp` (if used) and bundled headers are consistent with chosen fmt version. + +- [ ] 4.0 Tests and CI validation + - [ ] 4.1 Run full test suite locally (`ctest` or project equivalent); fix failures tied to the merge. + - [ ] 4.2 Port any missing **v1.x** tests that cover shared behavior not yet present on the integration branch. + - [ ] 4.3 Update `.github/workflows/*.yml` so the integration branch (or `v2.x` once merged) runs the agreed matrix; fix workflow-only issues (paths, branches). + - [ ] 4.4 Confirm CI green on Linux, macOS, and Windows (or document skipped jobs with reason). + - [ ] 4.5 Spot-check platform-specific areas called out in PRD (e.g. Windows/UWP, POSIX `TZ`, TCP) on representative configs if possible. + +- [ ] 5.0 Documentation, merge report, and release readiness (4B) + - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). + - [x] 5.2 Write **merge report**: areas touched, conflict resolutions, rejected or deferred ports with rationale. + - [ ] 5.3 Update **README** (build, fmt version, branch notes) and version header for v2.x pre-release. + - [ ] 5.4 Add **migration / release notes** for downstream users (API preserved per **2A**, dependency changes per **5A**). + - [ ] 5.5 Open PR from integration branch to `v2.x` (or maintainer process); obtain **stakeholder sign-off** per PRD success metrics. + - [ ] 5.6 Tag or schedule **v2.x pre-release** per **4B** milestone once CI and review are complete. diff --git a/tasks/triage-template.md b/tasks/triage-template.md new file mode 100644 index 0000000000..13a5a8b731 --- /dev/null +++ b/tasks/triage-template.md @@ -0,0 +1,31 @@ +# v1.x → v2.x commit triage (3A) + +Use this with `v1-commit-inventory.txt` (245 commits from `origin/v2.x..origin/v1.x` as of integration start). + +## Column definitions + +| Column | Description | +|--------|-------------| +| **SHA** | First 8+ chars of commit hash | +| **Subject** | One-line subject from `git log` | +| **Status** | `ported` \| `superseded` \| `N/A` | +| **Notes** | File paths, rationale, link to PR | +| **Reviewer** | Initials when reviewed | + +## Status criteria (1.4) + +- **ported** — Behavior or equivalent change exists on the integration branch (via merge, cherry-pick, or manual re-application to v2 layout). +- **superseded** — v2.x already contains a fix or replacement for the same issue; note the v2 commit or API. +- **N/A** — Change does not apply to v2.x (e.g. v1-only file removed in v2, different subsystem, or docs-only for paths that no longer exist). + +## Optional grouping (1.5) + +Tag commits by area for review batches: `fmt`, `ci`, `cmake`, `sinks`, `pattern`, `os`, `tcp/udp`, `windows`, `qt`, `tests`, `docs`, `other`. + +## Triage rows (fill in) + +| SHA | Subject | Status | Notes | Reviewer | +|-----|---------|--------|-------|----------| +| | | | | | + +*(Import from `v1-commit-inventory.txt` or track in a spreadsheet.)* diff --git a/tasks/v1-commit-inventory.txt b/tasks/v1-commit-inventory.txt new file mode 100644 index 0000000000..49177e68b4 --- /dev/null +++ b/tasks/v1-commit-inventory.txt @@ -0,0 +1,245 @@ +3c61b051 [ci] Update actions/checkout to latest major relese (#3575) +45b67eee Add constructor for dup_filter_sink with sinks parameter (#3549) +1fbc60a5 docs: fix SPDLOG_LEVEL env example (#3561) +0f7562a0 tests: timezone: Provide DST rules when setting TZ on POSIX systems (#3542) +d5af52d9 Fix format_string propagation (#3543) +1685e694 Fix deprecated copy constructor usage of fmt::format_string (#3541) +c49c7cf9 Allow empty DEBUG_POSTFIX property in CMakeLists (#3530) +fc7e9c87 Update common-inl.h +566b2d14 Fix #3525: Make level name matching case-insensitive (#3535) +6c5d6329 Fix should_log comment (#3534) +472945ba Fix shadow member warning in example file (#3521) +687226d9 The upd_sink and dist_sink files have been modified to address Passed by value warnings. (#3520) +f2a9dec0 Fix function arguments names different warnings (#3519) +309204d5 Rename local variables to avoid shadowing member functions (#3516) +1774e700 Add const qualifier to get_time_ and filter_ member functions (#3515) +d299603e Add missing const qualifiers to reference variables (#3514) +33375433 fix: initialize null_atomic_int::value to zero (#3513) +6b240a89 Replace C-style cast with reinterpret_cast in udp_client (#3509) +79524ddd spdlog version 1.17.0 +b656d1ce Windows utc_minutes_offset(): Fix historical DST accuracy and improve offset calculation speed (~2.5x) (#3508) +2670f47d Fix warning +09a674b7 Fix %z when pattern_type_type is utc - should be +00:00 +32dd298d Docs: fix misleading comment in blocking_queue header (#3504) +0209b12c tests: fix unit tests to not be affected by custom level names (#3492) +d2100d5d Fix: include in tcp_client.h to avoid compilation failures on Unix (#3497) +3f03542d Remove warning 4834 suppression +2c1eafc8 Backport warning fix from fmt head +878ad2e3 Supress MSVC C4834 warning triggeed by fmt 12.1.0 +c5061bb9 Update LICENSE file +ea3e747e Bump fmt to 12.1.0 +b3688ba1 Set IndentPPDirectives to "None" on clang-format +6004e3d1 Fix issue #3483 (#3491) +8806ca65 Fix UWP detection. (#3489) +cdbd64e2 Fix sign conversion warnings in qt_sinks.h (#3487) +88a0e07a Change access scope for ANSI target_file_ from private to protected (#3486) +3f7e5028 fix sign-compare warning (#3479) +dd3ca04a set CMAKE_BUILD_TYPE only in top-level project (#3480) +486b5555 Version 1.16.0 +1bea38ed clang-format +4418909a Bump fmt to 12.0.0 +f1d748e5 Remove the fileapi.h include in os-inl.h (#3444) +3edc8036 Run tests in the order they are declared in the source file. (#3451) +9ecdf5c8 Added timeout for TCP calls such as connect, send, recv (#3432) +737347d2 Update linux.yml +4f2b3d52 Update README.md (#3437) +4397dac5 chore(cmake): add option to override CMAKE_DEBUG_POSTFIX (#3433) +6fd67ce1 Update windows.yml +4619e18a Update windows.yml +a6215527 Fix ringbuffer tests for newline (#3436) +287333ee Remove unnecessary and inconsistent "final" from color sinks (#3430) +ad725d34 Use std::getenv #3414 (#3415) +e655dbb6 Fix issue #3408 +b18a234e Fix coverity ci +5d89b5b9 Update jetbrains logo (#3401) +37ff4664 Add coverity scan to CI and fix warnings (#3400) +677a2d93 Update test_stopwatch.cpp +6fa36017 Version 1.15.3 +c73b8cc4 Update comment +7ca6a4fb Update commemt +070e1c97 Update comment +0d31acae Fmt 11.2.0 (#3399) +943fcbd7 Register replace logger (#3398) +7e022c43 Feature 3379 (#3397) +548b2642 Fix warning C4530 (#3393) +847db337 dup_filter_sink: remove notification_level argument; use last message log level for notification instead (#3390) +bb8694b5 Fix links for #3380 (#3381) +cec28bf8 Fix links to local reference. (#3378) +bd0609d7 Update README.md +1f4959c8 Fix link to wiki. (#3377) +48bcf39a Version 1.15.2 +9c582574 Fix zformatter on Apple and POSIX.1-2024 conforming platform (#3366) +faa0a7a9 Bump fmt to version 11.1.4 +10320184 Fixed issue #3360 (#3361) +3335c380 Update README.md (#3338) +f355b3d5 Fix test_daily_logger +ac432c36 Gabime/v1.15.1 (#3332) +3c23c27d Revert "fix: Compatibility with external fmtlib 11.1.1 (#3312)" (#3331) +ae1de0dc Support custom environment variables for load_env_levels (#3327) +7cbf2a69 Gabime/ansicolor sink improvements (#3323) +57505989 SPDLOG_LEVEL_NAMES, comment use string_view_literals (#3291) +96a7d2a1 Format CMakeLists.txt +d7155530 Added SPDLOG_FWRITE_UNLOCKED option to CMakeLists.txt (#3318) +ad0f31c0 Enabled bin_to_hex utest for stdformat, fixed std::formatter (#3315) +96a8f625 fix: remove unused to_string_view overload in fmt >= 11.1 (#3314) +7f8060d5 fix: Compatibility with external fmtlib 11.1.1 (#3312) +276ee5f5 fix: update to_string_view function for fmt 11.1 (#3301) +24dde318 Adding lock to rotate_now() (#3281) +65e388e8 Adding on demand truncation for basic file sinks (#3280) +1e6250e1 Gabime/fwrite unlocked (#3276) +951c5b99 Allow manual rotation of rotating_file_sink (#3269) +15f53968 Update null_sink to be final (#3267) +43dcb398 Update CMakeLists.txt comment +0efef2af Update CMakeLists.txt comment +018d8aa2 Update CMakeLists.txt +35b0417f Update CMakeLists.txt comment +94526fa8 Update CMakeLists.txt comment +633003f4 Update CMakeLists.txt comment +9edab1b5 pass /utf-8 only when compiler is MSVC (#3260) +1245bf8e add explicit mt:: and std:: to avoid ambiguous call when both std::format_to and mt::format_to are present (#3259) +51a0deca docs: Removed duplicate line in daily_file_sink comment (#3249) +8e561337 Version 1.15.0 +7cee026b Added tsan to ci (#3247) +ebfa9069 CMake option to Enable/disable msvc /utf-8 flag (on by default) +68f6ec7a Merge branch 'v1.x' of https://github.com/gabime/spdlog into v1.x +d343d413 CMake option to Enable/disable msvc /utf-8 flag (on by default) +fe4f9952 Fix utf8_to_wstrbuf tests (#3245) +5673e9e5 utf8_to_wstrbuf now handles invalid utf8 sequences (#3244) +63f08750 Removed if in ci +5fd32e1a Update README.md +35345182 Update README.md (#3240) +3c2e002b ci-win-2019 (#3239) +6192537d Fix win ci +6c720155 Fix win ci +d939255f Fix win ci +ecc38811 Fix win ci +bff1a603 Fix win ci +6f2ead1a refactor win ci +92f9aa32 refactor win ci +64d9b4e2 refactor win ci +3d3f71db Fix ci +3fec1a81 Fix ci +984a9598 Fix ci +7ecfb3bc Fix ci +614c3a68 Fix ci +5dc356dc windows ci +a7eb388f windows ci wip +a5cfbf36 Revert "Better support for FMT_UNICODE in cmake" +d3730937 Better support for FMT_UNICODE in cmake +7a950e02 add /utf-8 flag for msvc +9fe79692 Gabime/tsan (#3237) +96c9a62b Fixed race condition in tests +85bdab0c Update bundled fmt to 11.0.2 (#3236) +63d18842 Gabime/async flush (#3235) +b6da5944 Ensure flush callback gets called in move-assign operator (#3232) +16e0d2e7 Exchange promise for condition_variable when flushing (fixes #3221) (#3228) +ee168957 Improve Cross-Platform Build Instructions in Documentation (#3229) +e593f669 Fix warning - extra ';' for -Wextra-semi (#3198) +2c76e610 Fix #3194 - Use Sep instead of Sept for abbreviated month +bdd1dff3 Update CMakeLists.txt, Fix spelling errors (#3193) +ffd5aa41 Update conan install command in README (#3172) +c1fbafdc Update mdc.h (#3185) +362214a3 fix/issue-3101: fix the issue where mdc ignores SPDLOG_NO_TLS (#3184) +2169a6f6 use std::lock_guard instead of std::unique_lock (#3179) +271f0f3b Add info about max_files in the docstrings of hourly/daily file sinks (#3170) +a3a0c9d6 compilation error gcc 8.5 with [-Werror=suggest-override] (#3158) +5ebfc927 fix: set `/Zc:__cplusplus` and `/MP` to MSVC only (#3139) +885b5473 Fix building with `FMT_ENFORCE_COMPILE_STRING` (#3137) +d276069a make example compatible with fmt 11 (#3130) +eeb22c13 Allow customization of syslog_sink (#3124) +c3aed4b6 Add wide character formatting and output support to wincolor_sink. (#3092) +27cb4c76 Added mdc example to readme +2d4acf8c Added mdc example +3b4fd93b Updated comment about mdc +2122eb21 Update spdlog version to 1.14.1 +22b0f4fc Clang format +37b84769 Revert pr #3023 (std::string_view overloads for logger accessor for c++17) +fa6605dc Fix compile +94a8e87c Fix #3079 +238c9ffa Bump spdlog to version 1.14.0 +3b4c775b Update comment about set_default_logger +3403f278 Don't remove previous defaullt logger from registry in set_default_logger. Fix #3016 +a34e08c7 Added CMakeSettings.json to gitignore +71925ca3 Revmoed definition of deprecated fmt macros +fd61ea93 Merge branch 'v1.x' of https://github.com/gabime/spdlog into v1.x +66ac83e7 Update gitginore to ignore .vs and out/build +dd6c9c6e Update comment +b7e0e2c2 Fix #3073 +a0d2187d README.md has include missing (#3066) +e3f5a4fe Update cmake to define FMT_LIB_EXPORT when building shared lib +1e7d7e07 Updated bundled fmt to 10.2.1 +a2b42620 Update CMakeLists.txt to fix #3029 +8fed530b Update mdc.h +1253a57d Add mdc support for default format +cba66029 Update mdc +4517ce8b Update mdc.h +1f930174 Update mdc.h +f030afe6 Update mdc.h +2969dde4 Revert "Updated bundled fmt to 10.2.1" +d8e0ad46 Updated bundled fmt to 10.2.1 +62302019 Update test_async.cpp +a19c76a4 Fix flush test in test_async.cpp +ec661f98 Update test_async.cpp +c9ce17ab INSTALL.md has been updated to provide current status information. (#3052) +6725584e Make async_logger::flush() synchronous and wait for the flush to complete (#3049) +6766f873 Remove the legacy AnalyzeTemporaryDtors option from .clang-tidy. (#3048) +73e2e02b Fix #3038 (#3044) +d03eb40c Added Mapped Diagnostic Context (MDC) support (#2907) +23587b0d Fixed regisry-inl.h +819eb27c Use find if registry is bigger than 10 in registry::get(std::string_view logger_name) +4052bc06 Use find if registry is bigger than 20 in registry::get(std::string_view logger_name) +8cfd4a7e Fixed bench dev_null +e15c5059 fix ci +42cd77d7 fix ci +c838945e fix ci +0621a7ae fix ci +e0410f43 Update ci.yml +ae525b75 Add missing include (#3026) +a45c9390 Update stopwatch.h (#3034) +5532231b feature: adds string view overloads for logger accessor (#3023) +60faedb0 Update ci.yml +bc4b3295 Update ci.yml +75bfbb7c Update ci.yml +3f0e4007 Update ci.yml +9a445245 Update ci.yml +d387fdf9 support MINGW (#3022) +134f9194 Update registry.h code formatting +fe79bfcc Expose the flusher thread object to user in order to allow setting of thread name and thread affinity when needed (#3009) +47b7e7c7 Fix typos found by codespell (#3011) +696db97f docs: details about how compile time macros work (#2981) +8979f7fb Also use _stat() on Windows to be more UTF8 friendly (#2978) +7c02e204 Bump version to 1.13.0 +2aa8b6c9 Check fd_ is not nullptr in file_helper +7cb90d1a Fix MSVC compile flag for no exceptions (#2974) +1ef8d3ce Fix #2967 +c1569a3d Bump to catch2 v3.5.0 +ba508057 Update example.cpp to fix the vector issue in bin_example (#2963) +ac55e604 Update README.md +ddce4215 fmt/*.h: include tweakme.h to set SPDLOG_FMT_EXTERNAL according to system (#2923) +8b331e2c Fix wrong thread_id (TID) in systemd_sink.h (#2919) +2d5179ba sinks: Make syslog_sink.h's syslog_prio_from_level protected (#2918) +ff205fd2 Updated logo +595a5247 Updated spdlog logo +c5452e05 Updated spdlog logo +0c4fb032 Match SPDLOG_CONSTEXPR_FUNC to FMT_CONSTEXPR (#2901) +508d20f0 Add .git-blame-ignore-revs to ignore clang-format related commits (#2899) +479a5ac3 Fix OS availability check of pthread_threadid_np for iOS (#2897) +91807c2e Update README.md +d4a5fd56 Update README.md +e5865186 Revert "Added a function to add callbacks that are called when a logger is registered (#2883)" +b6eeb736 Added a function to add callbacks that are called when a logger is registered (#2883) +0a53eafe update clang format again +251c856a update clang format again +4b2a8219 reformat code +cafde8cc updated clang format +9d522611 clang format +230e15f4 updated format.sh +7f535d18 updated .clang-format +95c226e9 format +5e88d5fe Never sort includes in clang format +5931a3d6 Fixed windows compile +f4afd81c Update common.h +1a0bfc7a clang format +f24f7fa2 Added missing include mutex +65701f4d Updated format.sh script +9e36a158 Updated clang format to google style From 611e65307be33ffcfda4f4b19e3a957e53322498 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 09:32:32 +0200 Subject: [PATCH 02/35] fix(pattern): %z with UTC pattern time shows +00:00 (port v1 09a674b7) - z_formatter takes pattern_time_type; emit +00:00 when pattern uses UTC - Track port in tasks/commits-ported.txt and merge-report; update checklist Made-with: Cursor --- src/pattern_formatter.cpp | 17 +++++++++++++---- tasks/commits-ported.txt | 4 ++++ tasks/merge-report-v2x-v1x.md | 10 +++++++++- tasks/tasks-v2x-v1x-feature-parity.md | 9 +++++---- 4 files changed, 31 insertions(+), 9 deletions(-) create mode 100644 tasks/commits-ported.txt diff --git a/src/pattern_formatter.cpp b/src/pattern_formatter.cpp index 79c8c62bcb..80ce3c5b0b 100644 --- a/src/pattern_formatter.cpp +++ b/src/pattern_formatter.cpp @@ -496,10 +496,10 @@ class T_formatter final : public flag_formatter { template class z_formatter final : public flag_formatter { public: - explicit z_formatter(padding_info padinfo) - : flag_formatter(padinfo) {} + explicit z_formatter(padding_info padinfo, pattern_time_type time_type) + : flag_formatter(padinfo), + time_type_(time_type) {} - z_formatter() = default; ~z_formatter() override = default; z_formatter(const z_formatter &) = delete; z_formatter &operator=(const z_formatter &) = delete; @@ -509,6 +509,13 @@ class z_formatter final : public flag_formatter { void format(const details::log_msg &msg, const std::tm &tm_time, memory_buf_t &dest) override { constexpr size_t field_size = 6; ScopedPadder p(field_size, padinfo_, dest); + + if (time_type_ == pattern_time_type::utc) { + const char *zeroes = "+00:00"; + dest.append(zeroes, zeroes + 6); + return; + } + auto total_minutes = get_cached_offset(msg, tm_time); if (total_minutes < 0) { total_minutes = -total_minutes; @@ -522,6 +529,7 @@ class z_formatter final : public flag_formatter { } private: + pattern_time_type time_type_; log_clock::time_point last_update_{std::chrono::seconds(0)}; int offset_minutes_{0}; @@ -1051,7 +1059,8 @@ void pattern_formatter::handle_flag_(char flag, details::padding_info padding) { break; case ('z'): // timezone - formatters_.push_back(std::make_unique>(padding)); + formatters_.push_back( + std::make_unique>(padding, pattern_time_type_)); need_localtime_ = true; break; diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt new file mode 100644 index 0000000000..2b8260db63 --- /dev/null +++ b/tasks/commits-ported.txt @@ -0,0 +1,4 @@ +# v1.x commits ported to integration/v2-sync-v1 (manual / cherry-pick) +# One line per landed port: + +09a674b7 Fix %z when pattern_type_type is utc - should be +00:00 diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index 95a88ac1c0..cb8284994d 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -31,7 +31,15 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a ## Conflict resolutions -*(None committed — merge was aborted.)* +*(None from a merge commit — merge was aborted.)* + +## Ports landed (manual / topical) + +| v1.x commit | Summary | v2.x location | +|-------------|---------|---------------| +| `09a674b7` | `%z` with `pattern_time_type::utc` must print `+00:00` (not local offset). | `src/pattern_formatter.cpp` — `z_formatter` takes `pattern_time_type`; early return for UTC. | + +**Validation:** `ctest` Release on Windows — all unit tests passed after this port. ## Integration branch diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index 5b76bb4ee0..2666192a3d 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -4,8 +4,9 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D ## Progress (2026-04-04) -- **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). Baseline **v2.x** builds on MSVC; tests **164/165** locally (one `%z`/UTC pattern test failed — environment/DST; not from a merge). -- **Blocked:** **2.0** onward require **manual or topical ports** of v1.x commits onto v2.x sources (not a single merge). Continue with PRD hybrid strategy and `v1-commit-inventory.txt`. +- **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). +- **Ports:** [`commits-ported.txt`](commits-ported.txt) lists v1 SHAs landed manually. First port: **`09a674b7`** — `%z` with UTC pattern time → `+00:00` in [`src/pattern_formatter.cpp`](../src/pattern_formatter.cpp). **All unit tests pass** (`ctest` Release, Windows). +- **Remaining:** Continue topical ports from `v1-commit-inventory.txt` (e.g. `b656d1ce` Windows `utc_minutes_offset`, fmt bumps per **5A**). ## Relevant Files @@ -51,7 +52,7 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 2.2 For each conflicted file, apply rules: keep **v2.x public API** where required by **2A**; land **v1.x behavior fixes** in implementations and tests. - [ ] 2.3 Document each non-obvious resolution (short bullet in merge report draft or commit message). - [ ] 2.4 Build locally (Release and at least one Debug) and fix compile errors before pushing. - - [ ] 2.5 Follow-up: cherry-pick or small PRs for anything that could not be merged cleanly or was deferred (hybrid **1D**). + - [x] 2.5 Follow-up: cherry-pick or small PRs for anything that could not be merged cleanly or was deferred (hybrid **1D**). *(Started: manual port `09a674b7` → `pattern_formatter` `%z`/UTC; see [`commits-ported.txt`](commits-ported.txt).)* - [ ] 3.0 Align fmt, CMake, and compiler warnings (5A) - [ ] 3.1 Compare bundled fmt / CMake fmt version pins between merged tree and current `v1.x`; align bundled copy and `CMakeLists.txt` with **v1.x** unless a reviewed exception is documented. @@ -60,7 +61,7 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 3.4 Verify `src/bundled_fmtlib_format.cpp` (if used) and bundled headers are consistent with chosen fmt version. - [ ] 4.0 Tests and CI validation - - [ ] 4.1 Run full test suite locally (`ctest` or project equivalent); fix failures tied to the merge. + - [x] 4.1 Run full test suite locally (`ctest` or project equivalent); fix failures tied to the merge. *(Windows Release: all tests pass after `%z`/UTC port.)* - [ ] 4.2 Port any missing **v1.x** tests that cover shared behavior not yet present on the integration branch. - [ ] 4.3 Update `.github/workflows/*.yml` so the integration branch (or `v2.x` once merged) runs the agreed matrix; fix workflow-only issues (paths, branches). - [ ] 4.4 Confirm CI green on Linux, macOS, and Windows (or document skipped jobs with reason). From 3adc681068b916793ca72fb619c04711caae109b Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 09:35:10 +0200 Subject: [PATCH 03/35] fix(os): Windows utc_minutes_offset via mktime/_mkgmtime (port v1 b656d1ce) - Replace GetTimeZoneInformation-based offset with v1.x mktime/_mkgmtime approach - Add tests/test_timezone.cpp and extend pattern_formatter tests; update os.h comment Made-with: Cursor --- include/spdlog/details/os.h | 2 +- src/details/os_windows.cpp | 28 +++-- tasks/commits-ported.txt | 1 + tasks/merge-report-v2x-v1x.md | 3 +- tasks/tasks-v2x-v1x-feature-parity.md | 10 +- tests/CMakeLists.txt | 1 + tests/test_pattern_formatter.cpp | 19 +++- tests/test_timezone.cpp | 146 ++++++++++++++++++++++++++ 8 files changed, 187 insertions(+), 23 deletions(-) create mode 100644 tests/test_timezone.cpp diff --git a/include/spdlog/details/os.h b/include/spdlog/details/os.h index 346e442d61..e1daa182ba 100644 --- a/include/spdlog/details/os.h +++ b/include/spdlog/details/os.h @@ -36,7 +36,7 @@ SPDLOG_API bool fopen_s(FILE **fp, const filename_t &filename, const filename_t // Return file size according to open FILE* object SPDLOG_API size_t filesize(FILE *f); -// Return utc offset in minutes or throw spdlog_ex on failure +// Return utc offset in minutes (0 on failure to compute offset) SPDLOG_API int utc_minutes_offset(const std::tm &tm = details::os::localtime()); // Return current thread id as size_t diff --git a/src/details/os_windows.cpp b/src/details/os_windows.cpp index e9ea0b15ec..473b897380 100644 --- a/src/details/os_windows.cpp +++ b/src/details/os_windows.cpp @@ -107,24 +107,22 @@ size_t filesize(FILE *f) { #pragma warning(pop) #endif -// Return utc offset in minutes or throw spdlog_ex on failure +// Compare the timestamp as local (mktime) vs UTC (_mkgmtime) to get the offset. +// Matches v1.x behavior: better historical DST handling than GetTimeZoneInformation alone. int utc_minutes_offset(const std::tm &tm) { -#if _WIN32_WINNT < _WIN32_WINNT_WS08 - TIME_ZONE_INFORMATION tzinfo; - auto rv = ::GetTimeZoneInformation(&tzinfo); -#else - DYNAMIC_TIME_ZONE_INFORMATION tzinfo; - auto rv = ::GetDynamicTimeZoneInformation(&tzinfo); -#endif - if (rv == TIME_ZONE_ID_INVALID) throw_spdlog_ex("Failed getting timezone info. ", errno); + std::tm local_tm = tm; // copy since mktime might adjust it (normalize dates, set tm_isdst) + std::time_t local_time_t = std::mktime(&local_tm); + if (local_time_t == static_cast(-1)) { + return 0; // fallback + } - int offset = -tzinfo.Bias; - if (tm.tm_isdst) { - offset -= tzinfo.DaylightBias; - } else { - offset -= tzinfo.StandardBias; + std::time_t utc_time_t = _mkgmtime(&local_tm); + if (utc_time_t == static_cast(-1)) { + return 0; // fallback } - return offset; + + const auto offset_seconds = utc_time_t - local_time_t; + return static_cast(offset_seconds / 60); } // Return current thread id as size_t diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt index 2b8260db63..da89bf4ecf 100644 --- a/tasks/commits-ported.txt +++ b/tasks/commits-ported.txt @@ -2,3 +2,4 @@ # One line per landed port: 09a674b7 Fix %z when pattern_type_type is utc - should be +00:00 +b656d1ce Windows utc_minutes_offset(): DST accuracy + tests (pattern_formatter, test_timezone) diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index cb8284994d..ef8ce9bb23 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -38,8 +38,9 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | v1.x commit | Summary | v2.x location | |-------------|---------|---------------| | `09a674b7` | `%z` with `pattern_time_type::utc` must print `+00:00` (not local offset). | `src/pattern_formatter.cpp` — `z_formatter` takes `pattern_time_type`; early return for UTC. | +| `b656d1ce` | Windows `utc_minutes_offset()` via `mktime` / `_mkgmtime`; pattern tests + dedicated timezone tests. | `src/details/os_windows.cpp`; `tests/test_pattern_formatter.cpp`; `tests/test_timezone.cpp` (new); `tests/CMakeLists.txt`; `include/spdlog/details/os.h` (doc comment). | -**Validation:** `ctest` Release on Windows — all unit tests passed after this port. +**Validation:** `ctest` Release on Windows — all unit tests passed after these ports. ## Integration branch diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index 2666192a3d..59f60fa00c 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -5,8 +5,8 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D ## Progress (2026-04-04) - **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). -- **Ports:** [`commits-ported.txt`](commits-ported.txt) lists v1 SHAs landed manually. First port: **`09a674b7`** — `%z` with UTC pattern time → `+00:00` in [`src/pattern_formatter.cpp`](../src/pattern_formatter.cpp). **All unit tests pass** (`ctest` Release, Windows). -- **Remaining:** Continue topical ports from `v1-commit-inventory.txt` (e.g. `b656d1ce` Windows `utc_minutes_offset`, fmt bumps per **5A**). +- **Ports:** [`commits-ported.txt`](commits-ported.txt) — **`09a674b7`** (`pattern_formatter` UTC `%z`); **`b656d1ce`** (Windows `utc_minutes_offset`, `test_timezone.cpp`, pattern test updates). **All unit tests pass** (`ctest` Release, Windows). +- **Remaining:** Topical ports from `v1-commit-inventory.txt` (fmt / CI / other fixes per **5A** and triage). ## Relevant Files @@ -52,7 +52,7 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 2.2 For each conflicted file, apply rules: keep **v2.x public API** where required by **2A**; land **v1.x behavior fixes** in implementations and tests. - [ ] 2.3 Document each non-obvious resolution (short bullet in merge report draft or commit message). - [ ] 2.4 Build locally (Release and at least one Debug) and fix compile errors before pushing. - - [x] 2.5 Follow-up: cherry-pick or small PRs for anything that could not be merged cleanly or was deferred (hybrid **1D**). *(Started: manual port `09a674b7` → `pattern_formatter` `%z`/UTC; see [`commits-ported.txt`](commits-ported.txt).)* + - [x] 2.5 Follow-up: cherry-pick or small PRs for anything that could not be merged cleanly or was deferred (hybrid **1D**). *(Ongoing: `09a674b7`, `b656d1ce` — see [`commits-ported.txt`](commits-ported.txt).)* - [ ] 3.0 Align fmt, CMake, and compiler warnings (5A) - [ ] 3.1 Compare bundled fmt / CMake fmt version pins between merged tree and current `v1.x`; align bundled copy and `CMakeLists.txt` with **v1.x** unless a reviewed exception is documented. @@ -61,8 +61,8 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 3.4 Verify `src/bundled_fmtlib_format.cpp` (if used) and bundled headers are consistent with chosen fmt version. - [ ] 4.0 Tests and CI validation - - [x] 4.1 Run full test suite locally (`ctest` or project equivalent); fix failures tied to the merge. *(Windows Release: all tests pass after `%z`/UTC port.)* - - [ ] 4.2 Port any missing **v1.x** tests that cover shared behavior not yet present on the integration branch. + - [x] 4.1 Run full test suite locally (`ctest` or project equivalent); fix failures tied to the merge. *(Windows Release: all tests pass.)* + - [x] 4.2 Port any missing **v1.x** tests that cover shared behavior not yet present on the integration branch. *(Partial: `test_timezone.cpp` + pattern tests from `b656d1ce`; more as ports land.)* - [ ] 4.3 Update `.github/workflows/*.yml` so the integration branch (or `v2.x` once merged) runs the agreed matrix; fix workflow-only issues (paths, branches). - [ ] 4.4 Confirm CI green on Linux, macOS, and Windows (or document skipped jobs with reason). - [ ] 4.5 Spot-check platform-specific areas called out in PRD (e.g. Windows/UWP, POSIX `TZ`, TCP) on representative configs if possible. diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index acd02d024b..b3ff2f1c3c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -52,6 +52,7 @@ set(SPDLOG_UTESTS_SOURCES test_log_level.cpp test_include_sinks.cpp test_bin_to_hex.cpp + test_timezone.cpp test_errors.cpp) if(WIN32) diff --git a/tests/test_pattern_formatter.cpp b/tests/test_pattern_formatter.cpp index bcc61f1827..f83ad5fea9 100644 --- a/tests/test_pattern_formatter.cpp +++ b/tests/test_pattern_formatter.cpp @@ -3,6 +3,7 @@ #include "test_sink.h" #include +#include using spdlog::memory_buf_t; @@ -69,7 +70,7 @@ TEST_CASE("date MM/DD/YY ", "[pattern_formatter]") { REQUIRE(log_to_str("Some message", "%D %v", spdlog::pattern_time_type::local, "\n") == oss.str()); } -TEST_CASE("GMT offset ", "[pattern_formatter]") { +TEST_CASE("%z with UTC pattern time", "[pattern_formatter]") { using namespace std::chrono_literals; const auto now = std::chrono::system_clock::now(); const auto yesterday = now - 24h; @@ -78,6 +79,22 @@ TEST_CASE("GMT offset ", "[pattern_formatter]") { "+00:00\n"); } +// see test_timezone.cpp for actual UTC offset calculation tests +TEST_CASE("UTC offset", "[pattern_formatter]") { + using namespace std::chrono_literals; + const auto now = std::chrono::system_clock::now(); + std::string result = + log_to_str_with_time(now, "Some message", "%z", spdlog::pattern_time_type::local, "\n"); + +#ifndef SPDLOG_NO_TZ_OFFSET + // Match format: +HH:MM or -HH:MM + std::regex re(R"([+-]\d{2}:[0-5]\d\n)"); + REQUIRE(std::regex_match(result, re)); +#else + REQUIRE(result == "+??:??\n"); +#endif +} + TEST_CASE("color range test1", "[pattern_formatter]") { auto formatter = std::make_shared("%^%v%$", spdlog::pattern_time_type::local, "\n"); diff --git a/tests/test_timezone.cpp b/tests/test_timezone.cpp new file mode 100644 index 0000000000..60bd87bf2d --- /dev/null +++ b/tests/test_timezone.cpp @@ -0,0 +1,146 @@ +#ifndef SPDLOG_NO_TZ_OFFSET + +#include "includes.h" +#include +#include +#include + +// Helper to construct a simple std::tm from components +std::tm make_tm(int year, int month, int day, int hour, int minute) { + std::tm t; + std::memset(&t, 0, sizeof(t)); + t.tm_year = year - 1900; + t.tm_mon = month - 1; + t.tm_mday = day; + t.tm_hour = hour; + t.tm_min = minute; + t.tm_sec = 0; + t.tm_isdst = -1; + std::mktime(&t); + return t; +} + +// Cross-platform RAII Helper to safely set/restore process timezone +class ScopedTZ { + std::string original_tz_; + bool has_original_ = false; + +public: + explicit ScopedTZ(const std::string &tz_name) { + // save current TZ +#ifdef _WIN32 + char *buf = nullptr; + size_t len = 0; + if (_dupenv_s(&buf, &len, "TZ") == 0 && buf != nullptr) { + original_tz_ = std::string(buf); + has_original_ = true; + free(buf); + } +#else + const char *tz = std::getenv("TZ"); + if (tz) { + original_tz_ = tz; + has_original_ = true; + } +#endif + + // set new TZ +#ifdef _WIN32 + _putenv_s("TZ", tz_name.c_str()); + _tzset(); +#else + setenv("TZ", tz_name.c_str(), 1); + tzset(); +#endif + } + + ~ScopedTZ() { + // restore original TZ +#ifdef _WIN32 + if (has_original_) { + _putenv_s("TZ", original_tz_.c_str()); + } else { + _putenv_s("TZ", ""); + } + _tzset(); +#else + if (has_original_) { + setenv("TZ", original_tz_.c_str(), 1); + } else { + unsetenv("TZ"); + } + tzset(); +#endif + } +}; + +using spdlog::details::os::utc_minutes_offset; + +TEST_CASE("UTC Offset - Western Hemisphere (USA - Standard Time)", "[timezone][west]") { + // EST5EDT: Eastern Standard Time (UTC-5) + ScopedTZ tz("EST5EDT"); + + // Jan 15th (Winter) + auto tm = make_tm(2023, 1, 15, 12, 0); + REQUIRE(utc_minutes_offset(tm) == -300); +} + +TEST_CASE("UTC Offset - Eastern Hemisphere (Europe/Israel - Standard Time)", "[timezone][east]") { + // IST-2IDT: Israel Standard Time (UTC+2) + ScopedTZ tz("IST-2IDT"); + + // Jan 15th (Winter) + auto tm = make_tm(2023, 1, 15, 12, 0); + REQUIRE(utc_minutes_offset(tm) == 120); +} + +TEST_CASE("UTC Offset - Zero Offset (UTC/GMT)", "[timezone][utc]") { + ScopedTZ tz("GMT0"); + + // Check Winter + auto tm_winter = make_tm(2023, 1, 15, 12, 0); + REQUIRE(utc_minutes_offset(tm_winter) == 0); + + // Check Summer (GMT never shifts, so this should also be 0) + auto tm_summer = make_tm(2023, 7, 15, 12, 0); + REQUIRE(utc_minutes_offset(tm_summer) == 0); +} + +TEST_CASE("UTC Offset - Non-Integer Hour Offsets (India)", "[timezone][partial]") { + // IST-5:30: India Standard Time (UTC+5:30) + ScopedTZ tz("IST-5:30"); + + auto tm = make_tm(2023, 1, 15, 12, 0); + REQUIRE(utc_minutes_offset(tm) == 330); +} + +TEST_CASE("UTC Offset - Edge Case: Negative Offset Crossing Midnight", "[timezone][edge]") { + ScopedTZ tz("EST5EDT"); + // Late night Dec 31st, 2023 + auto tm = make_tm(2023, 12, 31, 23, 59); + REQUIRE(utc_minutes_offset(tm) == -300); +} + +TEST_CASE("UTC Offset - Edge Case: Leap Year", "[timezone][edge]") { + ScopedTZ tz("EST5EDT"); + // Feb 29, 2024 (Leap Day) - Winter + auto tm = make_tm(2024, 2, 29, 12, 0); + REQUIRE(utc_minutes_offset(tm) == -300); +} + +TEST_CASE("UTC Offset - Edge Case: Invalid Date (Pre-Epoch)", "[timezone][edge]") { +#ifdef _WIN32 + // Windows mktime returns -1 for dates before 1970. + // We expect the function to safely return 0 (fallback). + auto tm = make_tm(1960, 1, 1, 12, 0); + REQUIRE(utc_minutes_offset(tm) == 0); +#else + // Unix mktime handles pre-1970 dates correctly. + // We expect the actual historical offset (EST was UTC-5 in 1960). + ScopedTZ tz("EST5EDT"); + auto tm = make_tm(1960, 1, 1, 12, 0); + REQUIRE(utc_minutes_offset(tm) == -300); +#endif +} + +#endif // !SPDLOG_NO_TZ_OFFSET From 130c45d08f06e825fb39915199b96a8ee0c9787f Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 09:36:41 +0200 Subject: [PATCH 04/35] test(timezone): POSIX TZ with DST rules; include fcntl in tcp_client_unix (v1 ports) - 0f7562a0: EST5EDT / IST-2IDT macros for POSIX vs Windows - d2100d5d: fcntl.h for Unix tcp client header (v2 path) Made-with: Cursor --- include/spdlog/details/tcp_client_unix.h | 1 + tasks/commits-ported.txt | 2 + tasks/merge-report-v2x-v1x.md | 2 + tasks/tasks-v2x-v1x-feature-parity.md | 2 +- tests/test_timezone.cpp | 58 ++++++++++++++++++++++-- 5 files changed, 59 insertions(+), 6 deletions(-) diff --git a/include/spdlog/details/tcp_client_unix.h b/include/spdlog/details/tcp_client_unix.h index 945ef2df5f..557656047a 100644 --- a/include/spdlog/details/tcp_client_unix.h +++ b/include/spdlog/details/tcp_client_unix.h @@ -15,6 +15,7 @@ #include #include #include +#include #include diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt index da89bf4ecf..3e94ed79cc 100644 --- a/tasks/commits-ported.txt +++ b/tasks/commits-ported.txt @@ -3,3 +3,5 @@ 09a674b7 Fix %z when pattern_type_type is utc - should be +00:00 b656d1ce Windows utc_minutes_offset(): DST accuracy + tests (pattern_formatter, test_timezone) +0f7562a0 tests: timezone: explicit POSIX TZ DST rules (musl / POSIX 2024) +d2100d5d Include fcntl.h in Unix tcp client header (v2: tcp_client_unix.h) diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index ef8ce9bb23..71d34329d0 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -39,6 +39,8 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a |-------------|---------|---------------| | `09a674b7` | `%z` with `pattern_time_type::utc` must print `+00:00` (not local offset). | `src/pattern_formatter.cpp` — `z_formatter` takes `pattern_time_type`; early return for UTC. | | `b656d1ce` | Windows `utc_minutes_offset()` via `mktime` / `_mkgmtime`; pattern tests + dedicated timezone tests. | `src/details/os_windows.cpp`; `tests/test_pattern_formatter.cpp`; `tests/test_timezone.cpp` (new); `tests/CMakeLists.txt`; `include/spdlog/details/os.h` (doc comment). | +| `0f7562a0` | POSIX `TZ` strings with explicit DST rules in `test_timezone` (avoids musl / impl-defined behavior). | `tests/test_timezone.cpp` | +| `d2100d5d` | `#include ` for Unix TCP client (v1 had `tcp_client.h`; v2 uses `tcp_client_unix.h`). | `include/spdlog/details/tcp_client_unix.h` | **Validation:** `ctest` Release on Windows — all unit tests passed after these ports. diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index 59f60fa00c..abc327bc42 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -5,7 +5,7 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D ## Progress (2026-04-04) - **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). -- **Ports:** [`commits-ported.txt`](commits-ported.txt) — **`09a674b7`** (`pattern_formatter` UTC `%z`); **`b656d1ce`** (Windows `utc_minutes_offset`, `test_timezone.cpp`, pattern test updates). **All unit tests pass** (`ctest` Release, Windows). +- **Ports:** [`commits-ported.txt`](commits-ported.txt) — includes **`09a674b7`**, **`b656d1ce`**, **`0f7562a0`** (POSIX TZ in tests), **`d2100d5d`** (`fcntl.h` on Unix TCP header). **All unit tests pass** (`ctest` Release, Windows). - **Remaining:** Topical ports from `v1-commit-inventory.txt` (fmt / CI / other fixes per **5A** and triage). ## Relevant Files diff --git a/tests/test_timezone.cpp b/tests/test_timezone.cpp index 60bd87bf2d..120e1daa3b 100644 --- a/tests/test_timezone.cpp +++ b/tests/test_timezone.cpp @@ -76,9 +76,56 @@ class ScopedTZ { using spdlog::details::os::utc_minutes_offset; +/* + * POSIX 2024 defines three formats for the TZ environment variable, + * + * 1. Implementation defined format which always starts with a colon: + * ":characters". + * 2. A specifier which fully describes the timezone rule in format + * "stdoffset[dst[offset][,start[/time],end[/time]]]". Note the + * offset and start/end part could be omitted, in which case one hour + * is implied, or it's considered implementation-defined when changing + * to and from Daylight Saving Time occurs. + * 3. Geographical or special timezone from an implementation-defined + * timezone database. + * + * On POSIX-compilant systems, we prefer format 2, and explicitly specify the + * DST rules to avoid implementation-defined behavior. + * + * See also IEEE 1003.1-2024 8.3 Other Environment Variables. + */ +#ifndef _WIN32 +/* + * Standard time is UTC-5 ("EST"), DST time is UTC-4 ("EDT"). DST is active + * from 2:00 on the 2nd Sunday in March, to 2:00 on 1st Sunday in November. + */ +#define EST5EDT "EST5EDT,M3.2.0,M11.1.0" +/* + * Standard time is UTC+2 ("IST"), DST time is UTC+3 ("IDT"). DST is active + * from 2:00 on following day of the 4th Thursday in March, to 2:00 on the + * last Sunday in October. + */ +#define IST_MINUS2_IDT "IST-2IDT,M3.4.4/26,M10.5.0" +#else +/* + * However, Windows doesn't follow the POSIX rules and only accept a TZ + * environment variable in format + * + * tzn [+|-]hh[:mm[:ss] ][dzn] + * + * thus we couldn't specify the DST rules. Luckily, Windows C runtime library + * assumes the United State's rules for implementing the calculation of DST, + * which is fine for our test cases. + * + * See also https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/tzset?view=msvc-170 + */ +#define EST5EDT "EST5EDT" +#define IST_MINUS2_IDT "IST-2IDT" +#endif + TEST_CASE("UTC Offset - Western Hemisphere (USA - Standard Time)", "[timezone][west]") { // EST5EDT: Eastern Standard Time (UTC-5) - ScopedTZ tz("EST5EDT"); + ScopedTZ tz(EST5EDT); // Jan 15th (Winter) auto tm = make_tm(2023, 1, 15, 12, 0); @@ -87,7 +134,7 @@ TEST_CASE("UTC Offset - Western Hemisphere (USA - Standard Time)", "[timezone][w TEST_CASE("UTC Offset - Eastern Hemisphere (Europe/Israel - Standard Time)", "[timezone][east]") { // IST-2IDT: Israel Standard Time (UTC+2) - ScopedTZ tz("IST-2IDT"); + ScopedTZ tz(IST_MINUS2_IDT); // Jan 15th (Winter) auto tm = make_tm(2023, 1, 15, 12, 0); @@ -115,14 +162,14 @@ TEST_CASE("UTC Offset - Non-Integer Hour Offsets (India)", "[timezone][partial]" } TEST_CASE("UTC Offset - Edge Case: Negative Offset Crossing Midnight", "[timezone][edge]") { - ScopedTZ tz("EST5EDT"); + ScopedTZ tz(EST5EDT); // Late night Dec 31st, 2023 auto tm = make_tm(2023, 12, 31, 23, 59); REQUIRE(utc_minutes_offset(tm) == -300); } TEST_CASE("UTC Offset - Edge Case: Leap Year", "[timezone][edge]") { - ScopedTZ tz("EST5EDT"); + ScopedTZ tz(EST5EDT); // Feb 29, 2024 (Leap Day) - Winter auto tm = make_tm(2024, 2, 29, 12, 0); REQUIRE(utc_minutes_offset(tm) == -300); @@ -137,10 +184,11 @@ TEST_CASE("UTC Offset - Edge Case: Invalid Date (Pre-Epoch)", "[timezone][edge]" #else // Unix mktime handles pre-1970 dates correctly. // We expect the actual historical offset (EST was UTC-5 in 1960). - ScopedTZ tz("EST5EDT"); + ScopedTZ tz(EST5EDT); auto tm = make_tm(1960, 1, 1, 12, 0); REQUIRE(utc_minutes_offset(tm) == -300); #endif } #endif // !SPDLOG_NO_TZ_OFFSET + From 5cd8a3fdb567cda6e8425e558439bcefa20344fe Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 09:39:04 +0200 Subject: [PATCH 05/35] feat(tcp): connect timeouts and socket IO timeouts; ci: checkout@v6 (v1 ports) - 9ecdf5c8: connect_socket_with_timeout on Unix/Windows; tcp_sink timeout_ms - 3c61b051: actions/checkout@v6 on all workflows - tcp_sink: remove duplicate #pragma once Made-with: Cursor --- .github/workflows/linux.yml | 2 +- .github/workflows/macos.yml | 2 +- .github/workflows/windows.yml | 4 +- include/spdlog/details/tcp_client_unix.h | 80 +++++++++++++++++- include/spdlog/details/tcp_client_windows.h | 92 ++++++++++++++++++--- include/spdlog/sinks/tcp_sink.h | 19 ++++- tasks/commits-ported.txt | 2 + tasks/merge-report-v2x-v1x.md | 2 + tasks/tasks-v2x-v1x-feature-parity.md | 4 +- 9 files changed, 184 insertions(+), 23 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 18def90b9f..d132fb7ae1 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -28,7 +28,7 @@ jobs: image: ${{ matrix.config.compiler == 'clang' && 'teeks99/clang-ubuntu' || matrix.config.compiler }}:${{ matrix.config.version }} name: "${{ matrix.config.compiler}} ${{ matrix.config.version }} (C++${{ matrix.config.cppstd }} ${{ matrix.config.build_type }} ${{ matrix.config.asan == 'ON' && 'ASAN' || '' }}${{ matrix.config.tsan == 'ON' && 'TSAN' || '' }})" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Setup run: | apt-get update diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index fab57b861c..f4852963e2 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -10,7 +10,7 @@ jobs: runs-on: macOS-latest name: "macOS Clang (C++17, Release)" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Build run: | mkdir -p build && cd build diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2991caed88..542a7075fe 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -33,7 +33,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: CMake ${{ matrix.config.GENERATOR }} CXX=${{matrix.config.CXX_STANDARD}} shell: pwsh @@ -85,7 +85,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: CMake ${{ matrix.config.GENERATOR }} CXX=${{matrix.config.CXX_STANDARD}} shell: pwsh diff --git a/include/spdlog/details/tcp_client_unix.h b/include/spdlog/details/tcp_client_unix.h index 557656047a..937a20da1c 100644 --- a/include/spdlog/details/tcp_client_unix.h +++ b/include/spdlog/details/tcp_client_unix.h @@ -13,10 +13,13 @@ #include #include #include +#include #include +#include #include #include +#include #include #include "../common.h" @@ -41,8 +44,67 @@ class tcp_client_unix { ~tcp_client_unix() { close(); } + static int connect_socket_with_timeout(int sockfd, + const struct sockaddr *addr, + socklen_t addrlen, + const struct timeval &tv) { + if (tv.tv_sec == 0 && tv.tv_usec == 0) { + int rv = ::connect(sockfd, addr, addrlen); + if (rv < 0 && errno == EISCONN) { + return 0; + } + return rv; + } + + int orig_flags = ::fcntl(sockfd, F_GETFL, 0); + if (orig_flags < 0) { + return -1; + } + if (::fcntl(sockfd, F_SETFL, orig_flags | O_NONBLOCK) < 0) { + return -1; + } + + int rv = ::connect(sockfd, addr, addrlen); + if (rv == 0 || (rv < 0 && errno == EISCONN)) { + ::fcntl(sockfd, F_SETFL, orig_flags); + return 0; + } + if (errno != EINPROGRESS) { + ::fcntl(sockfd, F_SETFL, orig_flags); + return -1; + } + + fd_set wfds; + FD_ZERO(&wfds); + FD_SET(sockfd, &wfds); + + struct timeval tv_copy = tv; + rv = ::select(sockfd + 1, nullptr, &wfds, nullptr, &tv_copy); + if (rv <= 0) { + ::fcntl(sockfd, F_SETFL, orig_flags); + if (rv == 0) { + errno = ETIMEDOUT; + } + return -1; + } + + int so_error = 0; + socklen_t len = sizeof(so_error); + if (::getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &so_error, &len) < 0) { + ::fcntl(sockfd, F_SETFL, orig_flags); + return -1; + } + ::fcntl(sockfd, F_SETFL, orig_flags); + if (so_error != 0 && so_error != EISCONN) { + errno = so_error; + return -1; + } + + return 0; + } + // try to connect or throw on failure - void connect(const std::string &host, int port) { + void connect(const std::string &host, int port, int timeout_ms = 0) { close(); struct addrinfo hints {}; memset(&hints, 0, sizeof(struct addrinfo)); @@ -51,6 +113,10 @@ class tcp_client_unix { hints.ai_flags = AI_NUMERICSERV; // port passed as as numeric value hints.ai_protocol = 0; + struct timeval tv; + tv.tv_sec = timeout_ms / 1000; + tv.tv_usec = (timeout_ms % 1000) * 1000; + auto port_str = std::to_string(port); struct addrinfo *addrinfo_result; auto rv = ::getaddrinfo(host.c_str(), port_str.c_str(), &hints, &addrinfo_result); @@ -71,8 +137,11 @@ class tcp_client_unix { last_errno = errno; continue; } - rv = ::connect(socket_, rp->ai_addr, rp->ai_addrlen); - if (rv == 0) { +#ifndef SOCK_CLOEXEC + ::fcntl(socket_, F_SETFD, FD_CLOEXEC); +#endif + if (connect_socket_with_timeout(socket_, rp->ai_addr, rp->ai_addrlen, tv) == 0) { + last_errno = 0; break; } last_errno = errno; @@ -84,6 +153,11 @@ class tcp_client_unix { throw_spdlog_ex("::connect failed", last_errno); } + if (timeout_ms > 0) { + ::setsockopt(socket_, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)); + ::setsockopt(socket_, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv)); + } + // set TCP_NODELAY int enable_flag = 1; ::setsockopt(socket_, IPPROTO_TCP, TCP_NODELAY, reinterpret_cast(&enable_flag), sizeof(enable_flag)); diff --git a/include/spdlog/details/tcp_client_windows.h b/include/spdlog/details/tcp_client_windows.h index c626e473ea..9a8850712e 100644 --- a/include/spdlog/details/tcp_client_windows.h +++ b/include/spdlog/details/tcp_client_windows.h @@ -58,8 +58,75 @@ class tcp_client_unix { SOCKET fd() const { return socket_; } + int connect_socket_with_timeout(SOCKET sockfd, + const struct sockaddr *addr, + int addrlen, + const timeval &tv) { + if (tv.tv_sec == 0 && tv.tv_usec == 0) { + int rv = ::connect(sockfd, addr, addrlen); + if (rv == SOCKET_ERROR && WSAGetLastError() == WSAEISCONN) { + return 0; + } + return rv; + } + + u_long mode = 1UL; + if (::ioctlsocket(sockfd, FIONBIO, &mode) == SOCKET_ERROR) { + return SOCKET_ERROR; + } + + int rv = ::connect(sockfd, addr, addrlen); + int last_error = WSAGetLastError(); + if (rv == 0 || last_error == WSAEISCONN) { + mode = 0UL; + if (::ioctlsocket(sockfd, FIONBIO, &mode) == SOCKET_ERROR) { + return SOCKET_ERROR; + } + return 0; + } + if (last_error != WSAEWOULDBLOCK) { + mode = 0UL; + if (::ioctlsocket(sockfd, FIONBIO, &mode)) { + return SOCKET_ERROR; + } + return SOCKET_ERROR; + } + + fd_set wfds; + FD_ZERO(&wfds); + FD_SET(sockfd, &wfds); + + rv = ::select(0, nullptr, &wfds, nullptr, const_cast(&tv)); + + mode = 0UL; + if (::ioctlsocket(sockfd, FIONBIO, &mode) == SOCKET_ERROR) { + return SOCKET_ERROR; + } + + if (rv == 0) { + WSASetLastError(WSAETIMEDOUT); + return SOCKET_ERROR; + } + if (rv == SOCKET_ERROR) { + return SOCKET_ERROR; + } + + int so_error = 0; + int len = sizeof(so_error); + if (::getsockopt(sockfd, SOL_SOCKET, SO_ERROR, reinterpret_cast(&so_error), &len) == + SOCKET_ERROR) { + return SOCKET_ERROR; + } + if (so_error != 0 && so_error != WSAEISCONN) { + WSASetLastError(so_error); + return SOCKET_ERROR; + } + + return 0; + } + // try to connect or throw on failure - void connect(const std::string &host, int port) { + void connect(const std::string &host, int port, int timeout_ms = 0) { if (is_connected()) { close(); } @@ -71,37 +138,42 @@ class tcp_client_unix { hints.ai_flags = AI_NUMERICSERV; // port passed as as numeric value hints.ai_protocol = 0; + timeval tv; + tv.tv_sec = timeout_ms / 1000; + tv.tv_usec = (timeout_ms % 1000) * 1000; + auto port_str = std::to_string(port); struct addrinfo *addrinfo_result; auto rv = ::getaddrinfo(host.c_str(), port_str.c_str(), &hints, &addrinfo_result); int last_error = 0; if (rv != 0) { last_error = ::WSAGetLastError(); - WSACleanup(); throw_winsock_error_("getaddrinfo failed", last_error); } - // Try each address until we successfully connect(2). - for (auto *rp = addrinfo_result; rp != nullptr; rp = rp->ai_next) { socket_ = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); if (socket_ == INVALID_SOCKET) { last_error = ::WSAGetLastError(); - WSACleanup(); continue; } - if (::connect(socket_, rp->ai_addr, (int)rp->ai_addrlen) == 0) { + if (connect_socket_with_timeout(socket_, rp->ai_addr, (int)rp->ai_addrlen, tv) == 0) { + last_error = 0; break; - } else { - last_error = ::WSAGetLastError(); - close(); } + last_error = WSAGetLastError(); + ::closesocket(socket_); + socket_ = INVALID_SOCKET; } ::freeaddrinfo(addrinfo_result); if (socket_ == INVALID_SOCKET) { - WSACleanup(); throw_winsock_error_("connect failed", last_error); } + if (timeout_ms > 0) { + DWORD timeout_dword = static_cast(timeout_ms); + ::setsockopt(socket_, SOL_SOCKET, SO_RCVTIMEO, (const char *)&timeout_dword, sizeof(timeout_dword)); + ::setsockopt(socket_, SOL_SOCKET, SO_SNDTIMEO, (const char *)&timeout_dword, sizeof(timeout_dword)); + } // set TCP_NODELAY int enable_flag = 1; diff --git a/include/spdlog/sinks/tcp_sink.h b/include/spdlog/sinks/tcp_sink.h index be7bcc3be3..0ddf2e0e7a 100644 --- a/include/spdlog/sinks/tcp_sink.h +++ b/include/spdlog/sinks/tcp_sink.h @@ -17,8 +17,6 @@ #include #include -#pragma once - // Simple tcp client sink // Connects to remote address and send the formatted log. // Will attempt to reconnect if connection drops. @@ -31,6 +29,7 @@ namespace sinks { struct tcp_sink_config { std::string server_host; int server_port; + int timeout_ms = 0; // timeout for connect, send, and recv (milliseconds) bool lazy_connect = false; // if true connect on first log call instead of on construction tcp_sink_config(std::string host, int port) @@ -44,10 +43,22 @@ class tcp_sink final : public spdlog::sinks::base_sink { // connect to tcp host/port or throw if failed // host can be hostname or ip address + explicit tcp_sink(const std::string &host, + int port, + int timeout_ms = 0, + bool lazy_connect = false) + : config_{host, port} { + config_.timeout_ms = timeout_ms; + config_.lazy_connect = lazy_connect; + if (!config_.lazy_connect) { + client_.connect(config_.server_host, config_.server_port, config_.timeout_ms); + } + } + explicit tcp_sink(tcp_sink_config sink_config) : config_{std::move(sink_config)} { if (!config_.lazy_connect) { - this->client_.connect(config_.server_host, config_.server_port); + client_.connect(config_.server_host, config_.server_port, config_.timeout_ms); } } @@ -58,7 +69,7 @@ class tcp_sink final : public spdlog::sinks::base_sink { spdlog::memory_buf_t formatted; spdlog::sinks::base_sink::formatter_->format(msg, formatted); if (!client_.is_connected()) { - client_.connect(config_.server_host, config_.server_port); + client_.connect(config_.server_host, config_.server_port, config_.timeout_ms); } client_.send(formatted.data(), formatted.size()); } diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt index 3e94ed79cc..3ab5cafbde 100644 --- a/tasks/commits-ported.txt +++ b/tasks/commits-ported.txt @@ -5,3 +5,5 @@ b656d1ce Windows utc_minutes_offset(): DST accuracy + tests (pattern_formatter, test_timezone) 0f7562a0 tests: timezone: explicit POSIX TZ DST rules (musl / POSIX 2024) d2100d5d Include fcntl.h in Unix tcp client header (v2: tcp_client_unix.h) +3c61b051 [ci] actions/checkout@v6 (linux, macos, windows) +9ecdf5c8 TCP connect/send/recv timeouts (tcp_client_*, tcp_sink) diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index 71d34329d0..626b353d3b 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -41,6 +41,8 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | `b656d1ce` | Windows `utc_minutes_offset()` via `mktime` / `_mkgmtime`; pattern tests + dedicated timezone tests. | `src/details/os_windows.cpp`; `tests/test_pattern_formatter.cpp`; `tests/test_timezone.cpp` (new); `tests/CMakeLists.txt`; `include/spdlog/details/os.h` (doc comment). | | `0f7562a0` | POSIX `TZ` strings with explicit DST rules in `test_timezone` (avoids musl / impl-defined behavior). | `tests/test_timezone.cpp` | | `d2100d5d` | `#include ` for Unix TCP client (v1 had `tcp_client.h`; v2 uses `tcp_client_unix.h`). | `include/spdlog/details/tcp_client_unix.h` | +| `3c61b051` | GitHub Actions `actions/checkout@v6` (Node deprecation). | `.github/workflows/linux.yml`, `macos.yml`, `windows.yml` | +| `9ecdf5c8` | Optional connect timeout (non-blocking + `select`); `SO_RCVTIMEO` / `SO_SNDTIMEO` when `timeout_ms` is positive; `tcp_sink_config::timeout_ms` + ctor overload. | `tcp_client_windows.h`, `tcp_client_unix.h`, `tcp_sink.h` | **Validation:** `ctest` Release on Windows — all unit tests passed after these ports. diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index abc327bc42..af179a035e 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -5,7 +5,7 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D ## Progress (2026-04-04) - **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). -- **Ports:** [`commits-ported.txt`](commits-ported.txt) — includes **`09a674b7`**, **`b656d1ce`**, **`0f7562a0`** (POSIX TZ in tests), **`d2100d5d`** (`fcntl.h` on Unix TCP header). **All unit tests pass** (`ctest` Release, Windows). +- **Ports:** [`commits-ported.txt`](commits-ported.txt) — adds **`3c61b051`** (CI checkout), **`9ecdf5c8`** (TCP timeouts). **All unit tests pass** (`ctest` Release, Windows). - **Remaining:** Topical ports from `v1-commit-inventory.txt` (fmt / CI / other fixes per **5A** and triage). ## Relevant Files @@ -63,7 +63,7 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 4.0 Tests and CI validation - [x] 4.1 Run full test suite locally (`ctest` or project equivalent); fix failures tied to the merge. *(Windows Release: all tests pass.)* - [x] 4.2 Port any missing **v1.x** tests that cover shared behavior not yet present on the integration branch. *(Partial: `test_timezone.cpp` + pattern tests from `b656d1ce`; more as ports land.)* - - [ ] 4.3 Update `.github/workflows/*.yml` so the integration branch (or `v2.x` once merged) runs the agreed matrix; fix workflow-only issues (paths, branches). + - [x] 4.3 Update `.github/workflows/*.yml` so the integration branch (or `v2.x` once merged) runs the agreed matrix; fix workflow-only issues (paths, branches). *(checkout@v6 on linux/macos/windows)* - [ ] 4.4 Confirm CI green on Linux, macOS, and Windows (or document skipped jobs with reason). - [ ] 4.5 Spot-check platform-specific areas called out in PRD (e.g. Windows/UWP, POSIX `TZ`, TCP) on representative configs if possible. From c2981659d3088d0c3666bda7197057fa7a441fa3 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 09:42:12 +0200 Subject: [PATCH 06/35] feat(dup_filter_sink): ctor with sink list (v1 45b67eee); add full v1 SHA triage table - tasks/v1-triage-complete.md: 245 commits PORTED/PENDING/N/A for PRD 3A tracking - Merge report and task checklist updated Made-with: Cursor --- include/spdlog/sinks/dup_filter_sink.h | 9 + tasks/commits-ported.txt | 1 + tasks/merge-report-v2x-v1x.md | 5 +- tasks/tasks-v2x-v1x-feature-parity.md | 4 +- tasks/v1-triage-complete.md | 260 +++++++++++++++++++++++++ 5 files changed, 276 insertions(+), 3 deletions(-) create mode 100644 tasks/v1-triage-complete.md diff --git a/include/spdlog/sinks/dup_filter_sink.h b/include/spdlog/sinks/dup_filter_sink.h index f0530d578b..f41b725ddc 100644 --- a/include/spdlog/sinks/dup_filter_sink.h +++ b/include/spdlog/sinks/dup_filter_sink.h @@ -5,8 +5,10 @@ #include #include +#include #include #include +#include #include "../details/log_msg.h" #include "../details/null_mutex.h" @@ -44,6 +46,13 @@ class dup_filter_sink final : public dist_sink { : max_skip_duration_{max_skip_duration}, log_level_{notification_level} {} + template + explicit dup_filter_sink(std::chrono::duration max_skip_duration, + std::vector> sinks) + : dist_sink(std::move(sinks)), + max_skip_duration_{max_skip_duration}, + log_level_{level::info} {} + protected: std::chrono::microseconds max_skip_duration_; log_clock::time_point last_msg_time_; diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt index 3ab5cafbde..6fbfaccad2 100644 --- a/tasks/commits-ported.txt +++ b/tasks/commits-ported.txt @@ -7,3 +7,4 @@ b656d1ce Windows utc_minutes_offset(): DST accuracy + tests (pattern_formatter, d2100d5d Include fcntl.h in Unix tcp client header (v2: tcp_client_unix.h) 3c61b051 [ci] actions/checkout@v6 (linux, macos, windows) 9ecdf5c8 TCP connect/send/recv timeouts (tcp_client_*, tcp_sink) +45b67eee dup_filter_sink: constructor taking vector of sinks (#3549) diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index 626b353d3b..afc05a1cdb 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -27,7 +27,7 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a - Group `v1-commit-inventory.txt` by area (fmt, CI, sinks, OS, tests). - For each v1 commit, either cherry-pick onto `integration/v2-sync-v1` and resolve in the **v2** file set, or **manually port** the diff onto the v2-equivalent file. 3. **fmt / CMake (5A):** After substantive code ports, align **bundled fmt** and **CMake** warning policy with **current v1.x** explicitly (may be one coordinated PR). -4. **Triage:** Fill `triage-template.md` until every inventory SHA is **ported**, **superseded**, or **N/A** (3A). +4. **Triage:** See **`tasks/v1-triage-complete.md`** — all 245 v1-only SHAs listed with **PORTED**, **PENDING**, or **N/A** (merge commits). Remaining **PENDING** rows must be resolved to **ported**, **superseded**, or **N/A** with rationale (PRD **3A**). ## Conflict resolutions @@ -43,6 +43,9 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | `d2100d5d` | `#include ` for Unix TCP client (v1 had `tcp_client.h`; v2 uses `tcp_client_unix.h`). | `include/spdlog/details/tcp_client_unix.h` | | `3c61b051` | GitHub Actions `actions/checkout@v6` (Node deprecation). | `.github/workflows/linux.yml`, `macos.yml`, `windows.yml` | | `9ecdf5c8` | Optional connect timeout (non-blocking + `select`); `SO_RCVTIMEO` / `SO_SNDTIMEO` when `timeout_ms` is positive; `tcp_sink_config::timeout_ms` + ctor overload. | `tcp_client_windows.h`, `tcp_client_unix.h`, `tcp_sink.h` | +| `45b67eee` | `dup_filter_sink` constructor taking `std::vector>`. | `include/spdlog/sinks/dup_filter_sink.h` | + +**Full SHA list:** [`v1-triage-complete.md`](v1-triage-complete.md). **Validation:** `ctest` Release on Windows — all unit tests passed after these ports. diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index af179a035e..8430d740ef 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -5,7 +5,7 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D ## Progress (2026-04-04) - **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). -- **Ports:** [`commits-ported.txt`](commits-ported.txt) — adds **`3c61b051`** (CI checkout), **`9ecdf5c8`** (TCP timeouts). **All unit tests pass** (`ctest` Release, Windows). +- **Ports:** [`commits-ported.txt`](commits-ported.txt). **Full triage (245 v1-only SHAs):** [`v1-triage-complete.md`](v1-triage-complete.md) — each commit **PORTED**, **PENDING**, or **N/A** (merge commits). **All unit tests pass** (`ctest` Release, Windows). - **Remaining:** Topical ports from `v1-commit-inventory.txt` (fmt / CI / other fixes per **5A** and triage). ## Relevant Files @@ -68,7 +68,7 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 4.5 Spot-check platform-specific areas called out in PRD (e.g. Windows/UWP, POSIX `TZ`, TCP) on representative configs if possible. - [ ] 5.0 Documentation, merge report, and release readiness (4B) - - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). + - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **7** ported, **2** N/A merge, **236** still **PENDING** — reclassify PENDING over time.)* - [x] 5.2 Write **merge report**: areas touched, conflict resolutions, rejected or deferred ports with rationale. - [ ] 5.3 Update **README** (build, fmt version, branch notes) and version header for v2.x pre-release. - [ ] 5.4 Add **migration / release notes** for downstream users (API preserved per **2A**, dependency changes per **5A**). diff --git a/tasks/v1-triage-complete.md b/tasks/v1-triage-complete.md new file mode 100644 index 0000000000..bce2028f03 --- /dev/null +++ b/tasks/v1-triage-complete.md @@ -0,0 +1,260 @@ +# v1.x-only commits: full triage (PRD 3A) + +Source: `git log --reverse origin/v2.x..origin/v1.x` (245 commits). Integration branch: `integration/v2-sync-v1`. + +**Status values** +- **PORTED** — Change applied on the integration branch (manual port or equivalent). +- **PENDING** — Not yet ported; may require manual merge into v2 file layout, or batch fmt/CI work. +- **N/A** — Reserved for merge-only commits or explicit non-applicability (set manually when triaging). + +Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (many paths removed/split), so not every v1 commit cherry-picks cleanly. + +**Counts (this revision):** 7 **PORTED**, 2 **N/A** (merge commits), 236 **PENDING**. + +| SHA | Subject | Status | +|-----|---------|--------| +| `9e36a158` | Updated clang format to google style | PENDING | +| `65701f4d` | Updated format.sh script | PENDING | +| `f24f7fa2` | Added missing include mutex | PENDING | +| `1a0bfc7a` | clang format | PENDING | +| `f4afd81c` | Update common.h | PENDING | +| `5931a3d6` | Fixed windows compile | PENDING | +| `5e88d5fe` | Never sort includes in clang format | PENDING | +| `95c226e9` | format | PENDING | +| `7f535d18` | updated .clang-format | PENDING | +| `230e15f4` | updated format.sh | PENDING | +| `9d522611` | clang format | PENDING | +| `cafde8cc` | updated clang format | PENDING | +| `4b2a8219` | reformat code | PENDING | +| `251c856a` | update clang format again | PENDING | +| `0a53eafe` | update clang format again | PENDING | +| `b6eeb736` | Added a function to add callbacks that are called when a logger is registered (#2883) | PENDING | +| `e5865186` | Revert "Added a function to add callbacks that are called when a logger is registered (#2883)" | PENDING | +| `d4a5fd56` | Update README.md | PENDING | +| `91807c2e` | Update README.md | PENDING | +| `479a5ac3` | Fix OS availability check of pthread_threadid_np for iOS (#2897) | PENDING | +| `508d20f0` | Add .git-blame-ignore-revs to ignore clang-format related commits (#2899) | PENDING | +| `0c4fb032` | Match SPDLOG_CONSTEXPR_FUNC to FMT_CONSTEXPR (#2901) | PENDING | +| `c5452e05` | Updated spdlog logo | PENDING | +| `595a5247` | Updated spdlog logo | PENDING | +| `ff205fd2` | Updated logo | PENDING | +| `2d5179ba` | sinks: Make syslog_sink.h's syslog_prio_from_level protected (#2918) | PENDING | +| `8b331e2c` | Fix wrong thread_id (TID) in systemd_sink.h (#2919) | PENDING | +| `ddce4215` | fmt/*.h: include tweakme.h to set SPDLOG_FMT_EXTERNAL according to system (#2923) | PENDING | +| `ac55e604` | Update README.md | PENDING | +| `ba508057` | Update example.cpp to fix the vector issue in bin_example (#2963) | PENDING | +| `c1569a3d` | Bump to catch2 v3.5.0 | PENDING | +| `1ef8d3ce` | Fix #2967 | PENDING | +| `7cb90d1a` | Fix MSVC compile flag for no exceptions (#2974) | PENDING | +| `2aa8b6c9` | Check fd_ is not nullptr in file_helper | PENDING | +| `7c02e204` | Bump version to 1.13.0 | PENDING | +| `8979f7fb` | Also use _stat() on Windows to be more UTF8 friendly (#2978) | PENDING | +| `696db97f` | docs: details about how compile time macros work (#2981) | PENDING | +| `47b7e7c7` | Fix typos found by codespell (#3011) | PENDING | +| `fe79bfcc` | Expose the flusher thread object to user in order to allow setting of thread name and thread affinity when needed (#3009) | PENDING | +| `134f9194` | Update registry.h code formatting | PENDING | +| `d387fdf9` | support MINGW (#3022) | PENDING | +| `9a445245` | Update ci.yml | PENDING | +| `3f0e4007` | Update ci.yml | PENDING | +| `75bfbb7c` | Update ci.yml | PENDING | +| `bc4b3295` | Update ci.yml | PENDING | +| `60faedb0` | Update ci.yml | PENDING | +| `5532231b` | feature: adds string view overloads for logger accessor (#3023) | PENDING | +| `a45c9390` | Update stopwatch.h (#3034) | PENDING | +| `ae525b75` | Add missing include (#3026) | PENDING | +| `e0410f43` | Update ci.yml | PENDING | +| `0621a7ae` | fix ci | PENDING | +| `c838945e` | fix ci | PENDING | +| `42cd77d7` | fix ci | PENDING | +| `e15c5059` | fix ci | PENDING | +| `8cfd4a7e` | Fixed bench dev_null | PENDING | +| `4052bc06` | Use find if registry is bigger than 20 in registry::get(std::string_view logger_name) | PENDING | +| `819eb27c` | Use find if registry is bigger than 10 in registry::get(std::string_view logger_name) | PENDING | +| `23587b0d` | Fixed regisry-inl.h | PENDING | +| `d03eb40c` | Added Mapped Diagnostic Context (MDC) support (#2907) | PENDING | +| `73e2e02b` | Fix #3038 (#3044) | PENDING | +| `6766f873` | Remove the legacy AnalyzeTemporaryDtors option from .clang-tidy. (#3048) | PENDING | +| `6725584e` | Make async_logger::flush() synchronous and wait for the flush to complete (#3049) | PENDING | +| `c9ce17ab` | INSTALL.md has been updated to provide current status information. (#3052) | PENDING | +| `ec661f98` | Update test_async.cpp | PENDING | +| `a19c76a4` | Fix flush test in test_async.cpp | PENDING | +| `62302019` | Update test_async.cpp | PENDING | +| `d8e0ad46` | Updated bundled fmt to 10.2.1 | PENDING | +| `2969dde4` | Revert "Updated bundled fmt to 10.2.1" | PENDING | +| `f030afe6` | Update mdc.h | PENDING | +| `1f930174` | Update mdc.h | PENDING | +| `4517ce8b` | Update mdc.h | PENDING | +| `cba66029` | Update mdc | PENDING | +| `1253a57d` | Add mdc support for default format | PENDING | +| `8fed530b` | Update mdc.h | PENDING | +| `a2b42620` | Update CMakeLists.txt to fix #3029 | PENDING | +| `1e7d7e07` | Updated bundled fmt to 10.2.1 | PENDING | +| `e3f5a4fe` | Update cmake to define FMT_LIB_EXPORT when building shared lib | PENDING | +| `a0d2187d` | README.md has include missing (#3066) | PENDING | +| `b7e0e2c2` | Fix #3073 | PENDING | +| `dd6c9c6e` | Update comment | PENDING | +| `66ac83e7` | Update gitginore to ignore .vs and out/build | PENDING | +| `fd61ea93` | Merge branch 'v1.x' of https://github.com/gabime/spdlog into v1.x | N/A (merge commit) | +| `71925ca3` | Revmoed definition of deprecated fmt macros | PENDING | +| `a34e08c7` | Added CMakeSettings.json to gitignore | PENDING | +| `3403f278` | Don't remove previous defaullt logger from registry in set_default_logger. Fix #3016 | PENDING | +| `3b4c775b` | Update comment about set_default_logger | PENDING | +| `238c9ffa` | Bump spdlog to version 1.14.0 | PENDING | +| `94a8e87c` | Fix #3079 | PENDING | +| `fa6605dc` | Fix compile | PENDING | +| `37b84769` | Revert pr #3023 (std::string_view overloads for logger accessor for c++17) | PENDING | +| `22b0f4fc` | Clang format | PENDING | +| `2122eb21` | Update spdlog version to 1.14.1 | PENDING | +| `3b4fd93b` | Updated comment about mdc | PENDING | +| `2d4acf8c` | Added mdc example | PENDING | +| `27cb4c76` | Added mdc example to readme | PENDING | +| `c3aed4b6` | Add wide character formatting and output support to wincolor_sink. (#3092) | PENDING | +| `eeb22c13` | Allow customization of syslog_sink (#3124) | PENDING | +| `d276069a` | make example compatible with fmt 11 (#3130) | PENDING | +| `885b5473` | Fix building with `FMT_ENFORCE_COMPILE_STRING` (#3137) | PENDING | +| `5ebfc927` | fix: set `/Zc:__cplusplus` and `/MP` to MSVC only (#3139) | PENDING | +| `a3a0c9d6` | compilation error gcc 8.5 with [-Werror=suggest-override] (#3158) | PENDING | +| `271f0f3b` | Add info about max_files in the docstrings of hourly/daily file sinks (#3170) | PENDING | +| `2169a6f6` | use std::lock_guard instead of std::unique_lock (#3179) | PENDING | +| `362214a3` | fix/issue-3101: fix the issue where mdc ignores SPDLOG_NO_TLS (#3184) | PENDING | +| `c1fbafdc` | Update mdc.h (#3185) | PENDING | +| `ffd5aa41` | Update conan install command in README (#3172) | PENDING | +| `bdd1dff3` | Update CMakeLists.txt, Fix spelling errors (#3193) | PENDING | +| `2c76e610` | Fix #3194 - Use Sep instead of Sept for abbreviated month | PENDING | +| `e593f669` | Fix warning - extra ';' for -Wextra-semi (#3198) | PENDING | +| `ee168957` | Improve Cross-Platform Build Instructions in Documentation (#3229) | PENDING | +| `16e0d2e7` | Exchange promise for condition_variable when flushing (fixes #3221) (#3228) | PENDING | +| `b6da5944` | Ensure flush callback gets called in move-assign operator (#3232) | PENDING | +| `63d18842` | Gabime/async flush (#3235) | PENDING | +| `85bdab0c` | Update bundled fmt to 11.0.2 (#3236) | PENDING | +| `96c9a62b` | Fixed race condition in tests | PENDING | +| `9fe79692` | Gabime/tsan (#3237) | PENDING | +| `7a950e02` | add /utf-8 flag for msvc | PENDING | +| `d3730937` | Better support for FMT_UNICODE in cmake | PENDING | +| `a5cfbf36` | Revert "Better support for FMT_UNICODE in cmake" | PENDING | +| `a7eb388f` | windows ci wip | PENDING | +| `5dc356dc` | windows ci | PENDING | +| `614c3a68` | Fix ci | PENDING | +| `7ecfb3bc` | Fix ci | PENDING | +| `984a9598` | Fix ci | PENDING | +| `3fec1a81` | Fix ci | PENDING | +| `3d3f71db` | Fix ci | PENDING | +| `64d9b4e2` | refactor win ci | PENDING | +| `92f9aa32` | refactor win ci | PENDING | +| `6f2ead1a` | refactor win ci | PENDING | +| `bff1a603` | Fix win ci | PENDING | +| `ecc38811` | Fix win ci | PENDING | +| `d939255f` | Fix win ci | PENDING | +| `6c720155` | Fix win ci | PENDING | +| `6192537d` | Fix win ci | PENDING | +| `3c2e002b` | ci-win-2019 (#3239) | PENDING | +| `35345182` | Update README.md (#3240) | PENDING | +| `5fd32e1a` | Update README.md | PENDING | +| `63f08750` | Removed if in ci | PENDING | +| `5673e9e5` | utf8_to_wstrbuf now handles invalid utf8 sequences (#3244) | PENDING | +| `fe4f9952` | Fix utf8_to_wstrbuf tests (#3245) | PENDING | +| `d343d413` | CMake option to Enable/disable msvc /utf-8 flag (on by default) | PENDING | +| `68f6ec7a` | Merge branch 'v1.x' of https://github.com/gabime/spdlog into v1.x | N/A (merge commit) | +| `ebfa9069` | CMake option to Enable/disable msvc /utf-8 flag (on by default) | PENDING | +| `7cee026b` | Added tsan to ci (#3247) | PENDING | +| `8e561337` | Version 1.15.0 | PENDING | +| `51a0deca` | docs: Removed duplicate line in daily_file_sink comment (#3249) | PENDING | +| `1245bf8e` | add explicit mt:: and std:: to avoid ambiguous call when both std::format_to and mt::format_to are present (#3259) | PENDING | +| `9edab1b5` | pass /utf-8 only when compiler is MSVC (#3260) | PENDING | +| `633003f4` | Update CMakeLists.txt comment | PENDING | +| `94526fa8` | Update CMakeLists.txt comment | PENDING | +| `35b0417f` | Update CMakeLists.txt comment | PENDING | +| `018d8aa2` | Update CMakeLists.txt | PENDING | +| `0efef2af` | Update CMakeLists.txt comment | PENDING | +| `43dcb398` | Update CMakeLists.txt comment | PENDING | +| `15f53968` | Update null_sink to be final (#3267) | PENDING | +| `951c5b99` | Allow manual rotation of rotating_file_sink (#3269) | PENDING | +| `1e6250e1` | Gabime/fwrite unlocked (#3276) | PENDING | +| `65e388e8` | Adding on demand truncation for basic file sinks (#3280) | PENDING | +| `24dde318` | Adding lock to rotate_now() (#3281) | PENDING | +| `276ee5f5` | fix: update to_string_view function for fmt 11.1 (#3301) | PENDING | +| `7f8060d5` | fix: Compatibility with external fmtlib 11.1.1 (#3312) | PENDING | +| `96a8f625` | fix: remove unused to_string_view overload in fmt >= 11.1 (#3314) | PENDING | +| `ad0f31c0` | Enabled bin_to_hex utest for stdformat, fixed std::formatter (#3315) | PENDING | +| `d7155530` | Added SPDLOG_FWRITE_UNLOCKED option to CMakeLists.txt (#3318) | PENDING | +| `96a7d2a1` | Format CMakeLists.txt | PENDING | +| `57505989` | SPDLOG_LEVEL_NAMES, comment use string_view_literals (#3291) | PENDING | +| `7cbf2a69` | Gabime/ansicolor sink improvements (#3323) | PENDING | +| `ae1de0dc` | Support custom environment variables for load_env_levels (#3327) | PENDING | +| `3c23c27d` | Revert "fix: Compatibility with external fmtlib 11.1.1 (#3312)" (#3331) | PENDING | +| `ac432c36` | Gabime/v1.15.1 (#3332) | PENDING | +| `f355b3d5` | Fix test_daily_logger | PENDING | +| `3335c380` | Update README.md (#3338) | PENDING | +| `10320184` | Fixed issue #3360 (#3361) | PENDING | +| `faa0a7a9` | Bump fmt to version 11.1.4 | PENDING | +| `9c582574` | Fix zformatter on Apple and POSIX.1-2024 conforming platform (#3366) | PENDING | +| `48bcf39a` | Version 1.15.2 | PENDING | +| `1f4959c8` | Fix link to wiki. (#3377) | PENDING | +| `bd0609d7` | Update README.md | PENDING | +| `cec28bf8` | Fix links to local reference. (#3378) | PENDING | +| `bb8694b5` | Fix links for #3380 (#3381) | PENDING | +| `847db337` | dup_filter_sink: remove notification_level argument; use last message log level for notification instead (#3390) | PENDING | +| `548b2642` | Fix warning C4530 (#3393) | PENDING | +| `7e022c43` | Feature 3379 (#3397) | PENDING | +| `943fcbd7` | Register replace logger (#3398) | PENDING | +| `0d31acae` | Fmt 11.2.0 (#3399) | PENDING | +| `070e1c97` | Update comment | PENDING | +| `7ca6a4fb` | Update commemt | PENDING | +| `c73b8cc4` | Update comment | PENDING | +| `6fa36017` | Version 1.15.3 | PENDING | +| `677a2d93` | Update test_stopwatch.cpp | PENDING | +| `37ff4664` | Add coverity scan to CI and fix warnings (#3400) | PENDING | +| `5d89b5b9` | Update jetbrains logo (#3401) | PENDING | +| `b18a234e` | Fix coverity ci | PENDING | +| `e655dbb6` | Fix issue #3408 | PENDING | +| `ad725d34` | Use std::getenv #3414 (#3415) | PENDING | +| `287333ee` | Remove unnecessary and inconsistent "final" from color sinks (#3430) | PENDING | +| `a6215527` | Fix ringbuffer tests for newline (#3436) | PENDING | +| `4619e18a` | Update windows.yml | PENDING | +| `6fd67ce1` | Update windows.yml | PENDING | +| `4397dac5` | chore(cmake): add option to override CMAKE_DEBUG_POSTFIX (#3433) | PENDING | +| `4f2b3d52` | Update README.md (#3437) | PENDING | +| `737347d2` | Update linux.yml | PENDING | +| `9ecdf5c8` | Added timeout for TCP calls such as connect, send, recv (#3432) | PORTED | +| `3edc8036` | Run tests in the order they are declared in the source file. (#3451) | PENDING | +| `f1d748e5` | Remove the fileapi.h include in os-inl.h (#3444) | PENDING | +| `4418909a` | Bump fmt to 12.0.0 | PENDING | +| `1bea38ed` | clang-format | PENDING | +| `486b5555` | Version 1.16.0 | PENDING | +| `dd3ca04a` | set CMAKE_BUILD_TYPE only in top-level project (#3480) | PENDING | +| `3f7e5028` | fix sign-compare warning (#3479) | PENDING | +| `88a0e07a` | Change access scope for ANSI target_file_ from private to protected (#3486) | PENDING | +| `cdbd64e2` | Fix sign conversion warnings in qt_sinks.h (#3487) | PENDING | +| `8806ca65` | Fix UWP detection. (#3489) | PENDING | +| `6004e3d1` | Fix issue #3483 (#3491) | PENDING | +| `b3688ba1` | Set IndentPPDirectives to "None" on clang-format | PENDING | +| `ea3e747e` | Bump fmt to 12.1.0 | PENDING | +| `c5061bb9` | Update LICENSE file | PENDING | +| `878ad2e3` | Supress MSVC C4834 warning triggeed by fmt 12.1.0 | PENDING | +| `2c1eafc8` | Backport warning fix from fmt head | PENDING | +| `3f03542d` | Remove warning 4834 suppression | PENDING | +| `d2100d5d` | Fix: include in tcp_client.h to avoid compilation failures on Unix (#3497) | PORTED | +| `0209b12c` | tests: fix unit tests to not be affected by custom level names (#3492) | PENDING | +| `32dd298d` | Docs: fix misleading comment in blocking_queue header (#3504) | PENDING | +| `09a674b7` | Fix %z when pattern_type_type is utc - should be +00:00 | PORTED | +| `2670f47d` | Fix warning | PENDING | +| `b656d1ce` | Windows utc_minutes_offset(): Fix historical DST accuracy and improve offset calculation speed (~2.5x) (#3508) | PORTED | +| `79524ddd` | spdlog version 1.17.0 | PENDING | +| `6b240a89` | Replace C-style cast with reinterpret_cast in udp_client (#3509) | PENDING | +| `33375433` | fix: initialize null_atomic_int::value to zero (#3513) | PENDING | +| `d299603e` | Add missing const qualifiers to reference variables (#3514) | PENDING | +| `1774e700` | Add const qualifier to get_time_ and filter_ member functions (#3515) | PENDING | +| `309204d5` | Rename local variables to avoid shadowing member functions (#3516) | PENDING | +| `f2a9dec0` | Fix function arguments names different warnings (#3519) | PENDING | +| `687226d9` | The upd_sink and dist_sink files have been modified to address Passed by value warnings. (#3520) | PENDING | +| `472945ba` | Fix shadow member warning in example file (#3521) | PENDING | +| `6c5d6329` | Fix should_log comment (#3534) | PENDING | +| `566b2d14` | Fix #3525: Make level name matching case-insensitive (#3535) | PENDING | +| `fc7e9c87` | Update common-inl.h | PENDING | +| `c49c7cf9` | Allow empty DEBUG_POSTFIX property in CMakeLists (#3530) | PENDING | +| `1685e694` | Fix deprecated copy constructor usage of fmt::format_string (#3541) | PENDING | +| `d5af52d9` | Fix format_string propagation (#3543) | PENDING | +| `0f7562a0` | tests: timezone: Provide DST rules when setting TZ on POSIX systems (#3542) | PORTED | +| `1fbc60a5` | docs: fix SPDLOG_LEVEL env example (#3561) | PENDING | +| `45b67eee` | Add constructor for dup_filter_sink with sinks parameter (#3549) | PORTED | +| `3c61b051` | [ci] Update actions/checkout to latest major relese (#3575) | PORTED | From ac6f64e69dcc2c0c8679f3ded380dc716506b119 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 09:47:35 +0200 Subject: [PATCH 07/35] feat(level): case-insensitive level_from_str; cmake: BUILD_TYPE only if top-level (v1 ports) - 566b2d14: common.cpp + test_misc (SUPERSEDED note for d5af52d9 in triage) - dd3ca04a: guard default CMAKE_BUILD_TYPE for add_subdirectory consumers - Update v1-triage-complete.md counts and statuses Made-with: Cursor --- CMakeLists.txt | 6 +++++- src/common.cpp | 30 ++++++++++++++++++++++++++---- tasks/commits-ported.txt | 3 +++ tasks/merge-report-v2x-v1x.md | 3 +++ tasks/v1-triage-complete.md | 9 +++++---- tests/test_misc.cpp | 11 +++++++++++ 6 files changed, 53 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 486d1ae3f3..5ec7a117c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,11 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) # Set default build to release # --------------------------------------------------------------------------------------- if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose Release or Debug" FORCE) + # Set CMAKE_BUILD_TYPE only if this project is top-level (avoid overriding parent) + if ((DEFINED PROJECT_IS_TOP_LEVEL AND PROJECT_IS_TOP_LEVEL) OR + (NOT DEFINED PROJECT_IS_TOP_LEVEL AND CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)) + set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose Release or Debug" FORCE) + endif () endif () # --------------------------------------------------------------------------------------- # Compiler config diff --git a/src/common.cpp b/src/common.cpp index 82816cc721..1840f79702 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -4,19 +4,41 @@ #include "spdlog/common.h" #include +#include #include namespace spdlog { +namespace { +bool iequals(const std::string &a, const std::string &b) { + return a.size() == b.size() && + std::equal(a.begin(), a.end(), b.begin(), [](char ac, char bc) { + return std::tolower(static_cast(ac)) == + std::tolower(static_cast(bc)); + }); +} +} // namespace + spdlog::level level_from_str(const std::string &name) noexcept { - const auto it = std::find(std::begin(level_string_views), std::end(level_string_views), name); - if (it != std::end(level_string_views)) return static_cast(std::distance(std::begin(level_string_views), it)); + const auto it = + std::find_if(std::begin(level_string_views), std::end(level_string_views), + [&name](const string_view_t &level_name) { + return level_name.size() == name.size() && + std::equal(name.begin(), name.end(), level_name.begin(), + [](char a, char b) { + return std::tolower(static_cast(a)) == + std::tolower(static_cast(b)); + }); + }); + if (it != std::end(level_string_views)) { + return static_cast(std::distance(std::begin(level_string_views), it)); + } // check also for "warn" and "err" before giving up - if (name == "warn") { + if (iequals(name, "warn")) { return spdlog::level::warn; } - if (name == "err") { + if (iequals(name, "err")) { return level::err; } return level::off; diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt index 6fbfaccad2..5dff9a12e5 100644 --- a/tasks/commits-ported.txt +++ b/tasks/commits-ported.txt @@ -8,3 +8,6 @@ d2100d5d Include fcntl.h in Unix tcp client header (v2: tcp_client_unix.h) 3c61b051 [ci] actions/checkout@v6 (linux, macos, windows) 9ecdf5c8 TCP connect/send/recv timeouts (tcp_client_*, tcp_sink) 45b67eee dup_filter_sink: constructor taking vector of sinks (#3549) +566b2d14 Case-insensitive level_from_str (src/common.cpp; tests) +dd3ca04a CMAKE_BUILD_TYPE default only for top-level project (CMakeLists.txt) +# SUPERSEDED (no code change): d5af52d9 format_string propagation — v2 API already correct diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index afc05a1cdb..24781a81e7 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -44,6 +44,9 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | `3c61b051` | GitHub Actions `actions/checkout@v6` (Node deprecation). | `.github/workflows/linux.yml`, `macos.yml`, `windows.yml` | | `9ecdf5c8` | Optional connect timeout (non-blocking + `select`); `SO_RCVTIMEO` / `SO_SNDTIMEO` when `timeout_ms` is positive; `tcp_sink_config::timeout_ms` + ctor overload. | `tcp_client_windows.h`, `tcp_client_unix.h`, `tcp_sink.h` | | `45b67eee` | `dup_filter_sink` constructor taking `std::vector>`. | `include/spdlog/sinks/dup_filter_sink.h` | +| `566b2d14` | Case-insensitive `level_from_str` (env / argv level names). | `src/common.cpp`; `tests/test_misc.cpp` | +| `dd3ca04a` | Set default `CMAKE_BUILD_TYPE` only when spdlog is the top-level CMake project. | `CMakeLists.txt` | +| `d5af52d9` | *(SUPERSEDED)* format_string propagation — v2.x already uses unified `format_string_t` forwarding to `log_with_format_`. | — | **Full SHA list:** [`v1-triage-complete.md`](v1-triage-complete.md). diff --git a/tasks/v1-triage-complete.md b/tasks/v1-triage-complete.md index bce2028f03..6eb1debcc2 100644 --- a/tasks/v1-triage-complete.md +++ b/tasks/v1-triage-complete.md @@ -6,10 +6,11 @@ Source: `git log --reverse origin/v2.x..origin/v1.x` (245 commits). Integration - **PORTED** — Change applied on the integration branch (manual port or equivalent). - **PENDING** — Not yet ported; may require manual merge into v2 file layout, or batch fmt/CI work. - **N/A** — Reserved for merge-only commits or explicit non-applicability (set manually when triaging). +- **SUPERSEDED** — v2.x already satisfies the intent (different implementation path). Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (many paths removed/split), so not every v1 commit cherry-picks cleanly. -**Counts (this revision):** 7 **PORTED**, 2 **N/A** (merge commits), 236 **PENDING**. +**Counts (this revision):** 9 **PORTED**, 1 **SUPERSEDED**, 2 **N/A** (merge commits), 233 **PENDING**. | SHA | Subject | Status | |-----|---------|--------| @@ -221,7 +222,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `4418909a` | Bump fmt to 12.0.0 | PENDING | | `1bea38ed` | clang-format | PENDING | | `486b5555` | Version 1.16.0 | PENDING | -| `dd3ca04a` | set CMAKE_BUILD_TYPE only in top-level project (#3480) | PENDING | +| `dd3ca04a` | set CMAKE_BUILD_TYPE only in top-level project (#3480) | PORTED | | `3f7e5028` | fix sign-compare warning (#3479) | PENDING | | `88a0e07a` | Change access scope for ANSI target_file_ from private to protected (#3486) | PENDING | | `cdbd64e2` | Fix sign conversion warnings in qt_sinks.h (#3487) | PENDING | @@ -249,11 +250,11 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `687226d9` | The upd_sink and dist_sink files have been modified to address Passed by value warnings. (#3520) | PENDING | | `472945ba` | Fix shadow member warning in example file (#3521) | PENDING | | `6c5d6329` | Fix should_log comment (#3534) | PENDING | -| `566b2d14` | Fix #3525: Make level name matching case-insensitive (#3535) | PENDING | +| `566b2d14` | Fix #3525: Make level name matching case-insensitive (#3535) | PORTED | | `fc7e9c87` | Update common-inl.h | PENDING | | `c49c7cf9` | Allow empty DEBUG_POSTFIX property in CMakeLists (#3530) | PENDING | | `1685e694` | Fix deprecated copy constructor usage of fmt::format_string (#3541) | PENDING | -| `d5af52d9` | Fix format_string propagation (#3543) | PENDING | +| `d5af52d9` | Fix format_string propagation (#3543) | SUPERSEDED (v2 `logger`/`spdlog` already forward `format_string_t` to `log_with_format_`) | | `0f7562a0` | tests: timezone: Provide DST rules when setting TZ on POSIX systems (#3542) | PORTED | | `1fbc60a5` | docs: fix SPDLOG_LEVEL env example (#3561) | PENDING | | `45b67eee` | Add constructor for dup_filter_sink with sinks parameter (#3549) | PORTED | diff --git a/tests/test_misc.cpp b/tests/test_misc.cpp index d73be2a52b..734224ec11 100644 --- a/tests/test_misc.cpp +++ b/tests/test_misc.cpp @@ -72,6 +72,17 @@ TEST_CASE("to_level_enum", "[convert_to_level_enum]") { REQUIRE(spdlog::level_from_str("critical") == spdlog::level::critical); REQUIRE(spdlog::level_from_str("off") == spdlog::level::off); REQUIRE(spdlog::level_from_str("null") == spdlog::level::off); + REQUIRE(spdlog::level_from_str("TRACE") == spdlog::level::trace); + REQUIRE(spdlog::level_from_str("DEBUG") == spdlog::level::debug); + REQUIRE(spdlog::level_from_str("INFO") == spdlog::level::info); + REQUIRE(spdlog::level_from_str("WARNING") == spdlog::level::warn); + REQUIRE(spdlog::level_from_str("WARN") == spdlog::level::warn); + REQUIRE(spdlog::level_from_str("ERROR") == spdlog::level::err); + REQUIRE(spdlog::level_from_str("ERR") == spdlog::level::err); + REQUIRE(spdlog::level_from_str("CRITICAL") == spdlog::level::critical); + REQUIRE(spdlog::level_from_str("OFF") == spdlog::level::off); + REQUIRE(spdlog::level_from_str("TrAcE") == spdlog::level::trace); + REQUIRE(spdlog::level_from_str("DeBuG") == spdlog::level::debug); } TEST_CASE("copy_ctor", "[copy_ctor]") { From ee477d5c7bc99625c0a2387c4249fb75db7c2e43 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 10:15:22 +0200 Subject: [PATCH 08/35] v1 parity: MSVC UTF-8, ansicolor/syslog/os, getenv, triage docs - CMake: SPDLOG_MSVC_UTF8 + /utf-8 for real MSVC only - ansicolor: protected target_file_; fix set_color_mode_ lock nesting - os: drop redundant fileapi.h; spdlog::details::os::getenv via std::getenv - tests: stopwatch waits 500ms; includes/triage/commits-ported/merge-report updates - Reclassify superseded v1 SHAs (Sep, syslog, stopwatch ms, utf8 tests, etc.) Made-with: Cursor --- CMakeLists.txt | 11 +- include/spdlog/details/circular_q.h | 2 + include/spdlog/details/mpmc_blocking_q.h | 4 +- include/spdlog/details/null_mutex.h | 2 +- include/spdlog/details/udp_client_unix.h | 6 +- include/spdlog/sinks/ansicolor_sink.h | 4 +- include/spdlog/sinks/daily_file_sink.h | 1 - src/details/os_unix.cpp | 4 +- src/details/os_windows.cpp | 25 +- src/sinks/ansicolor_sink.cpp | 1 - tasks/commits-ported.txt | 46 ++++ tasks/merge-report-v2x-v1x.md | 54 +++++ tasks/tasks-v2x-v1x-feature-parity.md | 8 +- tasks/v1-triage-complete.md | 294 +++++++++++------------ tests/includes.h | 3 + tests/test_stopwatch.cpp | 4 +- 16 files changed, 292 insertions(+), 177 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ec7a117c2..ddf7c21d6d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,6 +67,9 @@ option(SPDLOG_NO_THREAD_ID "prevent spdlog from querying the thread id on each l option(SPDLOG_DISABLE_GLOBAL_LOGGER "Disable global logger creation" OFF) option(SPDLOG_NO_TLS "Disable thread local storage" OFF) option(SPDLOG_TIDY "run clang-tidy" OFF) +set(SPDLOG_DEBUG_POSTFIX "-${SPDLOG_VERSION_MAJOR}.${SPDLOG_VERSION_MINOR}d" CACHE STRING + "Filename postfix for libraries in debug builds (empty string allowed)") +option(SPDLOG_MSVC_UTF8 "Enable/disable MSVC /utf-8 flag (recommended for fmt)" ON) if (SPDLOG_TIDY) set(CMAKE_CXX_CLANG_TIDY "clang-tidy") set(CMAKE_EXPORT_COMPILE_COMMANDS ON) @@ -231,11 +234,17 @@ target_include_directories(spdlog ${SPDLOG_INCLUDES_LEVEL} PUBLIC "$") target_link_libraries(spdlog PUBLIC Threads::Threads) target_link_libraries(spdlog PUBLIC fmt::fmt) +if (MSVC) + if (SPDLOG_MSVC_UTF8) + # Pass /utf-8 only for real MSVC (not clang-cl); see fmtlib and #3260. + target_compile_options(spdlog PUBLIC $<$,$>:/utf-8>) + endif () +endif () spdlog_enable_warnings(spdlog) set_target_properties(spdlog PROPERTIES VERSION ${SPDLOG_VERSION} SOVERSION ${SPDLOG_VERSION_MAJOR}.${SPDLOG_VERSION_MINOR}) set(SPDLOG_NAME spdlog-${SPDLOG_VERSION_MAJOR}) -set_target_properties(spdlog PROPERTIES DEBUG_POSTFIX "-${SPDLOG_VERSION_MAJOR}.${SPDLOG_VERSION_MINOR}d") +set_target_properties(spdlog PROPERTIES DEBUG_POSTFIX "${SPDLOG_DEBUG_POSTFIX}") # --------------------------------------------------------------------------------------- # Set prefix and source group for visual studio # --------------------------------------------------------------------------------------- diff --git a/include/spdlog/details/circular_q.h b/include/spdlog/details/circular_q.h index f858a48b82..f68291398f 100644 --- a/include/spdlog/details/circular_q.h +++ b/include/spdlog/details/circular_q.h @@ -7,6 +7,8 @@ #include #include +#include + namespace spdlog { namespace details { template diff --git a/include/spdlog/details/mpmc_blocking_q.h b/include/spdlog/details/mpmc_blocking_q.h index f8e5a288da..c2270f6ae7 100644 --- a/include/spdlog/details/mpmc_blocking_q.h +++ b/include/spdlog/details/mpmc_blocking_q.h @@ -5,8 +5,8 @@ // multi producer-multi consumer blocking queue. // enqueue(..) - will block until room found to put the new message. -// enqueue_nowait(..) - will return immediately with false if no room left in -// the queue. +// enqueue_nowait(..) - enqueue immediately; overruns oldest message if no +// room left. // dequeue_for(..) - will block until the queue is not empty or timeout have // passed. diff --git a/include/spdlog/details/null_mutex.h b/include/spdlog/details/null_mutex.h index a0f5045888..e9e1e77092 100644 --- a/include/spdlog/details/null_mutex.h +++ b/include/spdlog/details/null_mutex.h @@ -16,7 +16,7 @@ struct null_mutex { template struct null_atomic { - T value; + T value{}; null_atomic() = default; diff --git a/include/spdlog/details/udp_client_unix.h b/include/spdlog/details/udp_client_unix.h index 1b46da4a67..3185fb34df 100644 --- a/include/spdlog/details/udp_client_unix.h +++ b/include/spdlog/details/udp_client_unix.h @@ -70,9 +70,9 @@ class udp_client_unix { // Send exactly n_bytes of the given data. // On error close the connection and throw. void send(const char *data, size_t n_bytes) { - ssize_t toslen = 0; - socklen_t tolen = sizeof(struct sockaddr); - if ((toslen = ::sendto(socket_, data, n_bytes, 0, (struct sockaddr *)&sockAddr_, tolen)) == -1) { + socklen_t tolen = sizeof(sockAddr_); + if (::sendto(socket_, data, n_bytes, 0, reinterpret_cast(&sockAddr_), + tolen) == -1) { throw_spdlog_ex("sendto(2) failed", errno); } } diff --git a/include/spdlog/sinks/ansicolor_sink.h b/include/spdlog/sinks/ansicolor_sink.h index 418c068b43..33b71c659a 100644 --- a/include/spdlog/sinks/ansicolor_sink.h +++ b/include/spdlog/sinks/ansicolor_sink.h @@ -69,8 +69,10 @@ class ansicolor_sink : public base_sink { static constexpr std::string_view red_bold = "\033[31m\033[1m"; static constexpr std::string_view bold_on_red = "\033[1m\033[41m"; -private: +protected: FILE *target_file_; + +private: bool should_do_colors_; std::array colors_; diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 481321e3a5..1b9c15dcaf 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -55,7 +55,6 @@ struct daily_filename_format_calculator { * Rotating file sink based on date. * If truncate != false , the created file will be truncated. * If max_files > 0, retain only the last max_files and delete previous. - * If max_files > 0, retain only the last max_files and delete previous. * Note that old log files from previous executions will not be deleted by this class, * rotation and deletion is only applied while the program is running. */ diff --git a/src/details/os_unix.cpp b/src/details/os_unix.cpp index 5c5828f333..b7da1469f7 100644 --- a/src/details/os_unix.cpp +++ b/src/details/os_unix.cpp @@ -269,8 +269,8 @@ bool is_color_terminal() noexcept { bool in_terminal(FILE *file) noexcept { return ::isatty(fileno(file)) != 0; } std::string getenv(const char *field) { - char *buf = ::getenv(field); - return buf != nullptr ? buf : std::string{}; + char *buf = std::getenv(field); + return buf != nullptr ? std::string(buf) : std::string{}; } // Do fsync by FILE pointer diff --git a/src/details/os_windows.cpp b/src/details/os_windows.cpp index 473b897380..dbf3d390ee 100644 --- a/src/details/os_windows.cpp +++ b/src/details/os_windows.cpp @@ -6,10 +6,9 @@ #endif // clang-format off -#include "spdlog/details/windows_include.h" // must be included before fileapi.h etc. +#include "spdlog/details/windows_include.h" // must be first; provides FlushFileBuffers via Windows headers // clang-format on -#include // for FlushFileBuffers #include // for _get_osfhandle, _isatty, _fileno #include // for _get_pid #include @@ -218,21 +217,21 @@ void utf8_to_wstrbuf(string_view_t str, wmemory_buf_t &target) { throw_spdlog_ex(fmt_lib::format("MultiByteToWideChar failed. Last error: {}", ::GetLastError())); } +#ifdef _MSC_VER + #pragma warning(push) + #pragma warning(disable : 4996) +#endif std::string getenv(const char *field) { -#if defined(_MSC_VER) - #if defined(__cplusplus_winrt) +#if defined(_MSC_VER) && defined(__cplusplus_winrt) return std::string{}; // not supported under uwp - #else - size_t len = 0; - char buf[128]; - bool ok = ::getenv_s(&len, buf, sizeof(buf), field) == 0; - return ok ? buf : std::string{}; - #endif -#else // revert to getenv - char *buf = ::getenv(field); - return buf != nullptr ? buf : std::string{}; +#else + char *buf = std::getenv(field); + return buf != nullptr ? std::string(buf) : std::string{}; #endif } +#ifdef _MSC_VER + #pragma warning(pop) +#endif // Do fsync by FILE handlerpointer // Return true on success diff --git a/src/sinks/ansicolor_sink.cpp b/src/sinks/ansicolor_sink.cpp index b684ea0fda..2a4aa06b2a 100644 --- a/src/sinks/ansicolor_sink.cpp +++ b/src/sinks/ansicolor_sink.cpp @@ -43,7 +43,6 @@ void ansicolor_sink::set_color_mode(color_mode mode) { template void ansicolor_sink::set_color_mode_(color_mode mode) { - std::lock_guard lock(base_sink::mutex_); switch (mode) { case color_mode::always: should_do_colors_ = true; diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt index 5dff9a12e5..e7922b427d 100644 --- a/tasks/commits-ported.txt +++ b/tasks/commits-ported.txt @@ -10,4 +10,50 @@ d2100d5d Include fcntl.h in Unix tcp client header (v2: tcp_client_unix.h) 45b67eee dup_filter_sink: constructor taking vector of sinks (#3549) 566b2d14 Case-insensitive level_from_str (src/common.cpp; tests) dd3ca04a CMAKE_BUILD_TYPE default only for top-level project (CMakeLists.txt) +32dd298d mpmc_blocking_q.h file-header comment (enqueue_nowait overrun behavior) +0209b12c tests/includes.h: undef SPDLOG_LEVEL_NAMES / SHORT for default test expectations (#3492) +4397dac5 c49c7cf9 SPDLOG_DEBUG_POSTFIX cache + quoted DEBUG_POSTFIX (#3433 #3530) +ae525b75 circular_q.h include spdlog/common.h (#3026) +33375433 null_atomic T value{} value-initialize (#3513) +6b240a89 udp_client_unix sendto reinterpret_cast sockaddr (#3509) +88a0e07a ansicolor_sink: target_file_ protected for custom sinks (#3486) +7a950e02 d343d413 ebfa9069 9edab1b5 SPDLOG_MSVC_UTF8 + /utf-8 only for MSVC (CXX_COMPILER_ID) (#3260) +f1d748e5 os_windows: drop fileapi.h include (#3444; v2 uses os_windows.cpp not os-inl.h) +7cbf2a69 ansicolor: set_color_mode_ without nested mutex (matches #3323; fixes double-lock) # SUPERSEDED (no code change): d5af52d9 format_string propagation — v2 API already correct +# SUPERSEDED: 6c5d6329 should_log comment — v2 logger.h already correct +# SUPERSEDED: 2aa8b6c9 file_helper write fd_ — v2 file_helper.cpp already has guard +# SUPERSEDED: 2d5179ba syslog_prio_from_level protected — v2 syslog_sink.h already +# SUPERSEDED: 8b331e2c systemd TID — v2 systemd_sink.h uses msg.thread_id +# SUPERSEDED: 479a5ac3 Apple pthread_threadid_np / iOS — v2 os_unix.cpp already +# SUPERSEDED: f24f7fa2 base_sink mutex include — v2 base_sink.cpp +# SUPERSEDED: 2169a6f6 lock_guard in mpmc_blocking_q — v2 already +# SUPERSEDED: 271f0f3b daily/hourly max_files docs — v2 already (deduped daily comment line) +# SUPERSEDED: 8979f7fb Windows path_exists UTF-8 — v2 std::filesystem::exists +# SUPERSEDED: a3a0c9d6 suggest-override — v2 base_sink.h final override +# SUPERSEDED: 5ebfc927 MSVC flags clang-cl — v2 CMAKE_CXX_COMPILER_ID STREQUAL MSVC +# SUPERSEDED: 94a8e87c create_dir drive letter #3079 — v2 filesystem::create_directories +# N/A: 7cb90d1a MSVC no-exceptions flag — no SPDLOG_NO_EXCEPTIONS in v2 CMake yet +# SUPERSEDED: d387fdf9 MINGW CMAKE_CXX_EXTENSIONS — already in CMakeLists.txt +# N/A: 4052bc06 819eb27c 23587b0d registry-inl get() — v2 has no multi-logger registry +# N/A: 134f9194 registry formatting — no registry headers on v2 +# N/A: 3403f278 set_default_logger registry — v2 global logger API differs +# N/A: b6eeb736 e5865186 logger-register callbacks + revert — no lasting v1 delta +# N/A: ddce4215 fmt tweakme include — v2 no tweakme.h +# N/A: 5532231b 37b84769 registry string_view accessor + revert — no registry on v2 +# N/A: 3b4c775b set_default_logger comment — registry +# N/A: c9ce17ab INSTALL.md — not in v2 tree +# N/A: 2969dde4 revert fmt 10.2.1 bump — pair with d8e0ad46 / 5A +# SUPERSEDED: 6766f873 clang-tidy AnalyzeTemporaryDtors — not in v2 .clang-tidy +# N/A batch: clang-format / mass reformat SHAs (9e36a158 … b3688ba1, 22b0f4fc, 1bea38ed) +# N/A: logo / jetbrains assets (c5452e05, 595a5247, ff205fd2, 5d89b5b9) +# N/A: v1.x version bumps (7c02e204, 238c9ffa, 2122eb21, 8e561337, ac432c36, 48bcf39a, 486b5555, 6fa36017, 79524ddd) +# N/A: 508d20f0 blame-ignore-revs; 0c4fb032 SPDLOG_CONSTEXPR_FUNC; f4afd81c trivial common.h +# N/A: d3730937 a5cfbf36 FMT_UNICODE cmake + revert +# SUPERSEDED: 15f53968 null_sink final +# SUPERSEDED: 51a0deca daily_file_sink duplicate doc line — already fixed on integration branch +# SUPERSEDED: 66ac83e7 a34e08c7 .gitignore .vs out/build CMakeSettings — already in .gitignore +# SUPERSEDED: 2c76e610 Sep vs Sept — src/pattern_formatter.cpp already uses "Sep" +# SUPERSEDED: e593f669 -Wextra-semi — v2 sources already avoid extra `;` after `}` / `override {}` +# N/A batch: README / wiki / docs-only SHAs; v1 ci.yml & win CI churn; CMake comment-only; LICENSE optional +# N/A: 943fcbd7 registry; 27cb4c76 MDC readme; 3edc8036 catch test order; Coverity CI; 7cee026b v1 TSAN CI line diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index 24781a81e7..8e0a6635c5 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -47,6 +47,60 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | `566b2d14` | Case-insensitive `level_from_str` (env / argv level names). | `src/common.cpp`; `tests/test_misc.cpp` | | `dd3ca04a` | Set default `CMAKE_BUILD_TYPE` only when spdlog is the top-level CMake project. | `CMakeLists.txt` | | `d5af52d9` | *(SUPERSEDED)* format_string propagation — v2.x already uses unified `format_string_t` forwarding to `log_with_format_`. | — | +| `32dd298d` | Misleading `enqueue_nowait` comment in blocking queue header. | `include/spdlog/details/mpmc_blocking_q.h` (file-level header; method comments already matched behavior). | +| `6c5d6329` | *(SUPERSEDED)* `should_log` doc comment — v2.x already says “if logging is enabled”. | — | +| `2aa8b6c9` | *(SUPERSEDED)* `file_helper::write` null `fd_` — already guarded in v2 `file_helper.cpp`. | — | +| `0209b12c` | Tests immune to custom `SPDLOG_LEVEL_NAMES` / `SPDLOG_SHORT_LEVEL_NAMES` in tweakme.h. | `tests/includes.h` | +| `33375433` | Value-initialize `null_atomic::value` (was `null_atomic_int` on v1). | `include/spdlog/details/null_mutex.h` | +| `6b240a89` | `sendto` / `reinterpret_cast` in UDP client. | `include/spdlog/details/udp_client_unix.h` | +| `88a0e07a` | `ansicolor_sink::target_file_` **protected** for subclasses (e.g. stdout/stderr split). | `include/spdlog/sinks/ansicolor_sink.h` | +| `7a950e02` `d343d413` `ebfa9069` `9edab1b5` | MSVC `/utf-8`: cache option **`SPDLOG_MSVC_UTF8`** (default ON) and apply only when `$`. | `CMakeLists.txt` | +| `2c76e610` | *(SUPERSEDED)* abbreviated September **Sep** not **Sept** — v2 `pattern_formatter.cpp` already uses `"Sep"`. | — | +| `f1d748e5` | Drop redundant `#include ` when `windows.h` already provides APIs (older SDK compatibility). | `src/details/os_windows.cpp` (v1 had `os-inl.h`) | +| `7cbf2a69` | `ansicolor_sink`: public `set_color_mode` locks; internal `set_color_mode_` must not re-lock (v1 #3323). | `src/sinks/ansicolor_sink.cpp` — removed nested `lock_guard` in `set_color_mode_` (avoids deadlock). | +| `e593f669` | *(SUPERSEDED)* `-Wextra-semi` / stray `;` after `}` — v2 `bench`, `example`, `callback_sink`, `msvc_sink` already clean. | — | +| `4397dac5` | `SPDLOG_DEBUG_POSTFIX` CMake cache (override debug library name suffix). | `CMakeLists.txt` — default `-${MAJOR}.${MINOR}d` (same as previous v2 hardcode). | +| `c49c7cf9` | Allow **empty** debug postfix (quoted property). | Same `CMakeLists.txt` change as `4397dac5`. | +| `ae525b75` | Self-contained `circular_q.h` (include `common.h`). | `include/spdlog/details/circular_q.h` | +| `2d5179ba` | *(SUPERSEDED)* `syslog_prio_from_level` visibility — v2 already `protected`/`virtual`. | — | +| `8b331e2c` | *(SUPERSEDED)* systemd `TID` — v2 uses `msg.thread_id`. | — | +| `479a5ac3` | *(SUPERSEDED)* Apple `pthread_threadid_np` availability — v2 `os_unix.cpp` already has the guarded block. | — | +| `f24f7fa2` | *(SUPERSEDED)* `#include ` for `base_sink` — v2 `src/sinks/base_sink.cpp` already includes it. | — | +| `2169a6f6` | *(SUPERSEDED)* `lock_guard` vs `unique_lock` in `mpmc_blocking_q` — v2 already uses `lock_guard` where applicable. | — | +| `271f0f3b` | *(SUPERSEDED)* daily/hourly `max_files` doc note — v2 headers already document; duplicate line removed in `daily_file_sink.h`. | — | +| `8979f7fb` | *(SUPERSEDED)* Windows `path_exists` / UTF-8 — v2 uses `std::filesystem::exists` in `os_filesystem.cpp`. | — | +| `a3a0c9d6` | *(SUPERSEDED)* `-Wsuggest-override` — v2 `base_sink.h` uses `final override`. | — | +| `5ebfc927` | *(SUPERSEDED)* `/Zc:__cplusplus` / `/MP` only for real MSVC — v2 already gates on `CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"`. | — | +| `94a8e87c` | *(SUPERSEDED)* `#3079` `create_dir` on drive-letter paths — v2 uses `std::filesystem::create_directories`. | — | +| `7cb90d1a` | *(N/A)* MSVC flags when `SPDLOG_NO_EXCEPTIONS` — v2 CMake has no such option yet. | — | +| `d387fdf9` | *(SUPERSEDED)* MINGW + `CMAKE_CXX_EXTENSIONS` — already enabled for `MINGW` in `CMakeLists.txt`. | — | +| `4052bc06` `819eb27c` `23587b0d` | *(N/A)* `registry::get` / `registry-inl.h` — v2.x uses a global logger API; no v1-style registry. | — | +| `134f9194` | *(N/A)* registry formatting — no `registry.h` on v2. | — | +| `3403f278` | *(N/A)* `set_default_logger` registry behavior — v2 `set_global_logger` / PRD **2A** surface. | — | +| `b6eeb736` `e5865186` | *(N/A)* Logger-registration callbacks + immediate revert — no persistent v1 behavior. | — | +| `ddce4215` | *(N/A)* `tweakme.h` in fmt headers — v2 has no `tweakme.h`. | — | +| `5532231b` `37b84769` | *(N/A)* Registry `string_view` accessors / revert — no v1-style registry on v2. | — | +| `3b4c775b` | *(N/A)* Comment on `set_default_logger` — registry-only. | — | +| `c9ce17ab` | *(N/A)* `INSTALL.md` — file not present on v2. | — | +| `2969dde4` | *(N/A)* Revert fmt bump — handled with `d8e0ad46` under **5A** / fmt alignment. | — | +| `6766f873` | *(SUPERSEDED)* Drop `AnalyzeTemporaryDtors` from `.clang-tidy` — v2 config never had it. | — | +| *(batch)* | *(N/A)* **Clang-format / mass reformat** (e.g. `9e36a158` … `b3688ba1`, `22b0f4fc`, `1bea38ed`) — style-only; no per-commit functional port. | — | +| *(batch)* | *(N/A)* **Logo / sponsor image** commits — v2 assets differ. | — | +| *(batch)* | *(N/A)* **v1.x version bumps** (`7c02e204`, `238c9ffa`, `2122eb21`, `8e561337`, `ac432c36`, `48bcf39a`, `486b5555`, `6fa36017`, `79524ddd`) — v2 versioning is separate. | — | +| `508d20f0` | *(N/A)* `.git-blame-ignore-revs` — optional. | — | +| `0c4fb032` | *(N/A)* `SPDLOG_CONSTEXPR_FUNC` / `FMT_CONSTEXPR` — v2 macro model differs (**5A**). | — | +| `f4afd81c` | *(N/A)* trivial v1 `common.h` edit. | — | +| `d3730937` `a5cfbf36` | *(N/A)* `FMT_UNICODE` CMake + revert — triage under **5A**. | — | +| `15f53968` | *(SUPERSEDED)* `null_sink` `final` — already `final` in v2. | — | +| `51a0deca` | *(SUPERSEDED)* duplicate `daily_file_sink` comment line — already addressed on integration branch. | — | +| `66ac83e7` `a34e08c7` | *(SUPERSEDED)* `.gitignore` entries — v2 `.gitignore` already ignores `/.vs`, `/out/build`, `/CMakeSettings.json`. | — | +| *(batch)* | *(N/A)* **README / wiki / doc-link** updates — v2 docs maintained separately. | — | +| *(batch)* | *(N/A)* **Legacy v1 CI** (`ci.yml`, Windows CI WIP, Coverity) — v2 uses `.github/workflows`. | — | +| *(batch)* | *(N/A)* **CMake comment-only** / trivial one-line CMake / formatted `CMakeLists` — no behavior port. | — | +| `943fcbd7` | *(N/A)* “Register replace logger” — registry API. | — | +| `27cb4c76` | *(N/A)* MDC readme example — v2 has no MDC stack yet. | — | +| `3edc8036` | *(N/A)* Catch2 test declaration order — optional. | — | +| `c5061bb9` | *(N/A)* `LICENSE` text update — reconcile at release if needed. | — | **Full SHA list:** [`v1-triage-complete.md`](v1-triage-complete.md). diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index 8430d740ef..71aa55c4b2 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -5,8 +5,10 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D ## Progress (2026-04-04) - **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). -- **Ports:** [`commits-ported.txt`](commits-ported.txt). **Full triage (245 v1-only SHAs):** [`v1-triage-complete.md`](v1-triage-complete.md) — each commit **PORTED**, **PENDING**, or **N/A** (merge commits). **All unit tests pass** (`ctest` Release, Windows). -- **Remaining:** Topical ports from `v1-commit-inventory.txt` (fmt / CI / other fixes per **5A** and triage). +- **Ports:** [`commits-ported.txt`](commits-ported.txt). **Full triage (245 v1-only SHAs):** [`v1-triage-complete.md`](v1-triage-complete.md) — **PORTED**, **PENDING**, **SUPERSEDED**, or **N/A** (merge commits). **All unit tests pass** (`ctest` Release, Windows). +- **Latest pass:** `f1d748e5` **no `fileapi.h`** in `os_windows.cpp`; `7cbf2a69` **ansicolor** lock nesting aligned with v1 (`set_color_mode_` no nested mutex); `e593f669` **SUPERSEDED** (`-Wextra-semi` clean in v2). See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). +- **Triage snapshot:** **23 PORTED**, **21 SUPERSEDED**, **114 N/A**, **87 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). +- **Remaining:** Topical ports from `v1-commit-inventory.txt` — **fmt / CMake 5A** (bundled fmt bump, warning flags); large batches still **PENDING**. ## Relevant Files @@ -68,7 +70,7 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 4.5 Spot-check platform-specific areas called out in PRD (e.g. Windows/UWP, POSIX `TZ`, TCP) on representative configs if possible. - [ ] 5.0 Documentation, merge report, and release readiness (4B) - - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **7** ported, **2** N/A merge, **236** still **PENDING** — reclassify PENDING over time.)* + - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **23** ported, **21** superseded, **114** N/A, **87** **PENDING** — reclassify PENDING over time.)* - [x] 5.2 Write **merge report**: areas touched, conflict resolutions, rejected or deferred ports with rationale. - [ ] 5.3 Update **README** (build, fmt version, branch notes) and version header for v2.x pre-release. - [ ] 5.4 Add **migration / release notes** for downstream users (API preserved per **2A**, dependency changes per **5A**). diff --git a/tasks/v1-triage-complete.md b/tasks/v1-triage-complete.md index 6eb1debcc2..22000d5232 100644 --- a/tasks/v1-triage-complete.md +++ b/tasks/v1-triage-complete.md @@ -10,78 +10,78 @@ Source: `git log --reverse origin/v2.x..origin/v1.x` (245 commits). Integration Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (many paths removed/split), so not every v1 commit cherry-picks cleanly. -**Counts (this revision):** 9 **PORTED**, 1 **SUPERSEDED**, 2 **N/A** (merge commits), 233 **PENDING**. +**Counts (this revision):** 23 **PORTED**, 21 **SUPERSEDED**, 114 **N/A**, 87 **PENDING**. | SHA | Subject | Status | |-----|---------|--------| -| `9e36a158` | Updated clang format to google style | PENDING | -| `65701f4d` | Updated format.sh script | PENDING | -| `f24f7fa2` | Added missing include mutex | PENDING | -| `1a0bfc7a` | clang format | PENDING | -| `f4afd81c` | Update common.h | PENDING | +| `9e36a158` | Updated clang format to google style | N/A (formatting / tooling only; no functional port) | +| `65701f4d` | Updated format.sh script | N/A (formatting / tooling only) | +| `f24f7fa2` | Added missing include mutex | SUPERSEDED (`src/sinks/base_sink.cpp` already `#include `) | +| `1a0bfc7a` | clang format | N/A (formatting only) | +| `f4afd81c` | Update common.h | N/A (trivial v1 `common.h` edit; v2 header differs) | | `5931a3d6` | Fixed windows compile | PENDING | -| `5e88d5fe` | Never sort includes in clang format | PENDING | -| `95c226e9` | format | PENDING | -| `7f535d18` | updated .clang-format | PENDING | -| `230e15f4` | updated format.sh | PENDING | -| `9d522611` | clang format | PENDING | -| `cafde8cc` | updated clang format | PENDING | -| `4b2a8219` | reformat code | PENDING | -| `251c856a` | update clang format again | PENDING | -| `0a53eafe` | update clang format again | PENDING | -| `b6eeb736` | Added a function to add callbacks that are called when a logger is registered (#2883) | PENDING | -| `e5865186` | Revert "Added a function to add callbacks that are called when a logger is registered (#2883)" | PENDING | -| `d4a5fd56` | Update README.md | PENDING | -| `91807c2e` | Update README.md | PENDING | -| `479a5ac3` | Fix OS availability check of pthread_threadid_np for iOS (#2897) | PENDING | -| `508d20f0` | Add .git-blame-ignore-revs to ignore clang-format related commits (#2899) | PENDING | -| `0c4fb032` | Match SPDLOG_CONSTEXPR_FUNC to FMT_CONSTEXPR (#2901) | PENDING | -| `c5452e05` | Updated spdlog logo | PENDING | -| `595a5247` | Updated spdlog logo | PENDING | -| `ff205fd2` | Updated logo | PENDING | -| `2d5179ba` | sinks: Make syslog_sink.h's syslog_prio_from_level protected (#2918) | PENDING | -| `8b331e2c` | Fix wrong thread_id (TID) in systemd_sink.h (#2919) | PENDING | -| `ddce4215` | fmt/*.h: include tweakme.h to set SPDLOG_FMT_EXTERNAL according to system (#2923) | PENDING | -| `ac55e604` | Update README.md | PENDING | +| `5e88d5fe` | Never sort includes in clang format | N/A (formatting / tooling only) | +| `95c226e9` | format | N/A (formatting only) | +| `7f535d18` | updated .clang-format | N/A (formatting only) | +| `230e15f4` | updated format.sh | N/A (formatting only) | +| `9d522611` | clang format | N/A (formatting only) | +| `cafde8cc` | updated clang format | N/A (formatting only) | +| `4b2a8219` | reformat code | N/A (formatting only) | +| `251c856a` | update clang format again | N/A (formatting only) | +| `0a53eafe` | update clang format again | N/A (formatting only) | +| `b6eeb736` | Added a function to add callbacks that are called when a logger is registered (#2883) | N/A (feature reverted in `e5865186`; no lasting v1 delta to port) | +| `e5865186` | Revert "Added a function to add callbacks that are called when a logger is registered (#2883)" | N/A (revert commit; pairs with `b6eeb736`) | +| `d4a5fd56` | Update README.md | N/A (docs-only; README content differs on v2) | +| `91807c2e` | Update README.md | N/A (docs-only) | +| `479a5ac3` | Fix OS availability check of pthread_threadid_np for iOS (#2897) | SUPERSEDED (`src/details/os_unix.cpp` — `MAC_OS_X_VERSION_MAX_ALLOWED` / iOS branch already matches intent) | +| `508d20f0` | Add .git-blame-ignore-revs to ignore clang-format related commits (#2899) | N/A (optional repo hygiene; not required for v2 parity) | +| `0c4fb032` | Match SPDLOG_CONSTEXPR_FUNC to FMT_CONSTEXPR (#2901) | N/A (v2 has no `SPDLOG_CONSTEXPR_FUNC`; different constexpr / fmt story — see **5A**) | +| `c5452e05` | Updated spdlog logo | N/A (asset-only; v2 branding assets differ) | +| `595a5247` | Updated spdlog logo | N/A (asset-only) | +| `ff205fd2` | Updated logo | N/A (asset-only) | +| `2d5179ba` | sinks: Make syslog_sink.h's syslog_prio_from_level protected (#2918) | SUPERSEDED (`syslog_sink.h` — `syslog_prio_from_level` already `protected` / `virtual`) | +| `8b331e2c` | Fix wrong thread_id (TID) in systemd_sink.h (#2919) | SUPERSEDED (`systemd_sink.h` — already logs `msg.thread_id`) | +| `ddce4215` | fmt/*.h: include tweakme.h to set SPDLOG_FMT_EXTERNAL according to system (#2923) | N/A (v2 has no `tweakme.h`; fmt wiring is CMake-driven) | +| `ac55e604` | Update README.md | N/A (docs-only) | | `ba508057` | Update example.cpp to fix the vector issue in bin_example (#2963) | PENDING | | `c1569a3d` | Bump to catch2 v3.5.0 | PENDING | | `1ef8d3ce` | Fix #2967 | PENDING | -| `7cb90d1a` | Fix MSVC compile flag for no exceptions (#2974) | PENDING | -| `2aa8b6c9` | Check fd_ is not nullptr in file_helper | PENDING | -| `7c02e204` | Bump version to 1.13.0 | PENDING | -| `8979f7fb` | Also use _stat() on Windows to be more UTF8 friendly (#2978) | PENDING | -| `696db97f` | docs: details about how compile time macros work (#2981) | PENDING | +| `7cb90d1a` | Fix MSVC compile flag for no exceptions (#2974) | N/A (v2 `CMakeLists.txt` has no `SPDLOG_NO_EXCEPTIONS` / `-fno-exceptions` wiring; add when porting that option) | +| `2aa8b6c9` | Check fd_ is not nullptr in file_helper | SUPERSEDED (`src/details/file_helper.cpp` `write` already guards `fd_ == nullptr`) | +| `7c02e204` | Bump version to 1.13.0 | N/A (v1.x release version bump; v2 has own versioning) | +| `8979f7fb` | Also use _stat() on Windows to be more UTF8 friendly (#2978) | SUPERSEDED (`src/details/os_filesystem.cpp` — `path_exists` uses `std::filesystem::exists`) | +| `696db97f` | docs: details about how compile time macros work (#2981) | N/A (v1 docs; v2 macro story differs) | | `47b7e7c7` | Fix typos found by codespell (#3011) | PENDING | | `fe79bfcc` | Expose the flusher thread object to user in order to allow setting of thread name and thread affinity when needed (#3009) | PENDING | -| `134f9194` | Update registry.h code formatting | PENDING | -| `d387fdf9` | support MINGW (#3022) | PENDING | -| `9a445245` | Update ci.yml | PENDING | -| `3f0e4007` | Update ci.yml | PENDING | -| `75bfbb7c` | Update ci.yml | PENDING | -| `bc4b3295` | Update ci.yml | PENDING | -| `60faedb0` | Update ci.yml | PENDING | -| `5532231b` | feature: adds string view overloads for logger accessor (#3023) | PENDING | +| `134f9194` | Update registry.h code formatting | N/A (v2.x has no `registry.h` / multi-logger registry) | +| `d387fdf9` | support MINGW (#3022) | SUPERSEDED (`CMakeLists.txt` — `CMAKE_CXX_EXTENSIONS` ON for `MINGW` with `CYGWIN`/`MSYS`) | +| `9a445245` | Update ci.yml | N/A (v1 `ci.yml` / legacy CI; v2 uses `.github/workflows`) | +| `3f0e4007` | Update ci.yml | N/A (same) | +| `75bfbb7c` | Update ci.yml | N/A (same) | +| `bc4b3295` | Update ci.yml | N/A (same) | +| `60faedb0` | Update ci.yml | N/A (same) | +| `5532231b` | feature: adds string view overloads for logger accessor (#3023) | N/A (v1 registry/logger accessor API; v2 has no multi-logger registry) | | `a45c9390` | Update stopwatch.h (#3034) | PENDING | -| `ae525b75` | Add missing include (#3026) | PENDING | -| `e0410f43` | Update ci.yml | PENDING | -| `0621a7ae` | fix ci | PENDING | -| `c838945e` | fix ci | PENDING | -| `42cd77d7` | fix ci | PENDING | -| `e15c5059` | fix ci | PENDING | +| `ae525b75` | Add missing include (#3026) | PORTED (`include/spdlog/details/circular_q.h` — `#include `) | +| `e0410f43` | Update ci.yml | N/A (v1 legacy CI) | +| `0621a7ae` | fix ci | N/A (same) | +| `c838945e` | fix ci | N/A (same) | +| `42cd77d7` | fix ci | N/A (same) | +| `e15c5059` | fix ci | N/A (same) | | `8cfd4a7e` | Fixed bench dev_null | PENDING | -| `4052bc06` | Use find if registry is bigger than 20 in registry::get(std::string_view logger_name) | PENDING | -| `819eb27c` | Use find if registry is bigger than 10 in registry::get(std::string_view logger_name) | PENDING | -| `23587b0d` | Fixed regisry-inl.h | PENDING | +| `4052bc06` | Use find if registry is bigger than 20 in registry::get(std::string_view logger_name) | N/A (v2.x no `registry::get` / `registry-inl.h`) | +| `819eb27c` | Use find if registry is bigger than 10 in registry::get(std::string_view logger_name) | N/A (same) | +| `23587b0d` | Fixed regisry-inl.h | N/A (same) | | `d03eb40c` | Added Mapped Diagnostic Context (MDC) support (#2907) | PENDING | | `73e2e02b` | Fix #3038 (#3044) | PENDING | -| `6766f873` | Remove the legacy AnalyzeTemporaryDtors option from .clang-tidy. (#3048) | PENDING | +| `6766f873` | Remove the legacy AnalyzeTemporaryDtors option from .clang-tidy. (#3048) | SUPERSEDED (`.clang-tidy` on v2 does not set `AnalyzeTemporaryDtors`) | | `6725584e` | Make async_logger::flush() synchronous and wait for the flush to complete (#3049) | PENDING | -| `c9ce17ab` | INSTALL.md has been updated to provide current status information. (#3052) | PENDING | +| `c9ce17ab` | INSTALL.md has been updated to provide current status information. (#3052) | N/A (no `INSTALL.md` on v2 tree) | | `ec661f98` | Update test_async.cpp | PENDING | | `a19c76a4` | Fix flush test in test_async.cpp | PENDING | | `62302019` | Update test_async.cpp | PENDING | | `d8e0ad46` | Updated bundled fmt to 10.2.1 | PENDING | -| `2969dde4` | Revert "Updated bundled fmt to 10.2.1" | PENDING | +| `2969dde4` | Revert "Updated bundled fmt to 10.2.1" | N/A (revert of `d8e0ad46`; triage fmt bumps under **5A** separately) | | `f030afe6` | Update mdc.h | PENDING | | `1f930174` | Update mdc.h | PENDING | | `4517ce8b` | Update mdc.h | PENDING | @@ -91,84 +91,84 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `a2b42620` | Update CMakeLists.txt to fix #3029 | PENDING | | `1e7d7e07` | Updated bundled fmt to 10.2.1 | PENDING | | `e3f5a4fe` | Update cmake to define FMT_LIB_EXPORT when building shared lib | PENDING | -| `a0d2187d` | README.md has include missing (#3066) | PENDING | +| `a0d2187d` | README.md has include missing (#3066) | N/A (docs-only) | | `b7e0e2c2` | Fix #3073 | PENDING | -| `dd6c9c6e` | Update comment | PENDING | -| `66ac83e7` | Update gitginore to ignore .vs and out/build | PENDING | +| `dd6c9c6e` | Update comment | N/A (comment-only) | +| `66ac83e7` | Update gitginore to ignore .vs and out/build | SUPERSEDED (`.gitignore` already has `/.vs`, `/out/build`) | | `fd61ea93` | Merge branch 'v1.x' of https://github.com/gabime/spdlog into v1.x | N/A (merge commit) | | `71925ca3` | Revmoed definition of deprecated fmt macros | PENDING | -| `a34e08c7` | Added CMakeSettings.json to gitignore | PENDING | -| `3403f278` | Don't remove previous defaullt logger from registry in set_default_logger. Fix #3016 | PENDING | -| `3b4c775b` | Update comment about set_default_logger | PENDING | -| `238c9ffa` | Bump spdlog to version 1.14.0 | PENDING | -| `94a8e87c` | Fix #3079 | PENDING | +| `a34e08c7` | Added CMakeSettings.json to gitignore | SUPERSEDED (`.gitignore` already has `/CMakeSettings.json`) | +| `3403f278` | Don't remove previous defaullt logger from registry in set_default_logger. Fix #3016 | N/A (v2 uses `set_global_logger` / single global logger, not v1 registry) | +| `3b4c775b` | Update comment about set_default_logger | N/A (v1 registry API; v2 uses `set_global_logger`) | +| `238c9ffa` | Bump spdlog to version 1.14.0 | N/A (v1.x release version bump) | +| `94a8e87c` | Fix #3079 | SUPERSEDED (`create_dir` in `os_filesystem.cpp` uses `std::filesystem::create_directories`; Windows tests in `test_create_dir.cpp` already present) | | `fa6605dc` | Fix compile | PENDING | -| `37b84769` | Revert pr #3023 (std::string_view overloads for logger accessor for c++17) | PENDING | -| `22b0f4fc` | Clang format | PENDING | -| `2122eb21` | Update spdlog version to 1.14.1 | PENDING | +| `37b84769` | Revert pr #3023 (std::string_view overloads for logger accessor for c++17) | N/A (revert of `5532231b`; registry not on v2) | +| `22b0f4fc` | Clang format | N/A (formatting only) | +| `2122eb21` | Update spdlog version to 1.14.1 | N/A (v1.x release version bump) | | `3b4fd93b` | Updated comment about mdc | PENDING | | `2d4acf8c` | Added mdc example | PENDING | -| `27cb4c76` | Added mdc example to readme | PENDING | +| `27cb4c76` | Added mdc example to readme | N/A (docs; v2 has no MDC yet) | | `c3aed4b6` | Add wide character formatting and output support to wincolor_sink. (#3092) | PENDING | | `eeb22c13` | Allow customization of syslog_sink (#3124) | PENDING | | `d276069a` | make example compatible with fmt 11 (#3130) | PENDING | | `885b5473` | Fix building with `FMT_ENFORCE_COMPILE_STRING` (#3137) | PENDING | -| `5ebfc927` | fix: set `/Zc:__cplusplus` and `/MP` to MSVC only (#3139) | PENDING | -| `a3a0c9d6` | compilation error gcc 8.5 with [-Werror=suggest-override] (#3158) | PENDING | -| `271f0f3b` | Add info about max_files in the docstrings of hourly/daily file sinks (#3170) | PENDING | -| `2169a6f6` | use std::lock_guard instead of std::unique_lock (#3179) | PENDING | +| `5ebfc927` | fix: set `/Zc:__cplusplus` and `/MP` to MSVC only (#3139) | SUPERSEDED (`CMakeLists.txt` already uses `CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"` for `/Zc:__cplusplus` and `/MP`) | +| `a3a0c9d6` | compilation error gcc 8.5 with [-Werror=suggest-override] (#3158) | SUPERSEDED (`base_sink.h` already `final override` on `log`/`flush`/`set_pattern`/`set_formatter`) | +| `271f0f3b` | Add info about max_files in the docstrings of hourly/daily file sinks (#3170) | SUPERSEDED (doc text already in `daily_file_sink.h` / `hourly_file_sink.h`; removed duplicate `max_files` line in daily) | +| `2169a6f6` | use std::lock_guard instead of std::unique_lock (#3179) | SUPERSEDED (`mpmc_blocking_q.h` — `overrun_counter`/`size`/`reset_overrun_counter` already use `lock_guard`) | | `362214a3` | fix/issue-3101: fix the issue where mdc ignores SPDLOG_NO_TLS (#3184) | PENDING | | `c1fbafdc` | Update mdc.h (#3185) | PENDING | -| `ffd5aa41` | Update conan install command in README (#3172) | PENDING | -| `bdd1dff3` | Update CMakeLists.txt, Fix spelling errors (#3193) | PENDING | -| `2c76e610` | Fix #3194 - Use Sep instead of Sept for abbreviated month | PENDING | -| `e593f669` | Fix warning - extra ';' for -Wextra-semi (#3198) | PENDING | -| `ee168957` | Improve Cross-Platform Build Instructions in Documentation (#3229) | PENDING | +| `ffd5aa41` | Update conan install command in README (#3172) | N/A (docs-only) | +| `bdd1dff3` | Update CMakeLists.txt, Fix spelling errors (#3193) | N/A (trivial CMake / spelling; no functional port) | +| `2c76e610` | Fix #3194 - Use Sep instead of Sept for abbreviated month | SUPERSEDED (`src/pattern_formatter.cpp` abbreviated months already use `"Sep"`) | +| `e593f669` | Fix warning - extra ';' for -Wextra-semi (#3198) | SUPERSEDED (v2 `bench` / `example` / `callback_sink` / `msvc_sink` already match; no stray `};` / `override{};`) | +| `ee168957` | Improve Cross-Platform Build Instructions in Documentation (#3229) | N/A (v1 docs) | | `16e0d2e7` | Exchange promise for condition_variable when flushing (fixes #3221) (#3228) | PENDING | | `b6da5944` | Ensure flush callback gets called in move-assign operator (#3232) | PENDING | | `63d18842` | Gabime/async flush (#3235) | PENDING | | `85bdab0c` | Update bundled fmt to 11.0.2 (#3236) | PENDING | | `96c9a62b` | Fixed race condition in tests | PENDING | | `9fe79692` | Gabime/tsan (#3237) | PENDING | -| `7a950e02` | add /utf-8 flag for msvc | PENDING | -| `d3730937` | Better support for FMT_UNICODE in cmake | PENDING | -| `a5cfbf36` | Revert "Better support for FMT_UNICODE in cmake" | PENDING | -| `a7eb388f` | windows ci wip | PENDING | -| `5dc356dc` | windows ci | PENDING | -| `614c3a68` | Fix ci | PENDING | -| `7ecfb3bc` | Fix ci | PENDING | -| `984a9598` | Fix ci | PENDING | -| `3fec1a81` | Fix ci | PENDING | -| `3d3f71db` | Fix ci | PENDING | -| `64d9b4e2` | refactor win ci | PENDING | -| `92f9aa32` | refactor win ci | PENDING | -| `6f2ead1a` | refactor win ci | PENDING | -| `bff1a603` | Fix win ci | PENDING | -| `ecc38811` | Fix win ci | PENDING | -| `d939255f` | Fix win ci | PENDING | -| `6c720155` | Fix win ci | PENDING | -| `6192537d` | Fix win ci | PENDING | -| `3c2e002b` | ci-win-2019 (#3239) | PENDING | -| `35345182` | Update README.md (#3240) | PENDING | -| `5fd32e1a` | Update README.md | PENDING | -| `63f08750` | Removed if in ci | PENDING | +| `7a950e02` | add /utf-8 flag for msvc | PORTED (`CMakeLists.txt` — `SPDLOG_MSVC_UTF8` + MSVC-only genex; see `9edab1b5`) | +| `d3730937` | Better support for FMT_UNICODE in cmake | N/A (pair with `a5cfbf36` revert; triage **FMT_UNICODE** under **5A**) | +| `a5cfbf36` | Revert "Better support for FMT_UNICODE in cmake" | N/A (revert of `d3730937`) | +| `a7eb388f` | windows ci wip | N/A (v1 Windows CI churn; v2 workflows differ) | +| `5dc356dc` | windows ci | N/A (same) | +| `614c3a68` | Fix ci | N/A (same) | +| `7ecfb3bc` | Fix ci | N/A (same) | +| `984a9598` | Fix ci | N/A (same) | +| `3fec1a81` | Fix ci | N/A (same) | +| `3d3f71db` | Fix ci | N/A (same) | +| `64d9b4e2` | refactor win ci | N/A (same) | +| `92f9aa32` | refactor win ci | N/A (same) | +| `6f2ead1a` | refactor win ci | N/A (same) | +| `bff1a603` | Fix win ci | N/A (same) | +| `ecc38811` | Fix win ci | N/A (same) | +| `d939255f` | Fix win ci | N/A (same) | +| `6c720155` | Fix win ci | N/A (same) | +| `6192537d` | Fix win ci | N/A (same) | +| `3c2e002b` | ci-win-2019 (#3239) | N/A (same) | +| `35345182` | Update README.md (#3240) | N/A (docs-only) | +| `5fd32e1a` | Update README.md | N/A (docs-only) | +| `63f08750` | Removed if in ci | N/A (v1 CI) | | `5673e9e5` | utf8_to_wstrbuf now handles invalid utf8 sequences (#3244) | PENDING | | `fe4f9952` | Fix utf8_to_wstrbuf tests (#3245) | PENDING | -| `d343d413` | CMake option to Enable/disable msvc /utf-8 flag (on by default) | PENDING | +| `d343d413` | CMake option to Enable/disable msvc /utf-8 flag (on by default) | PORTED (same as `7a950e02` / `9edab1b5`) | | `68f6ec7a` | Merge branch 'v1.x' of https://github.com/gabime/spdlog into v1.x | N/A (merge commit) | -| `ebfa9069` | CMake option to Enable/disable msvc /utf-8 flag (on by default) | PENDING | -| `7cee026b` | Added tsan to ci (#3247) | PENDING | -| `8e561337` | Version 1.15.0 | PENDING | -| `51a0deca` | docs: Removed duplicate line in daily_file_sink comment (#3249) | PENDING | +| `ebfa9069` | CMake option to Enable/disable msvc /utf-8 flag (on by default) | PORTED (duplicate subject; same CMake port) | +| `7cee026b` | Added tsan to ci (#3247) | N/A (v1 CI; TSAN wiring triaged separately if needed) | +| `8e561337` | Version 1.15.0 | N/A (v1.x release version bump) | +| `51a0deca` | docs: Removed duplicate line in daily_file_sink comment (#3249) | SUPERSEDED (duplicate `max_files` line already removed in `daily_file_sink.h` on integration branch) | | `1245bf8e` | add explicit mt:: and std:: to avoid ambiguous call when both std::format_to and mt::format_to are present (#3259) | PENDING | -| `9edab1b5` | pass /utf-8 only when compiler is MSVC (#3260) | PENDING | -| `633003f4` | Update CMakeLists.txt comment | PENDING | -| `94526fa8` | Update CMakeLists.txt comment | PENDING | -| `35b0417f` | Update CMakeLists.txt comment | PENDING | -| `018d8aa2` | Update CMakeLists.txt | PENDING | -| `0efef2af` | Update CMakeLists.txt comment | PENDING | -| `43dcb398` | Update CMakeLists.txt comment | PENDING | -| `15f53968` | Update null_sink to be final (#3267) | PENDING | +| `9edab1b5` | pass /utf-8 only when compiler is MSVC (#3260) | PORTED (`$` genex on `spdlog` when `SPDLOG_MSVC_UTF8`) | +| `633003f4` | Update CMakeLists.txt comment | N/A (comment-only) | +| `94526fa8` | Update CMakeLists.txt comment | N/A (comment-only) | +| `35b0417f` | Update CMakeLists.txt comment | N/A (comment-only) | +| `018d8aa2` | Update CMakeLists.txt | N/A (trivial one-line CMake tweak) | +| `0efef2af` | Update CMakeLists.txt comment | N/A (comment-only) | +| `43dcb398` | Update CMakeLists.txt comment | N/A (comment-only) | +| `15f53968` | Update null_sink to be final (#3267) | SUPERSEDED (`null_sink` already `final` in `null_sink.h`) | | `951c5b99` | Allow manual rotation of rotating_file_sink (#3269) | PENDING | | `1e6250e1` | Gabime/fwrite unlocked (#3276) | PENDING | | `65e388e8` | Adding on demand truncation for basic file sinks (#3280) | PENDING | @@ -178,84 +178,84 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `96a8f625` | fix: remove unused to_string_view overload in fmt >= 11.1 (#3314) | PENDING | | `ad0f31c0` | Enabled bin_to_hex utest for stdformat, fixed std::formatter (#3315) | PENDING | | `d7155530` | Added SPDLOG_FWRITE_UNLOCKED option to CMakeLists.txt (#3318) | PENDING | -| `96a7d2a1` | Format CMakeLists.txt | PENDING | +| `96a7d2a1` | Format CMakeLists.txt | N/A (formatting only) | | `57505989` | SPDLOG_LEVEL_NAMES, comment use string_view_literals (#3291) | PENDING | -| `7cbf2a69` | Gabime/ansicolor sink improvements (#3323) | PENDING | +| `7cbf2a69` | Gabime/ansicolor sink improvements (#3323) | PORTED (`src/sinks/ansicolor_sink.cpp` — `set_color_mode` holds mutex, `set_color_mode_` does not; fixes double-lock vs v1 pattern; const helpers already present) | | `ae1de0dc` | Support custom environment variables for load_env_levels (#3327) | PENDING | | `3c23c27d` | Revert "fix: Compatibility with external fmtlib 11.1.1 (#3312)" (#3331) | PENDING | -| `ac432c36` | Gabime/v1.15.1 (#3332) | PENDING | +| `ac432c36` | Gabime/v1.15.1 (#3332) | N/A (v1.x release / tag commit) | | `f355b3d5` | Fix test_daily_logger | PENDING | -| `3335c380` | Update README.md (#3338) | PENDING | +| `3335c380` | Update README.md (#3338) | N/A (docs-only) | | `10320184` | Fixed issue #3360 (#3361) | PENDING | | `faa0a7a9` | Bump fmt to version 11.1.4 | PENDING | | `9c582574` | Fix zformatter on Apple and POSIX.1-2024 conforming platform (#3366) | PENDING | -| `48bcf39a` | Version 1.15.2 | PENDING | -| `1f4959c8` | Fix link to wiki. (#3377) | PENDING | -| `bd0609d7` | Update README.md | PENDING | -| `cec28bf8` | Fix links to local reference. (#3378) | PENDING | -| `bb8694b5` | Fix links for #3380 (#3381) | PENDING | +| `48bcf39a` | Version 1.15.2 | N/A (v1.x release version bump) | +| `1f4959c8` | Fix link to wiki. (#3377) | N/A (docs-only) | +| `bd0609d7` | Update README.md | N/A (docs-only) | +| `cec28bf8` | Fix links to local reference. (#3378) | N/A (docs-only) | +| `bb8694b5` | Fix links for #3380 (#3381) | N/A (docs-only) | | `847db337` | dup_filter_sink: remove notification_level argument; use last message log level for notification instead (#3390) | PENDING | | `548b2642` | Fix warning C4530 (#3393) | PENDING | | `7e022c43` | Feature 3379 (#3397) | PENDING | -| `943fcbd7` | Register replace logger (#3398) | PENDING | +| `943fcbd7` | Register replace logger (#3398) | N/A (v1 registry API) | | `0d31acae` | Fmt 11.2.0 (#3399) | PENDING | -| `070e1c97` | Update comment | PENDING | -| `7ca6a4fb` | Update commemt | PENDING | -| `c73b8cc4` | Update comment | PENDING | -| `6fa36017` | Version 1.15.3 | PENDING | +| `070e1c97` | Update comment | N/A (comment-only) | +| `7ca6a4fb` | Update commemt | N/A (comment-only) | +| `c73b8cc4` | Update comment | N/A (comment-only) | +| `6fa36017` | Version 1.15.3 | N/A (v1.x release version bump) | | `677a2d93` | Update test_stopwatch.cpp | PENDING | -| `37ff4664` | Add coverity scan to CI and fix warnings (#3400) | PENDING | -| `5d89b5b9` | Update jetbrains logo (#3401) | PENDING | -| `b18a234e` | Fix coverity ci | PENDING | +| `37ff4664` | Add coverity scan to CI and fix warnings (#3400) | N/A (optional third-party CI; not required for v2 parity) | +| `5d89b5b9` | Update jetbrains logo (#3401) | N/A (docs asset; optional for v2) | +| `b18a234e` | Fix coverity ci | N/A (Coverity CI follow-up) | | `e655dbb6` | Fix issue #3408 | PENDING | | `ad725d34` | Use std::getenv #3414 (#3415) | PENDING | | `287333ee` | Remove unnecessary and inconsistent "final" from color sinks (#3430) | PENDING | | `a6215527` | Fix ringbuffer tests for newline (#3436) | PENDING | -| `4619e18a` | Update windows.yml | PENDING | -| `6fd67ce1` | Update windows.yml | PENDING | -| `4397dac5` | chore(cmake): add option to override CMAKE_DEBUG_POSTFIX (#3433) | PENDING | -| `4f2b3d52` | Update README.md (#3437) | PENDING | -| `737347d2` | Update linux.yml | PENDING | +| `4619e18a` | Update windows.yml | N/A (v1 workflow history; triage current `.github/workflows` separately) | +| `6fd67ce1` | Update windows.yml | N/A (same) | +| `4397dac5` | chore(cmake): add option to override CMAKE_DEBUG_POSTFIX (#3433) | PORTED (`SPDLOG_DEBUG_POSTFIX` cache; default `-${MAJOR}.${MINOR}d` matches prior v2 hardcode) | +| `4f2b3d52` | Update README.md (#3437) | N/A (docs-only) | +| `737347d2` | Update linux.yml | N/A (v1 workflow history) | | `9ecdf5c8` | Added timeout for TCP calls such as connect, send, recv (#3432) | PORTED | -| `3edc8036` | Run tests in the order they are declared in the source file. (#3451) | PENDING | -| `f1d748e5` | Remove the fileapi.h include in os-inl.h (#3444) | PENDING | +| `3edc8036` | Run tests in the order they are declared in the source file. (#3451) | N/A (Catch2 test registration order; optional) | +| `f1d748e5` | Remove the fileapi.h include in os-inl.h (#3444) | PORTED (`src/details/os_windows.cpp` — drop redundant `#include `; `windows_include.h` / `windows.h` sufficient for `FlushFileBuffers`) | | `4418909a` | Bump fmt to 12.0.0 | PENDING | -| `1bea38ed` | clang-format | PENDING | -| `486b5555` | Version 1.16.0 | PENDING | +| `1bea38ed` | clang-format | N/A (formatting only) | +| `486b5555` | Version 1.16.0 | N/A (v1.x release version bump) | | `dd3ca04a` | set CMAKE_BUILD_TYPE only in top-level project (#3480) | PORTED | | `3f7e5028` | fix sign-compare warning (#3479) | PENDING | -| `88a0e07a` | Change access scope for ANSI target_file_ from private to protected (#3486) | PENDING | +| `88a0e07a` | Change access scope for ANSI target_file_ from private to protected (#3486) | PORTED (`include/spdlog/sinks/ansicolor_sink.h`) | | `cdbd64e2` | Fix sign conversion warnings in qt_sinks.h (#3487) | PENDING | | `8806ca65` | Fix UWP detection. (#3489) | PENDING | | `6004e3d1` | Fix issue #3483 (#3491) | PENDING | -| `b3688ba1` | Set IndentPPDirectives to "None" on clang-format | PENDING | +| `b3688ba1` | Set IndentPPDirectives to "None" on clang-format | N/A (formatting / tooling only) | | `ea3e747e` | Bump fmt to 12.1.0 | PENDING | -| `c5061bb9` | Update LICENSE file | PENDING | +| `c5061bb9` | Update LICENSE file | N/A (license text may differ; reconcile at release if needed) | | `878ad2e3` | Supress MSVC C4834 warning triggeed by fmt 12.1.0 | PENDING | | `2c1eafc8` | Backport warning fix from fmt head | PENDING | | `3f03542d` | Remove warning 4834 suppression | PENDING | | `d2100d5d` | Fix: include in tcp_client.h to avoid compilation failures on Unix (#3497) | PORTED | -| `0209b12c` | tests: fix unit tests to not be affected by custom level names (#3492) | PENDING | -| `32dd298d` | Docs: fix misleading comment in blocking_queue header (#3504) | PENDING | +| `0209b12c` | tests: fix unit tests to not be affected by custom level names (#3492) | PORTED (`tests/includes.h` — `#undef` custom level name macros before spdlog includes) | +| `32dd298d` | Docs: fix misleading comment in blocking_queue header (#3504) | PORTED (`include/spdlog/details/mpmc_blocking_q.h` file header; per-method comments already correct) | | `09a674b7` | Fix %z when pattern_type_type is utc - should be +00:00 | PORTED | | `2670f47d` | Fix warning | PENDING | | `b656d1ce` | Windows utc_minutes_offset(): Fix historical DST accuracy and improve offset calculation speed (~2.5x) (#3508) | PORTED | -| `79524ddd` | spdlog version 1.17.0 | PENDING | -| `6b240a89` | Replace C-style cast with reinterpret_cast in udp_client (#3509) | PENDING | -| `33375433` | fix: initialize null_atomic_int::value to zero (#3513) | PENDING | +| `79524ddd` | spdlog version 1.17.0 | N/A (v1.x release version bump) | +| `6b240a89` | Replace C-style cast with reinterpret_cast in udp_client (#3509) | PORTED (`udp_client_unix.h` `send` — `reinterpret_cast`, `sizeof(sockAddr_)`) | +| `33375433` | fix: initialize null_atomic_int::value to zero (#3513) | PORTED (`null_mutex.h` — `null_atomic::value{}` value-initializes `T`) | | `d299603e` | Add missing const qualifiers to reference variables (#3514) | PENDING | | `1774e700` | Add const qualifier to get_time_ and filter_ member functions (#3515) | PENDING | | `309204d5` | Rename local variables to avoid shadowing member functions (#3516) | PENDING | | `f2a9dec0` | Fix function arguments names different warnings (#3519) | PENDING | | `687226d9` | The upd_sink and dist_sink files have been modified to address Passed by value warnings. (#3520) | PENDING | | `472945ba` | Fix shadow member warning in example file (#3521) | PENDING | -| `6c5d6329` | Fix should_log comment (#3534) | PENDING | +| `6c5d6329` | Fix should_log comment (#3534) | SUPERSEDED (v2 `logger.h` already has “return true if logging is enabled…”) | | `566b2d14` | Fix #3525: Make level name matching case-insensitive (#3535) | PORTED | | `fc7e9c87` | Update common-inl.h | PENDING | -| `c49c7cf9` | Allow empty DEBUG_POSTFIX property in CMakeLists (#3530) | PENDING | +| `c49c7cf9` | Allow empty DEBUG_POSTFIX property in CMakeLists (#3530) | PORTED (`DEBUG_POSTFIX "${SPDLOG_DEBUG_POSTFIX}"` — empty cache value allowed) | | `1685e694` | Fix deprecated copy constructor usage of fmt::format_string (#3541) | PENDING | | `d5af52d9` | Fix format_string propagation (#3543) | SUPERSEDED (v2 `logger`/`spdlog` already forward `format_string_t` to `log_with_format_`) | | `0f7562a0` | tests: timezone: Provide DST rules when setting TZ on POSIX systems (#3542) | PORTED | -| `1fbc60a5` | docs: fix SPDLOG_LEVEL env example (#3561) | PENDING | +| `1fbc60a5` | docs: fix SPDLOG_LEVEL env example (#3561) | N/A (docs-only) | | `45b67eee` | Add constructor for dup_filter_sink with sinks parameter (#3549) | PORTED | | `3c61b051` | [ci] Update actions/checkout to latest major relese (#3575) | PORTED | diff --git a/tests/includes.h b/tests/includes.h index e2fb6aaddb..da66648f2d 100644 --- a/tests/includes.h +++ b/tests/includes.h @@ -25,6 +25,9 @@ #define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_DEBUG +#undef SPDLOG_LEVEL_NAMES +#undef SPDLOG_SHORT_LEVEL_NAMES + #include "spdlog/details/fmt_helper.h" #include "spdlog/pattern_formatter.h" #include "spdlog/sinks/null_sink.h" diff --git a/tests/test_stopwatch.cpp b/tests/test_stopwatch.cpp index ba4c8f62d7..02a6ce3f42 100644 --- a/tests/test_stopwatch.cpp +++ b/tests/test_stopwatch.cpp @@ -5,7 +5,7 @@ TEST_CASE("stopwatch1", "[stopwatch]") { using std::chrono::milliseconds; using clock = std::chrono::steady_clock; - milliseconds wait_ms(200); + milliseconds wait_ms(500); milliseconds tolerance_ms(250); auto start = clock::now(); spdlog::stopwatch sw; @@ -22,7 +22,7 @@ TEST_CASE("stopwatch2", "[stopwatch]") { using std::chrono::milliseconds; using clock = std::chrono::steady_clock; - clock::duration wait_duration(milliseconds(200)); + clock::duration wait_duration(milliseconds(500)); clock::duration tolerance_duration(milliseconds(250)); auto test_sink = std::make_shared(); From b55b01b1b8ef2f921531bab3ff86db4d829a3a1f Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 10:18:27 +0200 Subject: [PATCH 09/35] parity: ringbuffer zero capacity, utf8 assert; v1 triage sync - ringbuffer_sink: throw if n_items==0 (#3436); test expects spdlog_ex - utf8_to_wstrbuf: assert compares int to static_cast(target.size()) (#3479) - Triage: PORTED ad725d34 getenv, 677a2d93 stopwatch, 3f7e5028, a6215527; SUPERSEDED a45c9390, eeb22c13, 5673e9e5, fe4f9952, 287333ee - tasks: 27 PORTED / 26 SUPERSEDED / 78 PENDING; merge-report + commits-ported Made-with: Cursor --- include/spdlog/sinks/ringbuffer_sink.h | 6 +++++- src/details/os_windows.cpp | 2 +- tasks/commits-ported.txt | 7 +++++++ tasks/merge-report-v2x-v1x.md | 8 ++++++++ tasks/tasks-v2x-v1x-feature-parity.md | 6 +++--- tasks/v1-triage-complete.md | 20 ++++++++++---------- tests/test_ringbuffer_sink.cpp | 12 +----------- 7 files changed, 35 insertions(+), 26 deletions(-) diff --git a/include/spdlog/sinks/ringbuffer_sink.h b/include/spdlog/sinks/ringbuffer_sink.h index b6964190ed..d0bbc1f61e 100644 --- a/include/spdlog/sinks/ringbuffer_sink.h +++ b/include/spdlog/sinks/ringbuffer_sink.h @@ -24,7 +24,11 @@ template class ringbuffer_sink final : public base_sink { public: explicit ringbuffer_sink(size_t n_items) - : q_{n_items} {} + : q_{n_items} { + if (n_items == 0) { + throw_spdlog_ex("ringbuffer_sink: n_items cannot be zero"); + } + } void drain_raw(std::function callback) { std::lock_guard lock(base_sink::mutex_); diff --git a/src/details/os_windows.cpp b/src/details/os_windows.cpp index dbf3d390ee..f3b20a2ff0 100644 --- a/src/details/os_windows.cpp +++ b/src/details/os_windows.cpp @@ -209,7 +209,7 @@ void utf8_to_wstrbuf(string_view_t str, wmemory_buf_t &target) { target.resize(result_size); result_size = ::MultiByteToWideChar(CP_UTF8, 0, str.data(), str_size, target.data(), result_size); if (result_size > 0) { - assert(result_size == target.size()); + assert(result_size == static_cast(target.size())); return; } } diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt index e7922b427d..f064cfe14f 100644 --- a/tasks/commits-ported.txt +++ b/tasks/commits-ported.txt @@ -20,6 +20,9 @@ ae525b75 circular_q.h include spdlog/common.h (#3026) 7a950e02 d343d413 ebfa9069 9edab1b5 SPDLOG_MSVC_UTF8 + /utf-8 only for MSVC (CXX_COMPILER_ID) (#3260) f1d748e5 os_windows: drop fileapi.h include (#3444; v2 uses os_windows.cpp not os-inl.h) 7cbf2a69 ansicolor: set_color_mode_ without nested mutex (matches #3323; fixes double-lock) +ad725d34 os::getenv via std::getenv (MSVC 4996); 677a2d93 test_stopwatch 500ms waits +3f7e5028 utf8_to_wstrbuf assert: result_size vs static_cast(target.size()) (#3479) +a6215527 ringbuffer_sink: throw if n_items==0; test_ringbuffer_sink (#3436) # SUPERSEDED (no code change): d5af52d9 format_string propagation — v2 API already correct # SUPERSEDED: 6c5d6329 should_log comment — v2 logger.h already correct # SUPERSEDED: 2aa8b6c9 file_helper write fd_ — v2 file_helper.cpp already has guard @@ -55,5 +58,9 @@ f1d748e5 os_windows: drop fileapi.h include (#3444; v2 uses os_windows.cpp not o # SUPERSEDED: 66ac83e7 a34e08c7 .gitignore .vs out/build CMakeSettings — already in .gitignore # SUPERSEDED: 2c76e610 Sep vs Sept — src/pattern_formatter.cpp already uses "Sep" # SUPERSEDED: e593f669 -Wextra-semi — v2 sources already avoid extra `;` after `}` / `override {}` +# SUPERSEDED: a45c9390 stopwatch elapsed_ms — already in stopwatch.h +# SUPERSEDED: eeb22c13 syslog virtual prio — already in syslog_sink.h +# SUPERSEDED: 5673e9e5 fe4f9952 utf8_to_wstrbuf + tests — os_windows + test_misc +# SUPERSEDED: 287333ee color sinks final — v2 ansicolor/wincolor headers differ from v1 # N/A batch: README / wiki / docs-only SHAs; v1 ci.yml & win CI churn; CMake comment-only; LICENSE optional # N/A: 943fcbd7 registry; 27cb4c76 MDC readme; 3edc8036 catch test order; Coverity CI; 7cee026b v1 TSAN CI line diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index 8e0a6635c5..136617c60c 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -59,6 +59,14 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | `f1d748e5` | Drop redundant `#include ` when `windows.h` already provides APIs (older SDK compatibility). | `src/details/os_windows.cpp` (v1 had `os-inl.h`) | | `7cbf2a69` | `ansicolor_sink`: public `set_color_mode` locks; internal `set_color_mode_` must not re-lock (v1 #3323). | `src/sinks/ansicolor_sink.cpp` — removed nested `lock_guard` in `set_color_mode_` (avoids deadlock). | | `e593f669` | *(SUPERSEDED)* `-Wextra-semi` / stray `;` after `}` — v2 `bench`, `example`, `callback_sink`, `msvc_sink` already clean. | — | +| `ad725d34` | `std::getenv` in `spdlog::details::os::getenv` (MSVC: suppress C4996; UWP: empty). | `src/details/os_windows.cpp`, `src/details/os_unix.cpp` | +| `677a2d93` | Less flaky stopwatch tests (longer sleep). | `tests/test_stopwatch.cpp` | +| `a45c9390` | *(SUPERSEDED)* `stopwatch::elapsed_ms()` — already on v2. | — | +| `eeb22c13` | *(SUPERSEDED)* `syslog_sink` virtual `syslog_prio_from_level` — already on v2. | — | +| `5673e9e5` `fe4f9952` | *(SUPERSEDED)* UTF-8 → UTF-16 conversion behavior + tests — v2 `os_windows.cpp` / `test_misc.cpp`. | — | +| `3f7e5028` | `assert` sign-compare in `utf8_to_wstrbuf` (`int` vs `size_t`). | `src/details/os_windows.cpp` | +| `a6215527` | `ringbuffer_sink(0)` throws; test expects `spdlog_ex` (v2 uses `drain` API, not v1 `last_formatted`). | `include/spdlog/sinks/ringbuffer_sink.h`, `tests/test_ringbuffer_sink.cpp` | +| `287333ee` | *(SUPERSEDED)* drop `final` from color sinks — v2 headers differ from v1 patch context. | — | | `4397dac5` | `SPDLOG_DEBUG_POSTFIX` CMake cache (override debug library name suffix). | `CMakeLists.txt` — default `-${MAJOR}.${MINOR}d` (same as previous v2 hardcode). | | `c49c7cf9` | Allow **empty** debug postfix (quoted property). | Same `CMakeLists.txt` change as `4397dac5`. | | `ae525b75` | Self-contained `circular_q.h` (include `common.h`). | `include/spdlog/details/circular_q.h` | diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index 71aa55c4b2..0cbe9a568b 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -6,8 +6,8 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D - **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). - **Ports:** [`commits-ported.txt`](commits-ported.txt). **Full triage (245 v1-only SHAs):** [`v1-triage-complete.md`](v1-triage-complete.md) — **PORTED**, **PENDING**, **SUPERSEDED**, or **N/A** (merge commits). **All unit tests pass** (`ctest` Release, Windows). -- **Latest pass:** `f1d748e5` **no `fileapi.h`** in `os_windows.cpp`; `7cbf2a69` **ansicolor** lock nesting aligned with v1 (`set_color_mode_` no nested mutex); `e593f669` **SUPERSEDED** (`-Wextra-semi` clean in v2). See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). -- **Triage snapshot:** **23 PORTED**, **21 SUPERSEDED**, **114 N/A**, **87 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). +- **Latest pass:** Triage sync (`ad725d34` **getenv**, `677a2d93` stopwatch timing, utf8/syslog/stopwatch **SUPERSEDED**); `3f7e5028` **utf8** assert sign-compare; `a6215527` **ringbuffer** `n_items==0` throws; `287333ee` color **`final`** **SUPERSEDED** (v2 sink headers differ). Commits pushed on **`integration/v2-sync-v1`** as work lands. See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). +- **Triage snapshot:** **27 PORTED**, **26 SUPERSEDED**, **114 N/A**, **78 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). - **Remaining:** Topical ports from `v1-commit-inventory.txt` — **fmt / CMake 5A** (bundled fmt bump, warning flags); large batches still **PENDING**. ## Relevant Files @@ -70,7 +70,7 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 4.5 Spot-check platform-specific areas called out in PRD (e.g. Windows/UWP, POSIX `TZ`, TCP) on representative configs if possible. - [ ] 5.0 Documentation, merge report, and release readiness (4B) - - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **23** ported, **21** superseded, **114** N/A, **87** **PENDING** — reclassify PENDING over time.)* + - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **27** ported, **26** superseded, **114** N/A, **78** **PENDING** — reclassify PENDING over time.)* - [x] 5.2 Write **merge report**: areas touched, conflict resolutions, rejected or deferred ports with rationale. - [ ] 5.3 Update **README** (build, fmt version, branch notes) and version header for v2.x pre-release. - [ ] 5.4 Add **migration / release notes** for downstream users (API preserved per **2A**, dependency changes per **5A**). diff --git a/tasks/v1-triage-complete.md b/tasks/v1-triage-complete.md index 22000d5232..8689654026 100644 --- a/tasks/v1-triage-complete.md +++ b/tasks/v1-triage-complete.md @@ -10,7 +10,7 @@ Source: `git log --reverse origin/v2.x..origin/v1.x` (245 commits). Integration Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (many paths removed/split), so not every v1 commit cherry-picks cleanly. -**Counts (this revision):** 23 **PORTED**, 21 **SUPERSEDED**, 114 **N/A**, 87 **PENDING**. +**Counts (this revision):** 27 **PORTED**, 26 **SUPERSEDED**, 114 **N/A**, 78 **PENDING**. | SHA | Subject | Status | |-----|---------|--------| @@ -61,7 +61,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `bc4b3295` | Update ci.yml | N/A (same) | | `60faedb0` | Update ci.yml | N/A (same) | | `5532231b` | feature: adds string view overloads for logger accessor (#3023) | N/A (v1 registry/logger accessor API; v2 has no multi-logger registry) | -| `a45c9390` | Update stopwatch.h (#3034) | PENDING | +| `a45c9390` | Update stopwatch.h (#3034) | SUPERSEDED (`include/spdlog/stopwatch.h` already has `elapsed_ms()`) | | `ae525b75` | Add missing include (#3026) | PORTED (`include/spdlog/details/circular_q.h` — `#include `) | | `e0410f43` | Update ci.yml | N/A (v1 legacy CI) | | `0621a7ae` | fix ci | N/A (same) | @@ -110,7 +110,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `2d4acf8c` | Added mdc example | PENDING | | `27cb4c76` | Added mdc example to readme | N/A (docs; v2 has no MDC yet) | | `c3aed4b6` | Add wide character formatting and output support to wincolor_sink. (#3092) | PENDING | -| `eeb22c13` | Allow customization of syslog_sink (#3124) | PENDING | +| `eeb22c13` | Allow customization of syslog_sink (#3124) | SUPERSEDED (`syslog_sink.h` — `virtual syslog_prio_from_level`, `levels_array` protected) | | `d276069a` | make example compatible with fmt 11 (#3130) | PENDING | | `885b5473` | Fix building with `FMT_ENFORCE_COMPILE_STRING` (#3137) | PENDING | | `5ebfc927` | fix: set `/Zc:__cplusplus` and `/MP` to MSVC only (#3139) | SUPERSEDED (`CMakeLists.txt` already uses `CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"` for `/Zc:__cplusplus` and `/MP`) | @@ -152,8 +152,8 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `35345182` | Update README.md (#3240) | N/A (docs-only) | | `5fd32e1a` | Update README.md | N/A (docs-only) | | `63f08750` | Removed if in ci | N/A (v1 CI) | -| `5673e9e5` | utf8_to_wstrbuf now handles invalid utf8 sequences (#3244) | PENDING | -| `fe4f9952` | Fix utf8_to_wstrbuf tests (#3245) | PENDING | +| `5673e9e5` | utf8_to_wstrbuf now handles invalid utf8 sequences (#3244) | SUPERSEDED (`os_windows.cpp` + `test_misc.cpp` Windows UTF tests) | +| `fe4f9952` | Fix utf8_to_wstrbuf tests (#3245) | SUPERSEDED (`test_misc.cpp` uses `std::wstring(buffer.data(), buffer.size())`) | | `d343d413` | CMake option to Enable/disable msvc /utf-8 flag (on by default) | PORTED (same as `7a950e02` / `9edab1b5`) | | `68f6ec7a` | Merge branch 'v1.x' of https://github.com/gabime/spdlog into v1.x | N/A (merge commit) | | `ebfa9069` | CMake option to Enable/disable msvc /utf-8 flag (on by default) | PORTED (duplicate subject; same CMake port) | @@ -203,14 +203,14 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `7ca6a4fb` | Update commemt | N/A (comment-only) | | `c73b8cc4` | Update comment | N/A (comment-only) | | `6fa36017` | Version 1.15.3 | N/A (v1.x release version bump) | -| `677a2d93` | Update test_stopwatch.cpp | PENDING | +| `677a2d93` | Update test_stopwatch.cpp | PORTED (`tests/test_stopwatch.cpp` — 500ms waits) | | `37ff4664` | Add coverity scan to CI and fix warnings (#3400) | N/A (optional third-party CI; not required for v2 parity) | | `5d89b5b9` | Update jetbrains logo (#3401) | N/A (docs asset; optional for v2) | | `b18a234e` | Fix coverity ci | N/A (Coverity CI follow-up) | | `e655dbb6` | Fix issue #3408 | PENDING | -| `ad725d34` | Use std::getenv #3414 (#3415) | PENDING | -| `287333ee` | Remove unnecessary and inconsistent "final" from color sinks (#3430) | PENDING | -| `a6215527` | Fix ringbuffer tests for newline (#3436) | PENDING | +| `ad725d34` | Use std::getenv #3414 (#3415) | PORTED (`os_windows.cpp` / `os_unix.cpp` — `std::getenv`; MSVC 4996 suppressed; no v2 `cfg/` `load_levels`) | +| `287333ee` | Remove unnecessary and inconsistent "final" from color sinks (#3430) | SUPERSEDED (v2 `ansicolor_sink`/`wincolor_sink` layout differs; no `final` on same methods as v1 patch) | +| `a6215527` | Fix ringbuffer tests for newline (#3436) | PORTED (`ringbuffer_sink.h` reject `n_items==0`; `test_ringbuffer_sink.cpp` — v2 API uses `drain`, not v1 `last_formatted`) | | `4619e18a` | Update windows.yml | N/A (v1 workflow history; triage current `.github/workflows` separately) | | `6fd67ce1` | Update windows.yml | N/A (same) | | `4397dac5` | chore(cmake): add option to override CMAKE_DEBUG_POSTFIX (#3433) | PORTED (`SPDLOG_DEBUG_POSTFIX` cache; default `-${MAJOR}.${MINOR}d` matches prior v2 hardcode) | @@ -223,7 +223,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `1bea38ed` | clang-format | N/A (formatting only) | | `486b5555` | Version 1.16.0 | N/A (v1.x release version bump) | | `dd3ca04a` | set CMAKE_BUILD_TYPE only in top-level project (#3480) | PORTED | -| `3f7e5028` | fix sign-compare warning (#3479) | PENDING | +| `3f7e5028` | fix sign-compare warning (#3479) | PORTED (`os_windows.cpp` `utf8_to_wstrbuf` — `assert` vs `static_cast(target.size())`) | | `88a0e07a` | Change access scope for ANSI target_file_ from private to protected (#3486) | PORTED (`include/spdlog/sinks/ansicolor_sink.h`) | | `cdbd64e2` | Fix sign conversion warnings in qt_sinks.h (#3487) | PENDING | | `8806ca65` | Fix UWP detection. (#3489) | PENDING | diff --git a/tests/test_ringbuffer_sink.cpp b/tests/test_ringbuffer_sink.cpp index be6ac28e96..f0239e4204 100644 --- a/tests/test_ringbuffer_sink.cpp +++ b/tests/test_ringbuffer_sink.cpp @@ -57,15 +57,5 @@ TEST_CASE("test_empty", "[ringbuffer_sink]") { } TEST_CASE("test_empty_size", "[ringbuffer_sink]") { - const size_t sink_size = 0; - auto sink = std::make_shared(sink_size); - spdlog::logger l("logger", sink); - - for (size_t i = 0; i < sink_size + 1; ++i) { - l.info("{}", i); - } - - sink->drain([&](std::string_view) { - REQUIRE_FALSE(true); // should not be called since the sink size is 0 - }); + REQUIRE_THROWS_AS((void)spdlog::sinks::ringbuffer_sink_mt(0), spdlog::spdlog_ex); } From c38a8bb82cf595778cafccbe1e56dcaa5a5011b7 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 10:18:40 +0200 Subject: [PATCH 10/35] docs(tasks): note regular commits and push after parity ports Made-with: Cursor --- tasks/tasks-v2x-v1x-feature-parity.md | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index 0cbe9a568b..c060b5fd14 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -25,6 +25,7 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D ### Notes +- **Commits:** Prefer **small, topical commits** (code vs. doc-only when practical), **`ctest` Release** before push, then **`git push origin integration/v2-sync-v1`** so the branch and CI stay current. - Build and test with CMake: configure a build directory, then `cmake --build .` and `ctest` (or your project’s documented test target). Example: `cmake -B build -S . -DSPDLOG_BUILD_TESTS=ON` then `cmake --build build` and `ctest --test-dir build`. - Conflict resolution rule of thumb: **public headers** → preserve v2.x unless v1.x change is additive and compatible; **`.cpp` / tests / CI** → prefer carrying v1.x fixes forward; document intentional “v2 wins” cases in the merge report. - Keep a **triage spreadsheet or checklist** (commit SHA → ported | superseded | N/A + reason) until **3A** is 100% complete. From 5aa8021f6ffaf1509cfcfca368690e8f9f348311 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 10:20:24 +0200 Subject: [PATCH 11/35] parity: dup_filter_sink notification level from last duplicate (#3390) - Remove notification_level ctor arg; track skipped_msg_log_level_ on duplicate skips - Test: skipped summary line uses same short level as duplicated messages - Triage: 847db337 PORTED; 28/26/77 counts; merge-report + commits-ported Made-with: Cursor --- include/spdlog/sinks/dup_filter_sink.h | 17 ++++++++--------- tasks/commits-ported.txt | 1 + tasks/merge-report-v2x-v1x.md | 1 + tasks/tasks-v2x-v1x-feature-parity.md | 6 +++--- tasks/v1-triage-complete.md | 4 ++-- tests/test_dup_filter.cpp | 19 +++++++++++++++++++ 6 files changed, 34 insertions(+), 14 deletions(-) diff --git a/include/spdlog/sinks/dup_filter_sink.h b/include/spdlog/sinks/dup_filter_sink.h index f41b725ddc..391f305e60 100644 --- a/include/spdlog/sinks/dup_filter_sink.h +++ b/include/spdlog/sinks/dup_filter_sink.h @@ -22,8 +22,8 @@ // #include "spdlog/sinks/dup_filter_sink.h" // // int main() { -// auto dup_filter = std::make_shared(std::chrono::seconds(5), -// level::info); dup_filter->add_sink(std::make_shared()); +// auto dup_filter = std::make_shared(std::chrono::seconds(5)); +// dup_filter->add_sink(std::make_shared()); // spdlog::logger l("logger", dup_filter); // l.info("Hello"); // l.info("Hello"); @@ -42,28 +42,27 @@ template class dup_filter_sink final : public dist_sink { public: template - explicit dup_filter_sink(std::chrono::duration max_skip_duration, level notification_level = level::info) - : max_skip_duration_{max_skip_duration}, - log_level_{notification_level} {} + explicit dup_filter_sink(std::chrono::duration max_skip_duration) + : max_skip_duration_{max_skip_duration} {} template explicit dup_filter_sink(std::chrono::duration max_skip_duration, std::vector> sinks) : dist_sink(std::move(sinks)), - max_skip_duration_{max_skip_duration}, - log_level_{level::info} {} + max_skip_duration_{max_skip_duration} {} protected: std::chrono::microseconds max_skip_duration_; log_clock::time_point last_msg_time_; std::string last_msg_payload_; size_t skip_counter_ = 0; - level log_level_; + level skipped_msg_log_level_{level::off}; void sink_it_(const details::log_msg &msg) override { bool filtered = filter_(msg); if (!filtered) { skip_counter_ += 1; + skipped_msg_log_level_ = msg.log_level; return; } @@ -72,7 +71,7 @@ class dup_filter_sink final : public dist_sink { char buf[64]; auto msg_size = ::snprintf(buf, sizeof(buf), "Skipped %u duplicate messages..", static_cast(skip_counter_)); if (msg_size > 0 && static_cast(msg_size) < sizeof(buf)) { - details::log_msg skipped_msg{msg.source, msg.logger_name, log_level_, + details::log_msg skipped_msg{msg.source, msg.logger_name, skipped_msg_log_level_, string_view_t{buf, static_cast(msg_size)}}; dist_sink::sink_it_(skipped_msg); } diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt index f064cfe14f..6b2b460c6a 100644 --- a/tasks/commits-ported.txt +++ b/tasks/commits-ported.txt @@ -23,6 +23,7 @@ f1d748e5 os_windows: drop fileapi.h include (#3444; v2 uses os_windows.cpp not o ad725d34 os::getenv via std::getenv (MSVC 4996); 677a2d93 test_stopwatch 500ms waits 3f7e5028 utf8_to_wstrbuf assert: result_size vs static_cast(target.size()) (#3479) a6215527 ringbuffer_sink: throw if n_items==0; test_ringbuffer_sink (#3436) +847db337 dup_filter_sink: skipped-msg notification level from last duplicate (#3390) # SUPERSEDED (no code change): d5af52d9 format_string propagation — v2 API already correct # SUPERSEDED: 6c5d6329 should_log comment — v2 logger.h already correct # SUPERSEDED: 2aa8b6c9 file_helper write fd_ — v2 file_helper.cpp already has guard diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index 136617c60c..9773483569 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -44,6 +44,7 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | `3c61b051` | GitHub Actions `actions/checkout@v6` (Node deprecation). | `.github/workflows/linux.yml`, `macos.yml`, `windows.yml` | | `9ecdf5c8` | Optional connect timeout (non-blocking + `select`); `SO_RCVTIMEO` / `SO_SNDTIMEO` when `timeout_ms` is positive; `tcp_sink_config::timeout_ms` + ctor overload. | `tcp_client_windows.h`, `tcp_client_unix.h`, `tcp_sink.h` | | `45b67eee` | `dup_filter_sink` constructor taking `std::vector>`. | `include/spdlog/sinks/dup_filter_sink.h` | +| `847db337` | `dup_filter_sink`: drop ctor `notification_level`; “Skipped …” uses level of last duplicate (`msg.log_level`). | `include/spdlog/sinks/dup_filter_sink.h`, `tests/test_dup_filter.cpp` | | `566b2d14` | Case-insensitive `level_from_str` (env / argv level names). | `src/common.cpp`; `tests/test_misc.cpp` | | `dd3ca04a` | Set default `CMAKE_BUILD_TYPE` only when spdlog is the top-level CMake project. | `CMakeLists.txt` | | `d5af52d9` | *(SUPERSEDED)* format_string propagation — v2.x already uses unified `format_string_t` forwarding to `log_with_format_`. | — | diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index c060b5fd14..27e9ef05dd 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -6,8 +6,8 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D - **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). - **Ports:** [`commits-ported.txt`](commits-ported.txt). **Full triage (245 v1-only SHAs):** [`v1-triage-complete.md`](v1-triage-complete.md) — **PORTED**, **PENDING**, **SUPERSEDED**, or **N/A** (merge commits). **All unit tests pass** (`ctest` Release, Windows). -- **Latest pass:** Triage sync (`ad725d34` **getenv**, `677a2d93` stopwatch timing, utf8/syslog/stopwatch **SUPERSEDED**); `3f7e5028` **utf8** assert sign-compare; `a6215527` **ringbuffer** `n_items==0` throws; `287333ee` color **`final`** **SUPERSEDED** (v2 sink headers differ). Commits pushed on **`integration/v2-sync-v1`** as work lands. See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). -- **Triage snapshot:** **27 PORTED**, **26 SUPERSEDED**, **114 N/A**, **78 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). +- **Latest pass:** `847db337` **dup_filter_sink** — “Skipped N duplicates” notification uses **last duplicate’s** log level (`msg.log_level`); ctor no longer takes `notification_level`. See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). +- **Triage snapshot:** **28 PORTED**, **26 SUPERSEDED**, **114 N/A**, **77 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). - **Remaining:** Topical ports from `v1-commit-inventory.txt` — **fmt / CMake 5A** (bundled fmt bump, warning flags); large batches still **PENDING**. ## Relevant Files @@ -71,7 +71,7 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 4.5 Spot-check platform-specific areas called out in PRD (e.g. Windows/UWP, POSIX `TZ`, TCP) on representative configs if possible. - [ ] 5.0 Documentation, merge report, and release readiness (4B) - - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **27** ported, **26** superseded, **114** N/A, **78** **PENDING** — reclassify PENDING over time.)* + - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **28** ported, **26** superseded, **114** N/A, **77** **PENDING** — reclassify PENDING over time.)* - [x] 5.2 Write **merge report**: areas touched, conflict resolutions, rejected or deferred ports with rationale. - [ ] 5.3 Update **README** (build, fmt version, branch notes) and version header for v2.x pre-release. - [ ] 5.4 Add **migration / release notes** for downstream users (API preserved per **2A**, dependency changes per **5A**). diff --git a/tasks/v1-triage-complete.md b/tasks/v1-triage-complete.md index 8689654026..b74b1de19f 100644 --- a/tasks/v1-triage-complete.md +++ b/tasks/v1-triage-complete.md @@ -10,7 +10,7 @@ Source: `git log --reverse origin/v2.x..origin/v1.x` (245 commits). Integration Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (many paths removed/split), so not every v1 commit cherry-picks cleanly. -**Counts (this revision):** 27 **PORTED**, 26 **SUPERSEDED**, 114 **N/A**, 78 **PENDING**. +**Counts (this revision):** 28 **PORTED**, 26 **SUPERSEDED**, 114 **N/A**, 77 **PENDING**. | SHA | Subject | Status | |-----|---------|--------| @@ -194,7 +194,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `bd0609d7` | Update README.md | N/A (docs-only) | | `cec28bf8` | Fix links to local reference. (#3378) | N/A (docs-only) | | `bb8694b5` | Fix links for #3380 (#3381) | N/A (docs-only) | -| `847db337` | dup_filter_sink: remove notification_level argument; use last message log level for notification instead (#3390) | PENDING | +| `847db337` | dup_filter_sink: remove notification_level argument; use last message log level for notification instead (#3390) | PORTED (`dup_filter_sink.h` — `skipped_msg_log_level_` from `msg.log_level`; `tests/test_dup_filter.cpp`) | | `548b2642` | Fix warning C4530 (#3393) | PENDING | | `7e022c43` | Feature 3379 (#3397) | PENDING | | `943fcbd7` | Register replace logger (#3398) | N/A (v1 registry API) | diff --git a/tests/test_dup_filter.cpp b/tests/test_dup_filter.cpp index 23e5f96fae..0a248c3315 100644 --- a/tests/test_dup_filter.cpp +++ b/tests/test_dup_filter.cpp @@ -80,3 +80,22 @@ TEST_CASE("dup_filter_test5", "[dup_filter_sink]") { REQUIRE(test_sink->msg_counter() == 3); // skip 2 messages but log the "skipped.." message before message2 REQUIRE(test_sink->lines()[1] == "Skipped 2 duplicate messages.."); } + +TEST_CASE("dup_filter_skipped_notification_uses_last_duplicate_level", "[dup_filter_sink]") { + using spdlog::sinks::dup_filter_sink_st; + using spdlog::sinks::test_sink_mt; + + dup_filter_sink_st dup_sink{std::chrono::seconds{5}}; + auto test_sink = std::make_shared(); + test_sink->set_pattern("%L"); + dup_sink.add_sink(test_sink); + + dup_sink.log(spdlog::details::log_msg{"test", spdlog::level::warn, "same"}); + dup_sink.log(spdlog::details::log_msg{"test", spdlog::level::warn, "same"}); + dup_sink.log(spdlog::details::log_msg{"test", spdlog::level::info, "diff"}); + + REQUIRE(test_sink->lines().size() == 3); + REQUIRE(test_sink->lines()[0] == "W"); + REQUIRE(test_sink->lines()[1] == "W"); + REQUIRE(test_sink->lines()[2] == "I"); +} From a5644f8a6a400cba0183b4d88636e70b3cb379aa Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 10:22:02 +0200 Subject: [PATCH 12/35] parity: UWP getenv (WINAPI_FAMILY); triage fmt/cfg/no-except - os_windows: detect non-desktop/UWP for empty getenv (#3489) - Triage: PORTED 8806ca65; SUPERSEDED e3f5a4fe e655dbb6; N/A ae1de0dc 548b2642 - Counts 29/28/116/72; merge-report + commits-ported Made-with: Cursor --- src/details/os_windows.cpp | 5 +++-- tasks/commits-ported.txt | 5 +++++ tasks/merge-report-v2x-v1x.md | 5 +++++ tasks/tasks-v2x-v1x-feature-parity.md | 6 +++--- tasks/v1-triage-complete.md | 12 ++++++------ 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/details/os_windows.cpp b/src/details/os_windows.cpp index f3b20a2ff0..e7a2cdb348 100644 --- a/src/details/os_windows.cpp +++ b/src/details/os_windows.cpp @@ -222,8 +222,9 @@ void utf8_to_wstrbuf(string_view_t str, wmemory_buf_t &target) { #pragma warning(disable : 4996) #endif std::string getenv(const char *field) { -#if defined(_MSC_VER) && defined(__cplusplus_winrt) - return std::string{}; // not supported under uwp +#if defined(_MSC_VER) && defined(WINAPI_FAMILY) && defined(WINAPI_FAMILY_DESKTOP_APP) && \ + (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) + return std::string{}; // not supported on UWP / non-desktop WinRT targets (#3489) #else char *buf = std::getenv(field); return buf != nullptr ? std::string(buf) : std::string{}; diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt index 6b2b460c6a..428e5215e1 100644 --- a/tasks/commits-ported.txt +++ b/tasks/commits-ported.txt @@ -24,6 +24,7 @@ ad725d34 os::getenv via std::getenv (MSVC 4996); 677a2d93 test_stopwatch 500ms w 3f7e5028 utf8_to_wstrbuf assert: result_size vs static_cast(target.size()) (#3479) a6215527 ringbuffer_sink: throw if n_items==0; test_ringbuffer_sink (#3436) 847db337 dup_filter_sink: skipped-msg notification level from last duplicate (#3390) +8806ca65 os_windows getenv: UWP via WINAPI_FAMILY vs WINAPI_FAMILY_DESKTOP_APP (#3489) # SUPERSEDED (no code change): d5af52d9 format_string propagation — v2 API already correct # SUPERSEDED: 6c5d6329 should_log comment — v2 logger.h already correct # SUPERSEDED: 2aa8b6c9 file_helper write fd_ — v2 file_helper.cpp already has guard @@ -65,3 +66,7 @@ a6215527 ringbuffer_sink: throw if n_items==0; test_ringbuffer_sink (#3436) # SUPERSEDED: 287333ee color sinks final — v2 ansicolor/wincolor headers differ from v1 # N/A batch: README / wiki / docs-only SHAs; v1 ci.yml & win CI churn; CMake comment-only; LICENSE optional # N/A: 943fcbd7 registry; 27cb4c76 MDC readme; 3edc8036 catch test order; Coverity CI; 7cee026b v1 TSAN CI line +# N/A: ae1de0dc cfg load_env_levels var name — no spdlog/cfg on v2 +# N/A: 548b2642 MSVC C4530 / no-exceptions — no SPDLOG_NO_EXCEPTIONS in v2 CMake +# SUPERSEDED: e3f5a4fe FMT_LIB_EXPORT on spdlog — v2 uses fmt::fmt target +# SUPERSEDED: e655dbb6 fmt.h drop base.h — v2 uses common.h → fmt/base.h (no fmt.h) diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index 9773483569..5dfd7e1d4f 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -45,6 +45,11 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | `9ecdf5c8` | Optional connect timeout (non-blocking + `select`); `SO_RCVTIMEO` / `SO_SNDTIMEO` when `timeout_ms` is positive; `tcp_sink_config::timeout_ms` + ctor overload. | `tcp_client_windows.h`, `tcp_client_unix.h`, `tcp_sink.h` | | `45b67eee` | `dup_filter_sink` constructor taking `std::vector>`. | `include/spdlog/sinks/dup_filter_sink.h` | | `847db337` | `dup_filter_sink`: drop ctor `notification_level`; “Skipped …” uses level of last duplicate (`msg.log_level`). | `include/spdlog/sinks/dup_filter_sink.h`, `tests/test_dup_filter.cpp` | +| `8806ca65` | UWP / non-desktop: `getenv` unsupported — detect via `WINAPI_FAMILY` vs `WINAPI_FAMILY_DESKTOP_APP` (not `__cplusplus_winrt` alone). | `src/details/os_windows.cpp` | +| `e3f5a4fe` | *(SUPERSEDED)* `FMT_LIB_EXPORT` on spdlog when shared — v2 links `fmt::fmt`; fmt CMake owns exports. | — | +| `e655dbb6` | *(SUPERSEDED)* `#3408` trim `fmt.h` includes — v2 has no `spdlog/fmt/fmt.h`; `common.h` includes `fmt/base.h`. | — | +| `548b2642` | *(N/A)* MSVC C4530 / `_HAS_EXCEPTIONS` with no-exceptions — v2 has no `SPDLOG_NO_EXCEPTIONS` option in CMake. | — | +| `ae1de0dc` | *(N/A)* `load_env_levels("VAR")` — no `spdlog/cfg/` on v2. | — | | `566b2d14` | Case-insensitive `level_from_str` (env / argv level names). | `src/common.cpp`; `tests/test_misc.cpp` | | `dd3ca04a` | Set default `CMAKE_BUILD_TYPE` only when spdlog is the top-level CMake project. | `CMakeLists.txt` | | `d5af52d9` | *(SUPERSEDED)* format_string propagation — v2.x already uses unified `format_string_t` forwarding to `log_with_format_`. | — | diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index 27e9ef05dd..7ccca9e20b 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -6,8 +6,8 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D - **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). - **Ports:** [`commits-ported.txt`](commits-ported.txt). **Full triage (245 v1-only SHAs):** [`v1-triage-complete.md`](v1-triage-complete.md) — **PORTED**, **PENDING**, **SUPERSEDED**, or **N/A** (merge commits). **All unit tests pass** (`ctest` Release, Windows). -- **Latest pass:** `847db337` **dup_filter_sink** — “Skipped N duplicates” notification uses **last duplicate’s** log level (`msg.log_level`); ctor no longer takes `notification_level`. See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). -- **Triage snapshot:** **28 PORTED**, **26 SUPERSEDED**, **114 N/A**, **77 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). +- **Latest pass:** `8806ca65` **UWP `getenv`** — use `WINAPI_FAMILY` / `WINAPI_FAMILY_DESKTOP_APP` (#3489). Reclassified **SUPERSEDED** / **N/A:** `e3f5a4fe` (fmt linked separately), `e655dbb6` (no `fmt.h` shim), `548b2642` / `ae1de0dc` (no no-exceptions CMake block / no `cfg/`). See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). +- **Triage snapshot:** **29 PORTED**, **28 SUPERSEDED**, **116 N/A**, **72 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). - **Remaining:** Topical ports from `v1-commit-inventory.txt` — **fmt / CMake 5A** (bundled fmt bump, warning flags); large batches still **PENDING**. ## Relevant Files @@ -71,7 +71,7 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 4.5 Spot-check platform-specific areas called out in PRD (e.g. Windows/UWP, POSIX `TZ`, TCP) on representative configs if possible. - [ ] 5.0 Documentation, merge report, and release readiness (4B) - - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **28** ported, **26** superseded, **114** N/A, **77** **PENDING** — reclassify PENDING over time.)* + - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **29** ported, **28** superseded, **116** N/A, **72** **PENDING** — reclassify PENDING over time.)* - [x] 5.2 Write **merge report**: areas touched, conflict resolutions, rejected or deferred ports with rationale. - [ ] 5.3 Update **README** (build, fmt version, branch notes) and version header for v2.x pre-release. - [ ] 5.4 Add **migration / release notes** for downstream users (API preserved per **2A**, dependency changes per **5A**). diff --git a/tasks/v1-triage-complete.md b/tasks/v1-triage-complete.md index b74b1de19f..eaab2ae16d 100644 --- a/tasks/v1-triage-complete.md +++ b/tasks/v1-triage-complete.md @@ -10,7 +10,7 @@ Source: `git log --reverse origin/v2.x..origin/v1.x` (245 commits). Integration Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (many paths removed/split), so not every v1 commit cherry-picks cleanly. -**Counts (this revision):** 28 **PORTED**, 26 **SUPERSEDED**, 114 **N/A**, 77 **PENDING**. +**Counts (this revision):** 29 **PORTED**, 28 **SUPERSEDED**, 116 **N/A**, 72 **PENDING**. | SHA | Subject | Status | |-----|---------|--------| @@ -90,7 +90,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `8fed530b` | Update mdc.h | PENDING | | `a2b42620` | Update CMakeLists.txt to fix #3029 | PENDING | | `1e7d7e07` | Updated bundled fmt to 10.2.1 | PENDING | -| `e3f5a4fe` | Update cmake to define FMT_LIB_EXPORT when building shared lib | PENDING | +| `e3f5a4fe` | Update cmake to define FMT_LIB_EXPORT when building shared lib | SUPERSEDED (v2 links `fmt::fmt` from FetchContent / external; fmt target owns `FMT_*` exports — not inlined bundled fmt in `spdlog`) | | `a0d2187d` | README.md has include missing (#3066) | N/A (docs-only) | | `b7e0e2c2` | Fix #3073 | PENDING | | `dd6c9c6e` | Update comment | N/A (comment-only) | @@ -181,7 +181,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `96a7d2a1` | Format CMakeLists.txt | N/A (formatting only) | | `57505989` | SPDLOG_LEVEL_NAMES, comment use string_view_literals (#3291) | PENDING | | `7cbf2a69` | Gabime/ansicolor sink improvements (#3323) | PORTED (`src/sinks/ansicolor_sink.cpp` — `set_color_mode` holds mutex, `set_color_mode_` does not; fixes double-lock vs v1 pattern; const helpers already present) | -| `ae1de0dc` | Support custom environment variables for load_env_levels (#3327) | PENDING | +| `ae1de0dc` | Support custom environment variables for load_env_levels (#3327) | N/A (v2 has no `spdlog/cfg/` — `load_env_levels` not present) | | `3c23c27d` | Revert "fix: Compatibility with external fmtlib 11.1.1 (#3312)" (#3331) | PENDING | | `ac432c36` | Gabime/v1.15.1 (#3332) | N/A (v1.x release / tag commit) | | `f355b3d5` | Fix test_daily_logger | PENDING | @@ -195,7 +195,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `cec28bf8` | Fix links to local reference. (#3378) | N/A (docs-only) | | `bb8694b5` | Fix links for #3380 (#3381) | N/A (docs-only) | | `847db337` | dup_filter_sink: remove notification_level argument; use last message log level for notification instead (#3390) | PORTED (`dup_filter_sink.h` — `skipped_msg_log_level_` from `msg.log_level`; `tests/test_dup_filter.cpp`) | -| `548b2642` | Fix warning C4530 (#3393) | PENDING | +| `548b2642` | Fix warning C4530 (#3393) | N/A (v2 `CMakeLists.txt` has no `SPDLOG_NO_EXCEPTIONS` / `/EHs-c-` / `_HAS_EXCEPTIONS=0` block) | | `7e022c43` | Feature 3379 (#3397) | PENDING | | `943fcbd7` | Register replace logger (#3398) | N/A (v1 registry API) | | `0d31acae` | Fmt 11.2.0 (#3399) | PENDING | @@ -207,7 +207,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `37ff4664` | Add coverity scan to CI and fix warnings (#3400) | N/A (optional third-party CI; not required for v2 parity) | | `5d89b5b9` | Update jetbrains logo (#3401) | N/A (docs asset; optional for v2) | | `b18a234e` | Fix coverity ci | N/A (Coverity CI follow-up) | -| `e655dbb6` | Fix issue #3408 | PENDING | +| `e655dbb6` | Fix issue #3408 | SUPERSEDED (v2 has no `include/spdlog/fmt/fmt.h`; includes `fmt/base.h` via `common.h`) | | `ad725d34` | Use std::getenv #3414 (#3415) | PORTED (`os_windows.cpp` / `os_unix.cpp` — `std::getenv`; MSVC 4996 suppressed; no v2 `cfg/` `load_levels`) | | `287333ee` | Remove unnecessary and inconsistent "final" from color sinks (#3430) | SUPERSEDED (v2 `ansicolor_sink`/`wincolor_sink` layout differs; no `final` on same methods as v1 patch) | | `a6215527` | Fix ringbuffer tests for newline (#3436) | PORTED (`ringbuffer_sink.h` reject `n_items==0`; `test_ringbuffer_sink.cpp` — v2 API uses `drain`, not v1 `last_formatted`) | @@ -226,7 +226,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `3f7e5028` | fix sign-compare warning (#3479) | PORTED (`os_windows.cpp` `utf8_to_wstrbuf` — `assert` vs `static_cast(target.size())`) | | `88a0e07a` | Change access scope for ANSI target_file_ from private to protected (#3486) | PORTED (`include/spdlog/sinks/ansicolor_sink.h`) | | `cdbd64e2` | Fix sign conversion warnings in qt_sinks.h (#3487) | PENDING | -| `8806ca65` | Fix UWP detection. (#3489) | PENDING | +| `8806ca65` | Fix UWP detection. (#3489) | PORTED (`src/details/os_windows.cpp` `getenv` — `WINAPI_FAMILY` vs `WINAPI_FAMILY_DESKTOP_APP`) | | `6004e3d1` | Fix issue #3483 (#3491) | PENDING | | `b3688ba1` | Set IndentPPDirectives to "None" on clang-format | N/A (formatting / tooling only) | | `ea3e747e` | Bump fmt to 12.1.0 | PENDING | From 46555e8c489fba640873afa96408f0ccf945e621 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 10:23:29 +0200 Subject: [PATCH 13/35] parity: qt_sinks sign casts (#3487); triage 9c582574 superseded MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - qt_color_sink: qsizetype for UTF-8 color range lengths; index colors_ with size_t - SUPERSEDED: 9c582574 — os_unix utc_minutes_offset already matches #3366 - Counts 30/29/70; merge-report + commits-ported Made-with: Cursor --- include/spdlog/sinks/qt_sinks.h | 8 +++++--- tasks/commits-ported.txt | 2 ++ tasks/merge-report-v2x-v1x.md | 2 ++ tasks/tasks-v2x-v1x-feature-parity.md | 6 +++--- tasks/v1-triage-complete.md | 6 +++--- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/include/spdlog/sinks/qt_sinks.h b/include/spdlog/sinks/qt_sinks.h index 303e95098e..8b9d36da9f 100644 --- a/include/spdlog/sinks/qt_sinks.h +++ b/include/spdlog/sinks/qt_sinks.h @@ -154,8 +154,10 @@ class qt_color_sink : public base_sink { payload = QString::fromUtf8(str.data(), static_cast(str.size())); // convert color ranges from byte index to character index. if (msg.color_range_start < msg.color_range_end) { - color_range_start = QString::fromUtf8(str.data(), msg.color_range_start).size(); - color_range_end = QString::fromUtf8(str.data(), msg.color_range_end).size(); + color_range_start = + QString::fromUtf8(str.data(), static_cast(msg.color_range_start)).size(); + color_range_end = + QString::fromUtf8(str.data(), static_cast(msg.color_range_end)).size(); } } else { payload = QString::fromLatin1(str.data(), static_cast(str.size())); @@ -165,7 +167,7 @@ class qt_color_sink : public base_sink { qt_text_edit_, // text edit to append to std::move(payload), // text to append default_color_, // default color - colors_.at(msg.log_level), // color to apply + colors_.at(static_cast(msg.log_level)), // color to apply color_range_start, // color range start color_range_end}; // color range end diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt index 428e5215e1..c46e42737a 100644 --- a/tasks/commits-ported.txt +++ b/tasks/commits-ported.txt @@ -25,6 +25,7 @@ ad725d34 os::getenv via std::getenv (MSVC 4996); 677a2d93 test_stopwatch 500ms w a6215527 ringbuffer_sink: throw if n_items==0; test_ringbuffer_sink (#3436) 847db337 dup_filter_sink: skipped-msg notification level from last duplicate (#3390) 8806ca65 os_windows getenv: UWP via WINAPI_FAMILY vs WINAPI_FAMILY_DESKTOP_APP (#3489) +cdbd64e2 qt_sinks: qsizetype for fromUtf8 lengths; colors_.at size_t (#3487) # SUPERSEDED (no code change): d5af52d9 format_string propagation — v2 API already correct # SUPERSEDED: 6c5d6329 should_log comment — v2 logger.h already correct # SUPERSEDED: 2aa8b6c9 file_helper write fd_ — v2 file_helper.cpp already has guard @@ -70,3 +71,4 @@ a6215527 ringbuffer_sink: throw if n_items==0; test_ringbuffer_sink (#3436) # N/A: 548b2642 MSVC C4530 / no-exceptions — no SPDLOG_NO_EXCEPTIONS in v2 CMake # SUPERSEDED: e3f5a4fe FMT_LIB_EXPORT on spdlog — v2 uses fmt::fmt target # SUPERSEDED: e655dbb6 fmt.h drop base.h — v2 uses common.h → fmt/base.h (no fmt.h) +# SUPERSEDED: 9c582574 Apple/POSIX tm_gmtoff — os_unix.cpp utc_minutes_offset guard matches #3366 diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index 5dfd7e1d4f..8d33656c20 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -50,6 +50,8 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | `e655dbb6` | *(SUPERSEDED)* `#3408` trim `fmt.h` includes — v2 has no `spdlog/fmt/fmt.h`; `common.h` includes `fmt/base.h`. | — | | `548b2642` | *(N/A)* MSVC C4530 / `_HAS_EXCEPTIONS` with no-exceptions — v2 has no `SPDLOG_NO_EXCEPTIONS` option in CMake. | — | | `ae1de0dc` | *(N/A)* `load_env_levels("VAR")` — no `spdlog/cfg/` on v2. | — | +| `cdbd64e2` | `qt_color_sink`: `QString::fromUtf8` length `qsizetype`; `colors_.at` index `static_cast(msg.log_level)`. | `include/spdlog/sinks/qt_sinks.h` | +| `9c582574` | *(SUPERSEDED)* Apple / POSIX.1-2024 use `tm.tm_gmtoff` — v2 `os_unix.cpp` already has the `#if` guard from #3366. | — | | `566b2d14` | Case-insensitive `level_from_str` (env / argv level names). | `src/common.cpp`; `tests/test_misc.cpp` | | `dd3ca04a` | Set default `CMAKE_BUILD_TYPE` only when spdlog is the top-level CMake project. | `CMakeLists.txt` | | `d5af52d9` | *(SUPERSEDED)* format_string propagation — v2.x already uses unified `format_string_t` forwarding to `log_with_format_`. | — | diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index 7ccca9e20b..2761194a7f 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -6,8 +6,8 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D - **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). - **Ports:** [`commits-ported.txt`](commits-ported.txt). **Full triage (245 v1-only SHAs):** [`v1-triage-complete.md`](v1-triage-complete.md) — **PORTED**, **PENDING**, **SUPERSEDED**, or **N/A** (merge commits). **All unit tests pass** (`ctest` Release, Windows). -- **Latest pass:** `8806ca65` **UWP `getenv`** — use `WINAPI_FAMILY` / `WINAPI_FAMILY_DESKTOP_APP` (#3489). Reclassified **SUPERSEDED** / **N/A:** `e3f5a4fe` (fmt linked separately), `e655dbb6` (no `fmt.h` shim), `548b2642` / `ae1de0dc` (no no-exceptions CMake block / no `cfg/`). See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). -- **Triage snapshot:** **29 PORTED**, **28 SUPERSEDED**, **116 N/A**, **72 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). +- **Latest pass:** `cdbd64e2` **qt_color_sink** sign-conversion casts (#3487); `9c582574` **SUPERSEDED** (`os_unix.cpp` already uses `tm_gmtoff` on Apple / POSIX.1-2024). See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). +- **Triage snapshot:** **30 PORTED**, **29 SUPERSEDED**, **116 N/A**, **70 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). - **Remaining:** Topical ports from `v1-commit-inventory.txt` — **fmt / CMake 5A** (bundled fmt bump, warning flags); large batches still **PENDING**. ## Relevant Files @@ -71,7 +71,7 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 4.5 Spot-check platform-specific areas called out in PRD (e.g. Windows/UWP, POSIX `TZ`, TCP) on representative configs if possible. - [ ] 5.0 Documentation, merge report, and release readiness (4B) - - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **29** ported, **28** superseded, **116** N/A, **72** **PENDING** — reclassify PENDING over time.)* + - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **30** ported, **29** superseded, **116** N/A, **70** **PENDING** — reclassify PENDING over time.)* - [x] 5.2 Write **merge report**: areas touched, conflict resolutions, rejected or deferred ports with rationale. - [ ] 5.3 Update **README** (build, fmt version, branch notes) and version header for v2.x pre-release. - [ ] 5.4 Add **migration / release notes** for downstream users (API preserved per **2A**, dependency changes per **5A**). diff --git a/tasks/v1-triage-complete.md b/tasks/v1-triage-complete.md index eaab2ae16d..5be24c66fd 100644 --- a/tasks/v1-triage-complete.md +++ b/tasks/v1-triage-complete.md @@ -10,7 +10,7 @@ Source: `git log --reverse origin/v2.x..origin/v1.x` (245 commits). Integration Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (many paths removed/split), so not every v1 commit cherry-picks cleanly. -**Counts (this revision):** 29 **PORTED**, 28 **SUPERSEDED**, 116 **N/A**, 72 **PENDING**. +**Counts (this revision):** 30 **PORTED**, 29 **SUPERSEDED**, 116 **N/A**, 70 **PENDING**. | SHA | Subject | Status | |-----|---------|--------| @@ -188,7 +188,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `3335c380` | Update README.md (#3338) | N/A (docs-only) | | `10320184` | Fixed issue #3360 (#3361) | PENDING | | `faa0a7a9` | Bump fmt to version 11.1.4 | PENDING | -| `9c582574` | Fix zformatter on Apple and POSIX.1-2024 conforming platform (#3366) | PENDING | +| `9c582574` | Fix zformatter on Apple and POSIX.1-2024 conforming platform (#3366) | SUPERSEDED (`src/details/os_unix.cpp` `utc_minutes_offset` — `__APPLE__` / `_POSIX_VERSION` guard matches #3366) | | `48bcf39a` | Version 1.15.2 | N/A (v1.x release version bump) | | `1f4959c8` | Fix link to wiki. (#3377) | N/A (docs-only) | | `bd0609d7` | Update README.md | N/A (docs-only) | @@ -225,7 +225,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `dd3ca04a` | set CMAKE_BUILD_TYPE only in top-level project (#3480) | PORTED | | `3f7e5028` | fix sign-compare warning (#3479) | PORTED (`os_windows.cpp` `utf8_to_wstrbuf` — `assert` vs `static_cast(target.size())`) | | `88a0e07a` | Change access scope for ANSI target_file_ from private to protected (#3486) | PORTED (`include/spdlog/sinks/ansicolor_sink.h`) | -| `cdbd64e2` | Fix sign conversion warnings in qt_sinks.h (#3487) | PENDING | +| `cdbd64e2` | Fix sign conversion warnings in qt_sinks.h (#3487) | PORTED (`include/spdlog/sinks/qt_sinks.h` — `qsizetype` + `colors_.at(static_cast(msg.log_level))`) | | `8806ca65` | Fix UWP detection. (#3489) | PORTED (`src/details/os_windows.cpp` `getenv` — `WINAPI_FAMILY` vs `WINAPI_FAMILY_DESKTOP_APP`) | | `6004e3d1` | Fix issue #3483 (#3491) | PENDING | | `b3688ba1` | Set IndentPPDirectives to "None" on clang-format | N/A (formatting / tooling only) | From dc1117664ec6b3eef181f096a0524dd798afe7b7 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 10:27:15 +0200 Subject: [PATCH 14/35] parity: SPDLOG_NO_TZ_OFFSET (#3483); triage #3360 superseded - CMake: option SPDLOG_NO_TZ_OFFSET; PUBLIC compile definition when ON - z_formatter: +??:?? when macro; else keep UTC +00:00 and local offset - utc_minutes_offset: stub on Unix/Windows when macro - test_pattern_formatter: %z UTC case matches placeholder when NO_TZ - SUPERSEDED 10320184 (ScopedPadder / %D already in v2) - Triage 31/30/68; merge-report + commits-ported Made-with: Cursor --- CMakeLists.txt | 4 ++++ src/details/os_unix.cpp | 5 +++++ src/details/os_windows.cpp | 5 +++++ src/pattern_formatter.cpp | 5 +++++ tasks/commits-ported.txt | 2 ++ tasks/merge-report-v2x-v1x.md | 2 ++ tasks/tasks-v2x-v1x-feature-parity.md | 6 +++--- tasks/v1-triage-complete.md | 6 +++--- tests/test_pattern_formatter.cpp | 5 +++++ 9 files changed, 34 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ddf7c21d6d..733a2936d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,6 +66,7 @@ option(SPDLOG_PREVENT_CHILD_FD "Prevent from child processes to inherit log file option(SPDLOG_NO_THREAD_ID "prevent spdlog from querying the thread id on each log call if thread id is not needed" OFF) option(SPDLOG_DISABLE_GLOBAL_LOGGER "Disable global logger creation" OFF) option(SPDLOG_NO_TLS "Disable thread local storage" OFF) +option(SPDLOG_NO_TZ_OFFSET "Omit %z timezone offset (use on platforms without tm_gmtoff / full offset)" OFF) option(SPDLOG_TIDY "run clang-tidy" OFF) set(SPDLOG_DEBUG_POSTFIX "-${SPDLOG_VERSION_MAJOR}.${SPDLOG_VERSION_MINOR}d" CACHE STRING "Filename postfix for libraries in debug builds (empty string allowed)") @@ -273,6 +274,9 @@ foreach (SPDLOG_OPTION target_compile_definitions(spdlog PRIVATE ${SPDLOG_OPTION}) endif () endforeach () +if (SPDLOG_NO_TZ_OFFSET) + target_compile_definitions(spdlog PUBLIC SPDLOG_NO_TZ_OFFSET) +endif () # --------------------------------------------------------------------------------------- # Build binaries # --------------------------------------------------------------------------------------- diff --git a/src/details/os_unix.cpp b/src/details/os_unix.cpp index b7da1469f7..e1dc1c3aee 100644 --- a/src/details/os_unix.cpp +++ b/src/details/os_unix.cpp @@ -129,6 +129,10 @@ size_t filesize(FILE *f) { // Return utc offset in minutes or throw spdlog_ex on failure int utc_minutes_offset(const std::tm &tm) { +#if defined(SPDLOG_NO_TZ_OFFSET) + (void)tm; + return 0; +#else #if defined(sun) || defined(__sun) || defined(_AIX) || \ (defined(__NEWLIB__) && !defined(__TM_GMTOFF)) || \ (!defined(__APPLE__) && !defined(_BSD_SOURCE) && !defined(_GNU_SOURCE) && \ @@ -165,6 +169,7 @@ int utc_minutes_offset(const std::tm &tm) { auto offset_seconds = tm.tm_gmtoff; #endif return static_cast(offset_seconds / 60); +#endif // SPDLOG_NO_TZ_OFFSET } // Return current thread id as size_t diff --git a/src/details/os_windows.cpp b/src/details/os_windows.cpp index e7a2cdb348..2cb06e946f 100644 --- a/src/details/os_windows.cpp +++ b/src/details/os_windows.cpp @@ -109,6 +109,10 @@ size_t filesize(FILE *f) { // Compare the timestamp as local (mktime) vs UTC (_mkgmtime) to get the offset. // Matches v1.x behavior: better historical DST handling than GetTimeZoneInformation alone. int utc_minutes_offset(const std::tm &tm) { +#if defined(SPDLOG_NO_TZ_OFFSET) + (void)tm; + return 0; +#else std::tm local_tm = tm; // copy since mktime might adjust it (normalize dates, set tm_isdst) std::time_t local_time_t = std::mktime(&local_tm); if (local_time_t == static_cast(-1)) { @@ -122,6 +126,7 @@ int utc_minutes_offset(const std::tm &tm) { const auto offset_seconds = utc_time_t - local_time_t; return static_cast(offset_seconds / 60); +#endif } // Return current thread id as size_t diff --git a/src/pattern_formatter.cpp b/src/pattern_formatter.cpp index 80ce3c5b0b..f4ff0a3e91 100644 --- a/src/pattern_formatter.cpp +++ b/src/pattern_formatter.cpp @@ -510,6 +510,10 @@ class z_formatter final : public flag_formatter { constexpr size_t field_size = 6; ScopedPadder p(field_size, padinfo_, dest); +#ifdef SPDLOG_NO_TZ_OFFSET + const char *const placeholder = "+??:??"; + dest.append(placeholder, placeholder + 6); +#else if (time_type_ == pattern_time_type::utc) { const char *zeroes = "+00:00"; dest.append(zeroes, zeroes + 6); @@ -526,6 +530,7 @@ class z_formatter final : public flag_formatter { fmt_helper::pad2(total_minutes / 60, dest); // hours dest.push_back(':'); fmt_helper::pad2(total_minutes % 60, dest); // minutes +#endif } private: diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt index c46e42737a..4e0bf08b27 100644 --- a/tasks/commits-ported.txt +++ b/tasks/commits-ported.txt @@ -26,6 +26,7 @@ a6215527 ringbuffer_sink: throw if n_items==0; test_ringbuffer_sink (#3436) 847db337 dup_filter_sink: skipped-msg notification level from last duplicate (#3390) 8806ca65 os_windows getenv: UWP via WINAPI_FAMILY vs WINAPI_FAMILY_DESKTOP_APP (#3489) cdbd64e2 qt_sinks: qsizetype for fromUtf8 lengths; colors_.at size_t (#3487) +6004e3d1 SPDLOG_NO_TZ_OFFSET CMake + %z placeholder + utc_minutes_offset stubs (#3483) # SUPERSEDED (no code change): d5af52d9 format_string propagation — v2 API already correct # SUPERSEDED: 6c5d6329 should_log comment — v2 logger.h already correct # SUPERSEDED: 2aa8b6c9 file_helper write fd_ — v2 file_helper.cpp already has guard @@ -72,3 +73,4 @@ cdbd64e2 qt_sinks: qsizetype for fromUtf8 lengths; colors_.at size_t (#3487) # SUPERSEDED: e3f5a4fe FMT_LIB_EXPORT on spdlog — v2 uses fmt::fmt target # SUPERSEDED: e655dbb6 fmt.h drop base.h — v2 uses common.h → fmt/base.h (no fmt.h) # SUPERSEDED: 9c582574 Apple/POSIX tm_gmtoff — os_unix.cpp utc_minutes_offset guard matches #3366 +# SUPERSEDED: 10320184 pattern_formatter ScopedPadder / %D — already in pattern_formatter.cpp (#3360) diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index 8d33656c20..af9ed65610 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -52,6 +52,8 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | `ae1de0dc` | *(N/A)* `load_env_levels("VAR")` — no `spdlog/cfg/` on v2. | — | | `cdbd64e2` | `qt_color_sink`: `QString::fromUtf8` length `qsizetype`; `colors_.at` index `static_cast(msg.log_level)`. | `include/spdlog/sinks/qt_sinks.h` | | `9c582574` | *(SUPERSEDED)* Apple / POSIX.1-2024 use `tm.tm_gmtoff` — v2 `os_unix.cpp` already has the `#if` guard from #3366. | — | +| `6004e3d1` | **`SPDLOG_NO_TZ_OFFSET`**: `%z` prints `+??:??`; `utc_minutes_offset` returns 0; CMake `PUBLIC` define. `test_timezone` already guarded. | `CMakeLists.txt`, `src/pattern_formatter.cpp`, `os_unix.cpp`, `os_windows.cpp`, `tests/test_pattern_formatter.cpp` | +| `10320184` | *(SUPERSEDED)* `#3360` padding truncate / `%D` width — v2 `pattern_formatter.cpp` already matches. | — | | `566b2d14` | Case-insensitive `level_from_str` (env / argv level names). | `src/common.cpp`; `tests/test_misc.cpp` | | `dd3ca04a` | Set default `CMAKE_BUILD_TYPE` only when spdlog is the top-level CMake project. | `CMakeLists.txt` | | `d5af52d9` | *(SUPERSEDED)* format_string propagation — v2.x already uses unified `format_string_t` forwarding to `log_with_format_`. | — | diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index 2761194a7f..04cd7a9fcb 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -6,8 +6,8 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D - **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). - **Ports:** [`commits-ported.txt`](commits-ported.txt). **Full triage (245 v1-only SHAs):** [`v1-triage-complete.md`](v1-triage-complete.md) — **PORTED**, **PENDING**, **SUPERSEDED**, or **N/A** (merge commits). **All unit tests pass** (`ctest` Release, Windows). -- **Latest pass:** `cdbd64e2` **qt_color_sink** sign-conversion casts (#3487); `9c582574` **SUPERSEDED** (`os_unix.cpp` already uses `tm_gmtoff` on Apple / POSIX.1-2024). See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). -- **Triage snapshot:** **30 PORTED**, **29 SUPERSEDED**, **116 N/A**, **70 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). +- **Latest pass:** `6004e3d1` **`SPDLOG_NO_TZ_OFFSET`** — `%z` placeholder `+??:??`; `utc_minutes_offset` stubs; `10320184` **SUPERSEDED** (padding / `%D` already fixed). See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). +- **Triage snapshot:** **31 PORTED**, **30 SUPERSEDED**, **116 N/A**, **68 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). - **Remaining:** Topical ports from `v1-commit-inventory.txt` — **fmt / CMake 5A** (bundled fmt bump, warning flags); large batches still **PENDING**. ## Relevant Files @@ -71,7 +71,7 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 4.5 Spot-check platform-specific areas called out in PRD (e.g. Windows/UWP, POSIX `TZ`, TCP) on representative configs if possible. - [ ] 5.0 Documentation, merge report, and release readiness (4B) - - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **30** ported, **29** superseded, **116** N/A, **70** **PENDING** — reclassify PENDING over time.)* + - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **31** ported, **30** superseded, **116** N/A, **68** **PENDING** — reclassify PENDING over time.)* - [x] 5.2 Write **merge report**: areas touched, conflict resolutions, rejected or deferred ports with rationale. - [ ] 5.3 Update **README** (build, fmt version, branch notes) and version header for v2.x pre-release. - [ ] 5.4 Add **migration / release notes** for downstream users (API preserved per **2A**, dependency changes per **5A**). diff --git a/tasks/v1-triage-complete.md b/tasks/v1-triage-complete.md index 5be24c66fd..9ac53b0be9 100644 --- a/tasks/v1-triage-complete.md +++ b/tasks/v1-triage-complete.md @@ -10,7 +10,7 @@ Source: `git log --reverse origin/v2.x..origin/v1.x` (245 commits). Integration Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (many paths removed/split), so not every v1 commit cherry-picks cleanly. -**Counts (this revision):** 30 **PORTED**, 29 **SUPERSEDED**, 116 **N/A**, 70 **PENDING**. +**Counts (this revision):** 31 **PORTED**, 30 **SUPERSEDED**, 116 **N/A**, 68 **PENDING**. | SHA | Subject | Status | |-----|---------|--------| @@ -186,7 +186,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `ac432c36` | Gabime/v1.15.1 (#3332) | N/A (v1.x release / tag commit) | | `f355b3d5` | Fix test_daily_logger | PENDING | | `3335c380` | Update README.md (#3338) | N/A (docs-only) | -| `10320184` | Fixed issue #3360 (#3361) | PENDING | +| `10320184` | Fixed issue #3360 (#3361) | SUPERSEDED (scoped_padder truncate clamp; `%D` field width — already in `pattern_formatter.cpp`) | | `faa0a7a9` | Bump fmt to version 11.1.4 | PENDING | | `9c582574` | Fix zformatter on Apple and POSIX.1-2024 conforming platform (#3366) | SUPERSEDED (`src/details/os_unix.cpp` `utc_minutes_offset` — `__APPLE__` / `_POSIX_VERSION` guard matches #3366) | | `48bcf39a` | Version 1.15.2 | N/A (v1.x release version bump) | @@ -227,7 +227,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `88a0e07a` | Change access scope for ANSI target_file_ from private to protected (#3486) | PORTED (`include/spdlog/sinks/ansicolor_sink.h`) | | `cdbd64e2` | Fix sign conversion warnings in qt_sinks.h (#3487) | PORTED (`include/spdlog/sinks/qt_sinks.h` — `qsizetype` + `colors_.at(static_cast(msg.log_level))`) | | `8806ca65` | Fix UWP detection. (#3489) | PORTED (`src/details/os_windows.cpp` `getenv` — `WINAPI_FAMILY` vs `WINAPI_FAMILY_DESKTOP_APP`) | -| `6004e3d1` | Fix issue #3483 (#3491) | PENDING | +| `6004e3d1` | Fix issue #3483 (#3491) | PORTED (`SPDLOG_NO_TZ_OFFSET` CMake option; `z_formatter`; `utc_minutes_offset` stubs; tests; v1 `test_stdout_api` extra case N/A) | | `b3688ba1` | Set IndentPPDirectives to "None" on clang-format | N/A (formatting / tooling only) | | `ea3e747e` | Bump fmt to 12.1.0 | PENDING | | `c5061bb9` | Update LICENSE file | N/A (license text may differ; reconcile at release if needed) | diff --git a/tests/test_pattern_formatter.cpp b/tests/test_pattern_formatter.cpp index f83ad5fea9..0d9b166b6b 100644 --- a/tests/test_pattern_formatter.cpp +++ b/tests/test_pattern_formatter.cpp @@ -75,8 +75,13 @@ TEST_CASE("%z with UTC pattern time", "[pattern_formatter]") { const auto now = std::chrono::system_clock::now(); const auto yesterday = now - 24h; +#ifndef SPDLOG_NO_TZ_OFFSET REQUIRE(log_to_str_with_time(yesterday, "Some message", "%z", spdlog::pattern_time_type::utc, "\n") == "+00:00\n"); +#else + REQUIRE(log_to_str_with_time(yesterday, "Some message", "%z", spdlog::pattern_time_type::utc, "\n") == + "+??:??\n"); +#endif } // see test_timezone.cpp for actual UTC offset calculation tests From 57f292c8f982ba7b2cca3b7825f3b195224e628f Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 10:28:50 +0200 Subject: [PATCH 15/35] triage: supersede 5931a3d6 ba508057 47b7e7c7 (already on v2 tree) Made-with: Cursor --- tasks/commits-ported.txt | 3 +++ tasks/merge-report-v2x-v1x.md | 3 +++ tasks/tasks-v2x-v1x-feature-parity.md | 4 ++-- tasks/v1-triage-complete.md | 6 +++--- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt index 4e0bf08b27..acb9ffce33 100644 --- a/tasks/commits-ported.txt +++ b/tasks/commits-ported.txt @@ -74,3 +74,6 @@ cdbd64e2 qt_sinks: qsizetype for fromUtf8 lengths; colors_.at size_t (#3487) # SUPERSEDED: e655dbb6 fmt.h drop base.h — v2 uses common.h → fmt/base.h (no fmt.h) # SUPERSEDED: 9c582574 Apple/POSIX tm_gmtoff — os_unix.cpp utc_minutes_offset guard matches #3366 # SUPERSEDED: 10320184 pattern_formatter ScopedPadder / %D — already in pattern_formatter.cpp (#3360) +# SUPERSEDED: 5931a3d6 Windows include order — v2 os_windows.cpp (no os-inl.h) +# SUPERSEDED: ba508057 example binary_example vector — v2 uses push_back loop (#2963) +# SUPERSEDED: 47b7e7c7 codespell typos — qt_sinks / test_file_helper already fixed (#3011) diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index af9ed65610..0f06b993c6 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -54,6 +54,9 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | `9c582574` | *(SUPERSEDED)* Apple / POSIX.1-2024 use `tm.tm_gmtoff` — v2 `os_unix.cpp` already has the `#if` guard from #3366. | — | | `6004e3d1` | **`SPDLOG_NO_TZ_OFFSET`**: `%z` prints `+??:??`; `utc_minutes_offset` returns 0; CMake `PUBLIC` define. `test_timezone` already guarded. | `CMakeLists.txt`, `src/pattern_formatter.cpp`, `os_unix.cpp`, `os_windows.cpp`, `tests/test_pattern_formatter.cpp` | | `10320184` | *(SUPERSEDED)* `#3360` padding truncate / `%D` width — v2 `pattern_formatter.cpp` already matches. | — | +| `5931a3d6` | *(SUPERSEDED)* Win32 header include order (`windows_include.h` before others) — v2 `src/details/os_windows.cpp`; no `os-inl.h`. | — | +| `ba508057` | *(SUPERSEDED)* `binary_example` must not use `vector(80)` with 80 pushes — v2 `example.cpp` builds buffer with `push_back` in a loop. | — | +| `47b7e7c7` | *(SUPERSEDED)* codespell comment fixes (`qt_sinks.h`, `test_file_helper.cpp`) — already on branch; v2 `test_errors.cpp` differs from v1. | — | | `566b2d14` | Case-insensitive `level_from_str` (env / argv level names). | `src/common.cpp`; `tests/test_misc.cpp` | | `dd3ca04a` | Set default `CMAKE_BUILD_TYPE` only when spdlog is the top-level CMake project. | `CMakeLists.txt` | | `d5af52d9` | *(SUPERSEDED)* format_string propagation — v2.x already uses unified `format_string_t` forwarding to `log_with_format_`. | — | diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index 04cd7a9fcb..56194fb70c 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -6,8 +6,8 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D - **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). - **Ports:** [`commits-ported.txt`](commits-ported.txt). **Full triage (245 v1-only SHAs):** [`v1-triage-complete.md`](v1-triage-complete.md) — **PORTED**, **PENDING**, **SUPERSEDED**, or **N/A** (merge commits). **All unit tests pass** (`ctest` Release, Windows). -- **Latest pass:** `6004e3d1` **`SPDLOG_NO_TZ_OFFSET`** — `%z` placeholder `+??:??`; `utc_minutes_offset` stubs; `10320184` **SUPERSEDED** (padding / `%D` already fixed). See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). -- **Triage snapshot:** **31 PORTED**, **30 SUPERSEDED**, **116 N/A**, **68 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). +- **Latest pass:** Triage **SUPERSEDED** `5931a3d6` (Win include order → `os_windows.cpp`), `ba508057` (example binary vector), `47b7e7c7` (codespell typos already on branch). Prior: `6004e3d1` **`SPDLOG_NO_TZ_OFFSET`**; `10320184` padding / `%D`. See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). +- **Triage snapshot:** **31 PORTED**, **33 SUPERSEDED**, **116 N/A**, **65 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). - **Remaining:** Topical ports from `v1-commit-inventory.txt` — **fmt / CMake 5A** (bundled fmt bump, warning flags); large batches still **PENDING**. ## Relevant Files diff --git a/tasks/v1-triage-complete.md b/tasks/v1-triage-complete.md index 9ac53b0be9..7ddef1a2f6 100644 --- a/tasks/v1-triage-complete.md +++ b/tasks/v1-triage-complete.md @@ -10,7 +10,7 @@ Source: `git log --reverse origin/v2.x..origin/v1.x` (245 commits). Integration Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (many paths removed/split), so not every v1 commit cherry-picks cleanly. -**Counts (this revision):** 31 **PORTED**, 30 **SUPERSEDED**, 116 **N/A**, 68 **PENDING**. +**Counts (this revision):** 31 **PORTED**, 33 **SUPERSEDED**, 116 **N/A**, 65 **PENDING**. | SHA | Subject | Status | |-----|---------|--------| @@ -19,7 +19,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `f24f7fa2` | Added missing include mutex | SUPERSEDED (`src/sinks/base_sink.cpp` already `#include `) | | `1a0bfc7a` | clang format | N/A (formatting only) | | `f4afd81c` | Update common.h | N/A (trivial v1 `common.h` edit; v2 header differs) | -| `5931a3d6` | Fixed windows compile | PENDING | +| `5931a3d6` | Fixed windows compile | SUPERSEDED (`src/details/os_windows.cpp` — `windows_include.h` first; v2 has no `os-inl.h`) | | `5e88d5fe` | Never sort includes in clang format | N/A (formatting / tooling only) | | `95c226e9` | format | N/A (formatting only) | | `7f535d18` | updated .clang-format | N/A (formatting only) | @@ -51,7 +51,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `7c02e204` | Bump version to 1.13.0 | N/A (v1.x release version bump; v2 has own versioning) | | `8979f7fb` | Also use _stat() on Windows to be more UTF8 friendly (#2978) | SUPERSEDED (`src/details/os_filesystem.cpp` — `path_exists` uses `std::filesystem::exists`) | | `696db97f` | docs: details about how compile time macros work (#2981) | N/A (v1 docs; v2 macro story differs) | -| `47b7e7c7` | Fix typos found by codespell (#3011) | PENDING | +| `47b7e7c7` | Fix typos found by codespell (#3011) | SUPERSEDED (`qt_sinks.h` / `test_file_helper.cpp` match; `test_errors.cpp` differs on v2) | | `fe79bfcc` | Expose the flusher thread object to user in order to allow setting of thread name and thread affinity when needed (#3009) | PENDING | | `134f9194` | Update registry.h code formatting | N/A (v2.x has no `registry.h` / multi-logger registry) | | `d387fdf9` | support MINGW (#3022) | SUPERSEDED (`CMakeLists.txt` — `CMAKE_CXX_EXTENSIONS` ON for `MINGW` with `CYGWIN`/`MSYS`) | From 6541bc666fee2664b29df2a78d2e550f3e3c3220 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 10:29:08 +0200 Subject: [PATCH 16/35] tasks: sync 5.1 triage counts (33 superseded, 65 pending) Made-with: Cursor --- tasks/tasks-v2x-v1x-feature-parity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index 56194fb70c..996a0fac01 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -71,7 +71,7 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 4.5 Spot-check platform-specific areas called out in PRD (e.g. Windows/UWP, POSIX `TZ`, TCP) on representative configs if possible. - [ ] 5.0 Documentation, merge report, and release readiness (4B) - - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **31** ported, **30** superseded, **116** N/A, **68** **PENDING** — reclassify PENDING over time.)* + - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **31** ported, **33** superseded, **116** N/A, **65** **PENDING** — reclassify PENDING over time.)* - [x] 5.2 Write **merge report**: areas touched, conflict resolutions, rejected or deferred ports with rationale. - [ ] 5.3 Update **README** (build, fmt version, branch notes) and version header for v2.x pre-release. - [ ] 5.4 Add **migration / release notes** for downstream users (API preserved per **2A**, dependency changes per **5A**). From 35f232807f313b4c3e1ff2707e58949c56c09a21 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 10:35:05 +0200 Subject: [PATCH 17/35] =?UTF-8?q?parity:=20MSVC/clang=20hygiene=20#3515?= =?UTF-8?q?=E2=80=93#3519=20#3521;=20triage=20batch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - dup_filter_sink: filter_ const, const filter_duration (#3515) - logger: should_flush uses flush_level() (#3516) - daily_file_sink: new_filename locals (#3516) - spdlog::should_log(level log_level) (#3519) - example my_type value_ / ctor param (#3521) - Triage: PORTED 1774e700 309204d5 f2a9dec0 472945ba; N/A d299603e 57505989; SUPERSEDED 1ef8d3ce 8cfd4a7e; fix ba508057 row Made-with: Cursor --- example/example.cpp | 8 ++++---- include/spdlog/logger.h | 2 +- include/spdlog/sinks/daily_file_sink.h | 14 +++++++------- include/spdlog/sinks/dup_filter_sink.h | 4 ++-- include/spdlog/spdlog.h | 2 +- src/spdlog.cpp | 2 +- tasks/commits-ported.txt | 5 +++++ tasks/merge-report-v2x-v1x.md | 8 ++++++++ tasks/tasks-v2x-v1x-feature-parity.md | 6 +++--- tasks/v1-triage-complete.md | 20 ++++++++++---------- 10 files changed, 42 insertions(+), 29 deletions(-) diff --git a/example/example.cpp b/example/example.cpp index 8f645ff019..acd936014d 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -203,15 +203,15 @@ void multi_sink_example() { // User defined types logging struct my_type { - int i = 0; - explicit my_type(int i) - : i(i) {} + int value_ = 0; + explicit my_type(int value) + : value_(value) {} }; template <> struct fmt::formatter : fmt::formatter { auto format(my_type my, format_context &ctx) const -> decltype(ctx.out()) { - return fmt::format_to(ctx.out(), "[my_type i={}]", my.i); + return fmt::format_to(ctx.out(), "[my_type value={}]", my.value_); } }; diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index ae025df060..8f71f5d6fe 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -123,7 +123,7 @@ class SPDLOG_API logger { // return true if the given message should be flushed [[nodiscard]] bool should_flush(const details::log_msg &msg) const noexcept { - return (msg.log_level >= flush_level_.load(std::memory_order_relaxed)) && (msg.log_level != level::off); + return (msg.log_level >= flush_level()) && (msg.log_level != level::off); } // set the level of logging diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 1b9c15dcaf..bb822c501a 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -80,8 +80,8 @@ class daily_file_sink final : public base_sink { } auto now = log_clock::now(); - auto filename = FileNameCalc::calc_filename(base_filename_, now_tm(now)); - file_helper_.open(filename, truncate_); + const auto new_filename = FileNameCalc::calc_filename(base_filename_, now_tm(now)); + file_helper_.open(new_filename, truncate_); rotation_tp_ = next_rotation_tp_(); if (max_files_ > 0) { @@ -99,8 +99,8 @@ class daily_file_sink final : public base_sink { auto time = msg.time; bool should_rotate = time >= rotation_tp_; if (should_rotate) { - auto filename = FileNameCalc::calc_filename(base_filename_, now_tm(time)); - file_helper_.open(filename, truncate_); + const auto new_filename = FileNameCalc::calc_filename(base_filename_, now_tm(time)); + file_helper_.open(new_filename, truncate_); rotation_tp_ = next_rotation_tp_(); } memory_buf_t formatted; @@ -123,11 +123,11 @@ class daily_file_sink final : public base_sink { std::vector filenames; auto now = log_clock::now(); while (filenames.size() < max_files_) { - auto filename = FileNameCalc::calc_filename(base_filename_, now_tm(now)); - if (!path_exists(filename)) { + const auto new_filename = FileNameCalc::calc_filename(base_filename_, now_tm(now)); + if (!path_exists(new_filename)) { break; } - filenames.emplace_back(filename); + filenames.emplace_back(new_filename); now -= std::chrono::hours(24); } for (auto iter = filenames.rbegin(); iter != filenames.rend(); ++iter) { diff --git a/include/spdlog/sinks/dup_filter_sink.h b/include/spdlog/sinks/dup_filter_sink.h index 391f305e60..c63413010c 100644 --- a/include/spdlog/sinks/dup_filter_sink.h +++ b/include/spdlog/sinks/dup_filter_sink.h @@ -85,8 +85,8 @@ class dup_filter_sink final : public dist_sink { } // return whether the log msg should be displayed (true) or skipped (false) - bool filter_(const details::log_msg &msg) { - auto filter_duration = msg.time - last_msg_time_; + bool filter_(const details::log_msg &msg) const { + const auto filter_duration = msg.time - last_msg_time_; return (filter_duration > max_skip_duration_) || (msg.payload != last_msg_payload_); } }; diff --git a/include/spdlog/spdlog.h b/include/spdlog/spdlog.h index 45527eb490..4854e16e67 100644 --- a/include/spdlog/spdlog.h +++ b/include/spdlog/spdlog.h @@ -40,7 +40,7 @@ SPDLOG_API level get_level(); SPDLOG_API void set_level(level level); // Determine whether the global logger should log messages with a certain level -SPDLOG_API bool should_log(level level); +SPDLOG_API bool should_log(level log_level); // Set flush level of the global logger. SPDLOG_API void flush_on(level level); diff --git a/src/spdlog.cpp b/src/spdlog.cpp index 415cecaddb..f749dfb92c 100644 --- a/src/spdlog.cpp +++ b/src/spdlog.cpp @@ -33,7 +33,7 @@ void set_pattern(std::string pattern, pattern_time_type time_type) { level get_level() { return global_logger()->log_level(); } -bool should_log(level level) { return global_logger()->should_log(level); } +bool should_log(level log_level) { return global_logger()->should_log(log_level); } void set_level(level level) { global_logger()->set_level(level); } diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt index acb9ffce33..c4fc1a2ea9 100644 --- a/tasks/commits-ported.txt +++ b/tasks/commits-ported.txt @@ -27,6 +27,7 @@ a6215527 ringbuffer_sink: throw if n_items==0; test_ringbuffer_sink (#3436) 8806ca65 os_windows getenv: UWP via WINAPI_FAMILY vs WINAPI_FAMILY_DESKTOP_APP (#3489) cdbd64e2 qt_sinks: qsizetype for fromUtf8 lengths; colors_.at size_t (#3487) 6004e3d1 SPDLOG_NO_TZ_OFFSET CMake + %z placeholder + utc_minutes_offset stubs (#3483) +1774e700 309204d5 f2a9dec0 472945ba MSVC/clang hygiene: dup_filter filter_ const; should_flush/flush_level(); daily new_filename; should_log param; example my_type (#3515–#3519 #3521) # SUPERSEDED (no code change): d5af52d9 format_string propagation — v2 API already correct # SUPERSEDED: 6c5d6329 should_log comment — v2 logger.h already correct # SUPERSEDED: 2aa8b6c9 file_helper write fd_ — v2 file_helper.cpp already has guard @@ -77,3 +78,7 @@ cdbd64e2 qt_sinks: qsizetype for fromUtf8 lengths; colors_.at size_t (#3487) # SUPERSEDED: 5931a3d6 Windows include order — v2 os_windows.cpp (no os-inl.h) # SUPERSEDED: ba508057 example binary_example vector — v2 uses push_back loop (#2963) # SUPERSEDED: 47b7e7c7 codespell typos — qt_sinks / test_file_helper already fixed (#3011) +# SUPERSEDED: 1ef8d3ce LICENSE fmt third-party URL (#2967) +# SUPERSEDED: 8cfd4a7e bench latency __linux__ macro +# N/A: d299603e #3514 — registry + MDC hunk; v2 layout (dup_filter in 1774e700) +# N/A: 57505989 tweakme SPDLOG_LEVEL_NAMES string_view_literals — no tweakme on v2 (#3291) diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index 0f06b993c6..a1e7639958 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -57,6 +57,14 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | `5931a3d6` | *(SUPERSEDED)* Win32 header include order (`windows_include.h` before others) — v2 `src/details/os_windows.cpp`; no `os-inl.h`. | — | | `ba508057` | *(SUPERSEDED)* `binary_example` must not use `vector(80)` with 80 pushes — v2 `example.cpp` builds buffer with `push_back` in a loop. | — | | `47b7e7c7` | *(SUPERSEDED)* codespell comment fixes (`qt_sinks.h`, `test_file_helper.cpp`) — already on branch; v2 `test_errors.cpp` differs from v1. | — | +| `1ef8d3ce` | *(SUPERSEDED)* fmt third-party license URL in `LICENSE` — already points at raw `fmt` `LICENSE`. | — | +| `8cfd4a7e` | *(SUPERSEDED)* `bench/latency.cpp` `__linux__` — already correct. | — | +| `57505989` | *(N/A)* `tweakme.h` comment for `SPDLOG_LEVEL_NAMES` + `string_view_literals` — v2 has no tweakme; level strings live in `common.h`. | — | +| `d299603e` | *(N/A)* #3514 registry + MDC `const` tweaks — no v1 `registry-inl` / MDC block in v2 `pattern_formatter`; see `1774e700` for `dup_filter_sink`. | — | +| `1774e700` | `dup_filter_sink::filter_` **const** + `const` filter duration; `pattern_formatter::get_time_` was already **const** on v2. | `include/spdlog/sinks/dup_filter_sink.h` | +| `309204d5` | `logger::should_flush` uses **`flush_level()`**; `daily_file_sink` locals **`new_filename`** (avoid shadowing `filename()`). | `include/spdlog/logger.h`, `include/spdlog/sinks/daily_file_sink.h` | +| `f2a9dec0` | `spdlog::should_log(level log_level)` parameter rename (#3519); v1 cfg/async renames not ported (no `spdlog/cfg` on v2). | `include/spdlog/spdlog.h`, `src/spdlog.cpp` | +| `472945ba` | Example `my_type`: `value_` / ctor param vs member shadow (#3521). | `example/example.cpp` | | `566b2d14` | Case-insensitive `level_from_str` (env / argv level names). | `src/common.cpp`; `tests/test_misc.cpp` | | `dd3ca04a` | Set default `CMAKE_BUILD_TYPE` only when spdlog is the top-level CMake project. | `CMakeLists.txt` | | `d5af52d9` | *(SUPERSEDED)* format_string propagation — v2.x already uses unified `format_string_t` forwarding to `log_with_format_`. | — | diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index 996a0fac01..c553350200 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -6,8 +6,8 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D - **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). - **Ports:** [`commits-ported.txt`](commits-ported.txt). **Full triage (245 v1-only SHAs):** [`v1-triage-complete.md`](v1-triage-complete.md) — **PORTED**, **PENDING**, **SUPERSEDED**, or **N/A** (merge commits). **All unit tests pass** (`ctest` Release, Windows). -- **Latest pass:** Triage **SUPERSEDED** `5931a3d6` (Win include order → `os_windows.cpp`), `ba508057` (example binary vector), `47b7e7c7` (codespell typos already on branch). Prior: `6004e3d1` **`SPDLOG_NO_TZ_OFFSET`**; `10320184` padding / `%D`. See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). -- **Triage snapshot:** **31 PORTED**, **33 SUPERSEDED**, **116 N/A**, **65 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). +- **Latest pass:** **#3514–#3521** hygiene — `1774e700` `309204d5` `f2a9dec0` `472945ba` (dup_filter / `should_flush` / `daily_file_sink` / `should_log` / example `my_type`); **N/A** `d299603e` `57505989`; **SUPERSEDED** `1ef8d3ce` `8cfd4a7e`; triage row **`ba508057`** aligned. See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). +- **Triage snapshot:** **35 PORTED**, **36 SUPERSEDED**, **118 N/A**, **56 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). - **Remaining:** Topical ports from `v1-commit-inventory.txt` — **fmt / CMake 5A** (bundled fmt bump, warning flags); large batches still **PENDING**. ## Relevant Files @@ -71,7 +71,7 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 4.5 Spot-check platform-specific areas called out in PRD (e.g. Windows/UWP, POSIX `TZ`, TCP) on representative configs if possible. - [ ] 5.0 Documentation, merge report, and release readiness (4B) - - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **31** ported, **33** superseded, **116** N/A, **65** **PENDING** — reclassify PENDING over time.)* + - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **35** ported, **36** superseded, **118** N/A, **56** **PENDING** — reclassify PENDING over time.)* - [x] 5.2 Write **merge report**: areas touched, conflict resolutions, rejected or deferred ports with rationale. - [ ] 5.3 Update **README** (build, fmt version, branch notes) and version header for v2.x pre-release. - [ ] 5.4 Add **migration / release notes** for downstream users (API preserved per **2A**, dependency changes per **5A**). diff --git a/tasks/v1-triage-complete.md b/tasks/v1-triage-complete.md index 7ddef1a2f6..810c31475c 100644 --- a/tasks/v1-triage-complete.md +++ b/tasks/v1-triage-complete.md @@ -10,7 +10,7 @@ Source: `git log --reverse origin/v2.x..origin/v1.x` (245 commits). Integration Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (many paths removed/split), so not every v1 commit cherry-picks cleanly. -**Counts (this revision):** 31 **PORTED**, 33 **SUPERSEDED**, 116 **N/A**, 65 **PENDING**. +**Counts (this revision):** 35 **PORTED**, 36 **SUPERSEDED**, 118 **N/A**, 56 **PENDING**. | SHA | Subject | Status | |-----|---------|--------| @@ -43,9 +43,9 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `8b331e2c` | Fix wrong thread_id (TID) in systemd_sink.h (#2919) | SUPERSEDED (`systemd_sink.h` — already logs `msg.thread_id`) | | `ddce4215` | fmt/*.h: include tweakme.h to set SPDLOG_FMT_EXTERNAL according to system (#2923) | N/A (v2 has no `tweakme.h`; fmt wiring is CMake-driven) | | `ac55e604` | Update README.md | N/A (docs-only) | -| `ba508057` | Update example.cpp to fix the vector issue in bin_example (#2963) | PENDING | +| `ba508057` | Update example.cpp to fix the vector issue in bin_example (#2963) | SUPERSEDED (`example/example.cpp` `binary_example` uses `push_back`; not `vector(80)`) | | `c1569a3d` | Bump to catch2 v3.5.0 | PENDING | -| `1ef8d3ce` | Fix #2967 | PENDING | +| `1ef8d3ce` | Fix #2967 | SUPERSEDED (`LICENSE` fmt URL already `raw.githubusercontent.com/.../LICENSE`) | | `7cb90d1a` | Fix MSVC compile flag for no exceptions (#2974) | N/A (v2 `CMakeLists.txt` has no `SPDLOG_NO_EXCEPTIONS` / `-fno-exceptions` wiring; add when porting that option) | | `2aa8b6c9` | Check fd_ is not nullptr in file_helper | SUPERSEDED (`src/details/file_helper.cpp` `write` already guards `fd_ == nullptr`) | | `7c02e204` | Bump version to 1.13.0 | N/A (v1.x release version bump; v2 has own versioning) | @@ -68,7 +68,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `c838945e` | fix ci | N/A (same) | | `42cd77d7` | fix ci | N/A (same) | | `e15c5059` | fix ci | N/A (same) | -| `8cfd4a7e` | Fixed bench dev_null | PENDING | +| `8cfd4a7e` | Fixed bench dev_null | SUPERSEDED (`bench/latency.cpp` already `#ifdef __linux__`) | | `4052bc06` | Use find if registry is bigger than 20 in registry::get(std::string_view logger_name) | N/A (v2.x no `registry::get` / `registry-inl.h`) | | `819eb27c` | Use find if registry is bigger than 10 in registry::get(std::string_view logger_name) | N/A (same) | | `23587b0d` | Fixed regisry-inl.h | N/A (same) | @@ -179,7 +179,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `ad0f31c0` | Enabled bin_to_hex utest for stdformat, fixed std::formatter (#3315) | PENDING | | `d7155530` | Added SPDLOG_FWRITE_UNLOCKED option to CMakeLists.txt (#3318) | PENDING | | `96a7d2a1` | Format CMakeLists.txt | N/A (formatting only) | -| `57505989` | SPDLOG_LEVEL_NAMES, comment use string_view_literals (#3291) | PENDING | +| `57505989` | SPDLOG_LEVEL_NAMES, comment use string_view_literals (#3291) | N/A (v2 has no `tweakme.h` / `SPDLOG_LEVEL_NAMES`; levels in `common.h`) | | `7cbf2a69` | Gabime/ansicolor sink improvements (#3323) | PORTED (`src/sinks/ansicolor_sink.cpp` — `set_color_mode` holds mutex, `set_color_mode_` does not; fixes double-lock vs v1 pattern; const helpers already present) | | `ae1de0dc` | Support custom environment variables for load_env_levels (#3327) | N/A (v2 has no `spdlog/cfg/` — `load_env_levels` not present) | | `3c23c27d` | Revert "fix: Compatibility with external fmtlib 11.1.1 (#3312)" (#3331) | PENDING | @@ -243,12 +243,12 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `79524ddd` | spdlog version 1.17.0 | N/A (v1.x release version bump) | | `6b240a89` | Replace C-style cast with reinterpret_cast in udp_client (#3509) | PORTED (`udp_client_unix.h` `send` — `reinterpret_cast`, `sizeof(sockAddr_)`) | | `33375433` | fix: initialize null_atomic_int::value to zero (#3513) | PORTED (`null_mutex.h` — `null_atomic::value{}` value-initializes `T`) | -| `d299603e` | Add missing const qualifiers to reference variables (#3514) | PENDING | -| `1774e700` | Add const qualifier to get_time_ and filter_ member functions (#3515) | PENDING | -| `309204d5` | Rename local variables to avoid shadowing member functions (#3516) | PENDING | -| `f2a9dec0` | Fix function arguments names different warnings (#3519) | PENDING | +| `d299603e` | Add missing const qualifiers to reference variables (#3514) | N/A (v1 `registry-inl` + MDC `pattern_formatter`; v2 has no registry/MDC there — dup_filter covered by `1774e700`) | +| `1774e700` | Add const qualifier to get_time_ and filter_ member functions (#3515) | PORTED (`dup_filter_sink::filter_` const + `const` duration; `get_time_` already `const` in v2) | +| `309204d5` | Rename local variables to avoid shadowing member functions (#3516) | PORTED (`logger::should_flush` uses `flush_level()`; `daily_file_sink` `new_filename` locals) | +| `f2a9dec0` | Fix function arguments names different warnings (#3519) | PORTED (`spdlog::should_log(level log_level)`; v1 cfg/async renames N/A on v2) | | `687226d9` | The upd_sink and dist_sink files have been modified to address Passed by value warnings. (#3520) | PENDING | -| `472945ba` | Fix shadow member warning in example file (#3521) | PENDING | +| `472945ba` | Fix shadow member warning in example file (#3521) | PORTED (`example/example.cpp` `my_type` `value_` / ctor param) | | `6c5d6329` | Fix should_log comment (#3534) | SUPERSEDED (v2 `logger.h` already has “return true if logging is enabled…”) | | `566b2d14` | Fix #3525: Make level name matching case-insensitive (#3535) | PORTED | | `fc7e9c87` | Update common-inl.h | PENDING | From 7c415e49d13a03b503aa2126074fd93272544ea0 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 10:36:40 +0200 Subject: [PATCH 18/35] parity: udp_sink const udp_sink_config& (#3520); triage fc7e9c87 1685e694 - dist_sink already used std::move(sinks) - SUPERSEDED: no common-inl.h on v2; log_with_format_ avoids fmt copy path (#3541) Made-with: Cursor --- include/spdlog/sinks/udp_sink.h | 2 +- tasks/commits-ported.txt | 3 +++ tasks/merge-report-v2x-v1x.md | 3 +++ tasks/tasks-v2x-v1x-feature-parity.md | 6 +++--- tasks/v1-triage-complete.md | 8 ++++---- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/include/spdlog/sinks/udp_sink.h b/include/spdlog/sinks/udp_sink.h index 0f0951daaf..c70d67e873 100644 --- a/include/spdlog/sinks/udp_sink.h +++ b/include/spdlog/sinks/udp_sink.h @@ -36,7 +36,7 @@ template class udp_sink final : public base_sink { public: // host can be hostname or ip address - explicit udp_sink(udp_sink_config sink_config) + explicit udp_sink(const udp_sink_config &sink_config) : client_{sink_config.server_host, sink_config.server_port} {} ~udp_sink() override = default; diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt index c4fc1a2ea9..6925139cdf 100644 --- a/tasks/commits-ported.txt +++ b/tasks/commits-ported.txt @@ -28,6 +28,7 @@ a6215527 ringbuffer_sink: throw if n_items==0; test_ringbuffer_sink (#3436) cdbd64e2 qt_sinks: qsizetype for fromUtf8 lengths; colors_.at size_t (#3487) 6004e3d1 SPDLOG_NO_TZ_OFFSET CMake + %z placeholder + utc_minutes_offset stubs (#3483) 1774e700 309204d5 f2a9dec0 472945ba MSVC/clang hygiene: dup_filter filter_ const; should_flush/flush_level(); daily new_filename; should_log param; example my_type (#3515–#3519 #3521) +687226d9 udp_sink: const udp_sink_config& ctor (#3520); dist_sink already std::move(sinks) # SUPERSEDED (no code change): d5af52d9 format_string propagation — v2 API already correct # SUPERSEDED: 6c5d6329 should_log comment — v2 logger.h already correct # SUPERSEDED: 2aa8b6c9 file_helper write fd_ — v2 file_helper.cpp already has guard @@ -82,3 +83,5 @@ cdbd64e2 qt_sinks: qsizetype for fromUtf8 lengths; colors_.at size_t (#3487) # SUPERSEDED: 8cfd4a7e bench latency __linux__ macro # N/A: d299603e #3514 — registry + MDC hunk; v2 layout (dup_filter in 1774e700) # N/A: 57505989 tweakme SPDLOG_LEVEL_NAMES string_view_literals — no tweakme on v2 (#3291) +# SUPERSEDED: fc7e9c87 common-inl.h — no common-inl.h; common.cpp has cctype +# SUPERSEDED: 1685e694 fmt::format_string copy — v2 log_with_format_ + vformat_to (#3541) diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index a1e7639958..9d6f8c0a58 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -65,6 +65,9 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | `309204d5` | `logger::should_flush` uses **`flush_level()`**; `daily_file_sink` locals **`new_filename`** (avoid shadowing `filename()`). | `include/spdlog/logger.h`, `include/spdlog/sinks/daily_file_sink.h` | | `f2a9dec0` | `spdlog::should_log(level log_level)` parameter rename (#3519); v1 cfg/async renames not ported (no `spdlog/cfg` on v2). | `include/spdlog/spdlog.h`, `src/spdlog.cpp` | | `472945ba` | Example `my_type`: `value_` / ctor param vs member shadow (#3521). | `example/example.cpp` | +| `687226d9` | `udp_sink` ctor takes **`const udp_sink_config &`** (#3520). `dist_sink` already used **`std::move(sinks)`**. | `include/spdlog/sinks/udp_sink.h` | +| `fc7e9c87` | *(SUPERSEDED)* `common-inl.h` add `` — v2 has no `common-inl.h`; `level_from_str` lives in `src/common.cpp` with ``. | — | +| `1685e694` | *(SUPERSEDED)* Avoid deprecated `fmt::format_string` copy — v2 `logger::log_with_format_` holds `const format_string_t &` and calls `fmt::vformat_to` (no v1 `to_string_view(fmt)` indirection). | — | | `566b2d14` | Case-insensitive `level_from_str` (env / argv level names). | `src/common.cpp`; `tests/test_misc.cpp` | | `dd3ca04a` | Set default `CMAKE_BUILD_TYPE` only when spdlog is the top-level CMake project. | `CMakeLists.txt` | | `d5af52d9` | *(SUPERSEDED)* format_string propagation — v2.x already uses unified `format_string_t` forwarding to `log_with_format_`. | — | diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index c553350200..e7062a57bf 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -6,8 +6,8 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D - **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). - **Ports:** [`commits-ported.txt`](commits-ported.txt). **Full triage (245 v1-only SHAs):** [`v1-triage-complete.md`](v1-triage-complete.md) — **PORTED**, **PENDING**, **SUPERSEDED**, or **N/A** (merge commits). **All unit tests pass** (`ctest` Release, Windows). -- **Latest pass:** **#3514–#3521** hygiene — `1774e700` `309204d5` `f2a9dec0` `472945ba` (dup_filter / `should_flush` / `daily_file_sink` / `should_log` / example `my_type`); **N/A** `d299603e` `57505989`; **SUPERSEDED** `1ef8d3ce` `8cfd4a7e`; triage row **`ba508057`** aligned. See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). -- **Triage snapshot:** **35 PORTED**, **36 SUPERSEDED**, **118 N/A**, **56 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). +- **Latest pass:** `687226d9` **`udp_sink`** `const udp_sink_config &` (#3520; `dist_sink` already `std::move`); **SUPERSEDED** `fc7e9c87` (no `common-inl.h`), `1685e694` (v2 `log_with_format_` / `vformat_to`). Prior: **#3514–#3521** batch. See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). +- **Triage snapshot:** **36 PORTED**, **38 SUPERSEDED**, **118 N/A**, **53 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). - **Remaining:** Topical ports from `v1-commit-inventory.txt` — **fmt / CMake 5A** (bundled fmt bump, warning flags); large batches still **PENDING**. ## Relevant Files @@ -71,7 +71,7 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 4.5 Spot-check platform-specific areas called out in PRD (e.g. Windows/UWP, POSIX `TZ`, TCP) on representative configs if possible. - [ ] 5.0 Documentation, merge report, and release readiness (4B) - - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **35** ported, **36** superseded, **118** N/A, **56** **PENDING** — reclassify PENDING over time.)* + - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **36** ported, **38** superseded, **118** N/A, **53** **PENDING** — reclassify PENDING over time.)* - [x] 5.2 Write **merge report**: areas touched, conflict resolutions, rejected or deferred ports with rationale. - [ ] 5.3 Update **README** (build, fmt version, branch notes) and version header for v2.x pre-release. - [ ] 5.4 Add **migration / release notes** for downstream users (API preserved per **2A**, dependency changes per **5A**). diff --git a/tasks/v1-triage-complete.md b/tasks/v1-triage-complete.md index 810c31475c..34684067f9 100644 --- a/tasks/v1-triage-complete.md +++ b/tasks/v1-triage-complete.md @@ -10,7 +10,7 @@ Source: `git log --reverse origin/v2.x..origin/v1.x` (245 commits). Integration Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (many paths removed/split), so not every v1 commit cherry-picks cleanly. -**Counts (this revision):** 35 **PORTED**, 36 **SUPERSEDED**, 118 **N/A**, 56 **PENDING**. +**Counts (this revision):** 36 **PORTED**, 38 **SUPERSEDED**, 118 **N/A**, 53 **PENDING**. | SHA | Subject | Status | |-----|---------|--------| @@ -247,13 +247,13 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `1774e700` | Add const qualifier to get_time_ and filter_ member functions (#3515) | PORTED (`dup_filter_sink::filter_` const + `const` duration; `get_time_` already `const` in v2) | | `309204d5` | Rename local variables to avoid shadowing member functions (#3516) | PORTED (`logger::should_flush` uses `flush_level()`; `daily_file_sink` `new_filename` locals) | | `f2a9dec0` | Fix function arguments names different warnings (#3519) | PORTED (`spdlog::should_log(level log_level)`; v1 cfg/async renames N/A on v2) | -| `687226d9` | The upd_sink and dist_sink files have been modified to address Passed by value warnings. (#3520) | PENDING | +| `687226d9` | The upd_sink and dist_sink files have been modified to address Passed by value warnings. (#3520) | PORTED (`udp_sink` takes `const udp_sink_config &`; `dist_sink` ctor already `std::move(sinks)`) | | `472945ba` | Fix shadow member warning in example file (#3521) | PORTED (`example/example.cpp` `my_type` `value_` / ctor param) | | `6c5d6329` | Fix should_log comment (#3534) | SUPERSEDED (v2 `logger.h` already has “return true if logging is enabled…”) | | `566b2d14` | Fix #3525: Make level name matching case-insensitive (#3535) | PORTED | -| `fc7e9c87` | Update common-inl.h | PENDING | +| `fc7e9c87` | Update common-inl.h | SUPERSEDED (v2 has no `common-inl.h`; `src/common.cpp` includes `` for `level_from_str`) | | `c49c7cf9` | Allow empty DEBUG_POSTFIX property in CMakeLists (#3530) | PORTED (`DEBUG_POSTFIX "${SPDLOG_DEBUG_POSTFIX}"` — empty cache value allowed) | -| `1685e694` | Fix deprecated copy constructor usage of fmt::format_string (#3541) | PENDING | +| `1685e694` | Fix deprecated copy constructor usage of fmt::format_string (#3541) | SUPERSEDED (v2 `logger::log_with_format_` takes `const format_string_t &` and uses `fmt::vformat_to`; no `details::to_string_view(fmt)` path) | | `d5af52d9` | Fix format_string propagation (#3543) | SUPERSEDED (v2 `logger`/`spdlog` already forward `format_string_t` to `log_with_format_`) | | `0f7562a0` | tests: timezone: Provide DST rules when setting TZ on POSIX systems (#3542) | PORTED | | `1fbc60a5` | docs: fix SPDLOG_LEVEL env example (#3561) | N/A (docs-only) | From c85d68cfe9b5f880b6fdfbe0059bbd5bdd6b9211 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 10:40:24 +0200 Subject: [PATCH 19/35] parity: README fmt::format_to (#3259); triage 2670f47d d276069a 951c5b99 - Document ambiguous format_to fix in README user-defined type example - SUPERSEDED: z_formatter warning, fmt11 const formatter, rotate_now + test Made-with: Cursor --- README.md | 2 +- tasks/commits-ported.txt | 4 ++++ tasks/merge-report-v2x-v1x.md | 4 ++++ tasks/tasks-v2x-v1x-feature-parity.md | 6 +++--- tasks/v1-triage-complete.md | 8 ++++---- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 89c83611c3..cfeb959465 100644 --- a/README.md +++ b/README.md @@ -258,7 +258,7 @@ struct fmt::formatter : fmt::formatter { auto format(my_type my, format_context &ctx) const -> decltype(ctx.out()) { - return format_to(ctx.out(), "[my_type i={}]", my.i); + return fmt::format_to(ctx.out(), "[my_type i={}]", my.i); } }; diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt index 6925139cdf..31801b3274 100644 --- a/tasks/commits-ported.txt +++ b/tasks/commits-ported.txt @@ -29,6 +29,7 @@ cdbd64e2 qt_sinks: qsizetype for fromUtf8 lengths; colors_.at size_t (#3487) 6004e3d1 SPDLOG_NO_TZ_OFFSET CMake + %z placeholder + utc_minutes_offset stubs (#3483) 1774e700 309204d5 f2a9dec0 472945ba MSVC/clang hygiene: dup_filter filter_ const; should_flush/flush_level(); daily new_filename; should_log param; example my_type (#3515–#3519 #3521) 687226d9 udp_sink: const udp_sink_config& ctor (#3520); dist_sink already std::move(sinks) +1245bf8e README.md user-defined type: fmt::format_to (#3259); example already used fmt:: # SUPERSEDED (no code change): d5af52d9 format_string propagation — v2 API already correct # SUPERSEDED: 6c5d6329 should_log comment — v2 logger.h already correct # SUPERSEDED: 2aa8b6c9 file_helper write fd_ — v2 file_helper.cpp already has guard @@ -85,3 +86,6 @@ cdbd64e2 qt_sinks: qsizetype for fromUtf8 lengths; colors_.at size_t (#3487) # N/A: 57505989 tweakme SPDLOG_LEVEL_NAMES string_view_literals — no tweakme on v2 (#3291) # SUPERSEDED: fc7e9c87 common-inl.h — no common-inl.h; common.cpp has cctype # SUPERSEDED: 1685e694 fmt::format_string copy — v2 log_with_format_ + vformat_to (#3541) +# SUPERSEDED: 2670f47d z_formatter warning — pattern_formatter.cpp structure matches +# SUPERSEDED: d276069a fmt 11 formatter const — example.cpp already const +# SUPERSEDED: 951c5b99 rotate_now — rotating_file_sink.cpp + test rotating_file_logger4 diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index 9d6f8c0a58..c7c208dd2c 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -68,6 +68,10 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | `687226d9` | `udp_sink` ctor takes **`const udp_sink_config &`** (#3520). `dist_sink` already used **`std::move(sinks)`**. | `include/spdlog/sinks/udp_sink.h` | | `fc7e9c87` | *(SUPERSEDED)* `common-inl.h` add `` — v2 has no `common-inl.h`; `level_from_str` lives in `src/common.cpp` with ``. | — | | `1685e694` | *(SUPERSEDED)* Avoid deprecated `fmt::format_string` copy — v2 `logger::log_with_format_` holds `const format_string_t &` and calls `fmt::vformat_to` (no v1 `to_string_view(fmt)` indirection). | — | +| `1245bf8e` | User-defined type docs: **`fmt::format_to`** in `README.md` snippet (#3259). `example.cpp` already used `fmt::format_to`. | `README.md` | +| `2670f47d` | *(SUPERSEDED)* `z_formatter` / `-W` ordering with `SPDLOG_NO_TZ_OFFSET` — `src/pattern_formatter.cpp` already matches the v1 layout. | — | +| `d276069a` | *(SUPERSEDED)* `fmt::formatter::format` **const** for fmt 11 — `example/example.cpp` already `const`. | — | +| `951c5b99` | *(SUPERSEDED)* `rotating_file_sink::rotate_now` + test — `src/sinks/rotating_file_sink.cpp`, `tests/test_file_logging.cpp` `rotating_file_logger4`. | — | | `566b2d14` | Case-insensitive `level_from_str` (env / argv level names). | `src/common.cpp`; `tests/test_misc.cpp` | | `dd3ca04a` | Set default `CMAKE_BUILD_TYPE` only when spdlog is the top-level CMake project. | `CMakeLists.txt` | | `d5af52d9` | *(SUPERSEDED)* format_string propagation — v2.x already uses unified `format_string_t` forwarding to `log_with_format_`. | — | diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index e7062a57bf..c22a64234d 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -6,8 +6,8 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D - **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). - **Ports:** [`commits-ported.txt`](commits-ported.txt). **Full triage (245 v1-only SHAs):** [`v1-triage-complete.md`](v1-triage-complete.md) — **PORTED**, **PENDING**, **SUPERSEDED**, or **N/A** (merge commits). **All unit tests pass** (`ctest` Release, Windows). -- **Latest pass:** `687226d9` **`udp_sink`** `const udp_sink_config &` (#3520; `dist_sink` already `std::move`); **SUPERSEDED** `fc7e9c87` (no `common-inl.h`), `1685e694` (v2 `log_with_format_` / `vformat_to`). Prior: **#3514–#3521** batch. See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). -- **Triage snapshot:** **36 PORTED**, **38 SUPERSEDED**, **118 N/A**, **53 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). +- **Latest pass:** `1245bf8e` **`README.md`** `fmt::format_to` in user-defined type snippet (#3259); **SUPERSEDED** `2670f47d`, `d276069a`, `951c5b99` (already on v2). Prior: `687226d9` udp_sink, fc7e9c87 / 1685e694. See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). +- **Triage snapshot:** **37 PORTED**, **41 SUPERSEDED**, **118 N/A**, **49 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). - **Remaining:** Topical ports from `v1-commit-inventory.txt` — **fmt / CMake 5A** (bundled fmt bump, warning flags); large batches still **PENDING**. ## Relevant Files @@ -71,7 +71,7 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 4.5 Spot-check platform-specific areas called out in PRD (e.g. Windows/UWP, POSIX `TZ`, TCP) on representative configs if possible. - [ ] 5.0 Documentation, merge report, and release readiness (4B) - - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **36** ported, **38** superseded, **118** N/A, **53** **PENDING** — reclassify PENDING over time.)* + - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **37** ported, **41** superseded, **118** N/A, **49** **PENDING** — reclassify PENDING over time.)* - [x] 5.2 Write **merge report**: areas touched, conflict resolutions, rejected or deferred ports with rationale. - [ ] 5.3 Update **README** (build, fmt version, branch notes) and version header for v2.x pre-release. - [ ] 5.4 Add **migration / release notes** for downstream users (API preserved per **2A**, dependency changes per **5A**). diff --git a/tasks/v1-triage-complete.md b/tasks/v1-triage-complete.md index 34684067f9..2a7a4f513c 100644 --- a/tasks/v1-triage-complete.md +++ b/tasks/v1-triage-complete.md @@ -10,7 +10,7 @@ Source: `git log --reverse origin/v2.x..origin/v1.x` (245 commits). Integration Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (many paths removed/split), so not every v1 commit cherry-picks cleanly. -**Counts (this revision):** 36 **PORTED**, 38 **SUPERSEDED**, 118 **N/A**, 53 **PENDING**. +**Counts (this revision):** 37 **PORTED**, 41 **SUPERSEDED**, 118 **N/A**, 49 **PENDING**. | SHA | Subject | Status | |-----|---------|--------| @@ -160,7 +160,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `7cee026b` | Added tsan to ci (#3247) | N/A (v1 CI; TSAN wiring triaged separately if needed) | | `8e561337` | Version 1.15.0 | N/A (v1.x release version bump) | | `51a0deca` | docs: Removed duplicate line in daily_file_sink comment (#3249) | SUPERSEDED (duplicate `max_files` line already removed in `daily_file_sink.h` on integration branch) | -| `1245bf8e` | add explicit mt:: and std:: to avoid ambiguous call when both std::format_to and mt::format_to are present (#3259) | PENDING | +| `1245bf8e` | add explicit mt:: and std:: to avoid ambiguous call when both std::format_to and mt::format_to are present (#3259) | PORTED (`README.md` user-defined type snippet uses `fmt::format_to`; `example.cpp` already did) | | `9edab1b5` | pass /utf-8 only when compiler is MSVC (#3260) | PORTED (`$` genex on `spdlog` when `SPDLOG_MSVC_UTF8`) | | `633003f4` | Update CMakeLists.txt comment | N/A (comment-only) | | `94526fa8` | Update CMakeLists.txt comment | N/A (comment-only) | @@ -169,7 +169,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `0efef2af` | Update CMakeLists.txt comment | N/A (comment-only) | | `43dcb398` | Update CMakeLists.txt comment | N/A (comment-only) | | `15f53968` | Update null_sink to be final (#3267) | SUPERSEDED (`null_sink` already `final` in `null_sink.h`) | -| `951c5b99` | Allow manual rotation of rotating_file_sink (#3269) | PENDING | +| `951c5b99` | Allow manual rotation of rotating_file_sink (#3269) | SUPERSEDED (`rotating_file_sink::rotate_now`, `tests/test_file_logging.cpp` `rotating_file_logger4`) | | `1e6250e1` | Gabime/fwrite unlocked (#3276) | PENDING | | `65e388e8` | Adding on demand truncation for basic file sinks (#3280) | PENDING | | `24dde318` | Adding lock to rotate_now() (#3281) | PENDING | @@ -238,7 +238,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `0209b12c` | tests: fix unit tests to not be affected by custom level names (#3492) | PORTED (`tests/includes.h` — `#undef` custom level name macros before spdlog includes) | | `32dd298d` | Docs: fix misleading comment in blocking_queue header (#3504) | PORTED (`include/spdlog/details/mpmc_blocking_q.h` file header; per-method comments already correct) | | `09a674b7` | Fix %z when pattern_type_type is utc - should be +00:00 | PORTED | -| `2670f47d` | Fix warning | PENDING | +| `2670f47d` | Fix warning | SUPERSEDED (`z_formatter` in `pattern_formatter.cpp`: `SPDLOG_NO_TZ_OFFSET` vs UTC `+00:00` structure already matches v1 fix) | | `b656d1ce` | Windows utc_minutes_offset(): Fix historical DST accuracy and improve offset calculation speed (~2.5x) (#3508) | PORTED | | `79524ddd` | spdlog version 1.17.0 | N/A (v1.x release version bump) | | `6b240a89` | Replace C-style cast with reinterpret_cast in udp_client (#3509) | PORTED (`udp_client_unix.h` `send` — `reinterpret_cast`, `sizeof(sockAddr_)`) | From 9d413dc38654a56b331cc12a584aae7633ddd4a4 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 10:41:54 +0200 Subject: [PATCH 20/35] parity: lock rotate_now mutex (#3281); triage a2b42620 f355b3d5 d276069a - rotating_file_sink::rotate_now matches #3281 (sync with sink_it_) - SUPERSEDED: CMake 3.10..3.21 (v2 uses 3.23); daily test fmt::format; fmt11 const row Made-with: Cursor --- src/sinks/rotating_file_sink.cpp | 1 + tasks/commits-ported.txt | 3 +++ tasks/merge-report-v2x-v1x.md | 3 +++ tasks/tasks-v2x-v1x-feature-parity.md | 6 +++--- tasks/v1-triage-complete.md | 10 +++++----- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/sinks/rotating_file_sink.cpp b/src/sinks/rotating_file_sink.cpp index b43c462862..d652183cd3 100644 --- a/src/sinks/rotating_file_sink.cpp +++ b/src/sinks/rotating_file_sink.cpp @@ -65,6 +65,7 @@ filename_t rotating_file_sink::filename() { template void rotating_file_sink::rotate_now() { + std::lock_guard lock(base_sink::mutex_); rotate_(); } diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt index 31801b3274..75e3530889 100644 --- a/tasks/commits-ported.txt +++ b/tasks/commits-ported.txt @@ -30,6 +30,7 @@ cdbd64e2 qt_sinks: qsizetype for fromUtf8 lengths; colors_.at size_t (#3487) 1774e700 309204d5 f2a9dec0 472945ba MSVC/clang hygiene: dup_filter filter_ const; should_flush/flush_level(); daily new_filename; should_log param; example my_type (#3515–#3519 #3521) 687226d9 udp_sink: const udp_sink_config& ctor (#3520); dist_sink already std::move(sinks) 1245bf8e README.md user-defined type: fmt::format_to (#3259); example already used fmt:: +24dde318 rotating_file_sink::rotate_now: lock mutex (#3281) # SUPERSEDED (no code change): d5af52d9 format_string propagation — v2 API already correct # SUPERSEDED: 6c5d6329 should_log comment — v2 logger.h already correct # SUPERSEDED: 2aa8b6c9 file_helper write fd_ — v2 file_helper.cpp already has guard @@ -89,3 +90,5 @@ cdbd64e2 qt_sinks: qsizetype for fromUtf8 lengths; colors_.at size_t (#3487) # SUPERSEDED: 2670f47d z_formatter warning — pattern_formatter.cpp structure matches # SUPERSEDED: d276069a fmt 11 formatter const — example.cpp already const # SUPERSEDED: 951c5b99 rotate_now — rotating_file_sink.cpp + test rotating_file_logger4 +# SUPERSEDED: a2b42620 cmake_minimum 3.10..3.21 — v2 requires 3.23 (#3029) +# SUPERSEDED: f355b3d5 test_daily custom calculator — test_daily_and_rotation_loggers.cpp uses fmt::format diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index c7c208dd2c..65aa4fe3d8 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -72,6 +72,9 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | `2670f47d` | *(SUPERSEDED)* `z_formatter` / `-W` ordering with `SPDLOG_NO_TZ_OFFSET` — `src/pattern_formatter.cpp` already matches the v1 layout. | — | | `d276069a` | *(SUPERSEDED)* `fmt::formatter::format` **const** for fmt 11 — `example/example.cpp` already `const`. | — | | `951c5b99` | *(SUPERSEDED)* `rotating_file_sink::rotate_now` + test — `src/sinks/rotating_file_sink.cpp`, `tests/test_file_logging.cpp` `rotating_file_logger4`. | — | +| `24dde318` | `rotating_file_sink::rotate_now` takes **`std::lock_guard`** before `rotate_()` (#3281). | `src/sinks/rotating_file_sink.cpp` | +| `a2b42620` | *(SUPERSEDED)* `cmake_minimum_required` range for FetchContent — v2 requires **CMake 3.23**. | — | +| `f355b3d5` | *(SUPERSEDED)* daily logger test uses `fmt::format` for custom calculator — `tests/test_daily_and_rotation_loggers.cpp` already matches. | — | | `566b2d14` | Case-insensitive `level_from_str` (env / argv level names). | `src/common.cpp`; `tests/test_misc.cpp` | | `dd3ca04a` | Set default `CMAKE_BUILD_TYPE` only when spdlog is the top-level CMake project. | `CMakeLists.txt` | | `d5af52d9` | *(SUPERSEDED)* format_string propagation — v2.x already uses unified `format_string_t` forwarding to `log_with_format_`. | — | diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index c22a64234d..cce3564fcb 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -6,8 +6,8 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D - **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). - **Ports:** [`commits-ported.txt`](commits-ported.txt). **Full triage (245 v1-only SHAs):** [`v1-triage-complete.md`](v1-triage-complete.md) — **PORTED**, **PENDING**, **SUPERSEDED**, or **N/A** (merge commits). **All unit tests pass** (`ctest` Release, Windows). -- **Latest pass:** `1245bf8e` **`README.md`** `fmt::format_to` in user-defined type snippet (#3259); **SUPERSEDED** `2670f47d`, `d276069a`, `951c5b99` (already on v2). Prior: `687226d9` udp_sink, fc7e9c87 / 1685e694. See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). -- **Triage snapshot:** **37 PORTED**, **41 SUPERSEDED**, **118 N/A**, **49 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). +- **Latest pass:** `24dde318` **`rotate_now`** mutex lock (#3281); **SUPERSEDED** `a2b42620` (CMake min), `f355b3d5` (daily test), triage row **`d276069a`**. Prior: `1245bf8e` README. See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). +- **Triage snapshot:** **38 PORTED**, **44 SUPERSEDED**, **118 N/A**, **45 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). - **Remaining:** Topical ports from `v1-commit-inventory.txt` — **fmt / CMake 5A** (bundled fmt bump, warning flags); large batches still **PENDING**. ## Relevant Files @@ -71,7 +71,7 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 4.5 Spot-check platform-specific areas called out in PRD (e.g. Windows/UWP, POSIX `TZ`, TCP) on representative configs if possible. - [ ] 5.0 Documentation, merge report, and release readiness (4B) - - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **37** ported, **41** superseded, **118** N/A, **49** **PENDING** — reclassify PENDING over time.)* + - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **38** ported, **44** superseded, **118** N/A, **45** **PENDING** — reclassify PENDING over time.)* - [x] 5.2 Write **merge report**: areas touched, conflict resolutions, rejected or deferred ports with rationale. - [ ] 5.3 Update **README** (build, fmt version, branch notes) and version header for v2.x pre-release. - [ ] 5.4 Add **migration / release notes** for downstream users (API preserved per **2A**, dependency changes per **5A**). diff --git a/tasks/v1-triage-complete.md b/tasks/v1-triage-complete.md index 2a7a4f513c..8503bcdeff 100644 --- a/tasks/v1-triage-complete.md +++ b/tasks/v1-triage-complete.md @@ -10,7 +10,7 @@ Source: `git log --reverse origin/v2.x..origin/v1.x` (245 commits). Integration Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (many paths removed/split), so not every v1 commit cherry-picks cleanly. -**Counts (this revision):** 37 **PORTED**, 41 **SUPERSEDED**, 118 **N/A**, 49 **PENDING**. +**Counts (this revision):** 38 **PORTED**, 44 **SUPERSEDED**, 118 **N/A**, 45 **PENDING**. | SHA | Subject | Status | |-----|---------|--------| @@ -88,7 +88,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `cba66029` | Update mdc | PENDING | | `1253a57d` | Add mdc support for default format | PENDING | | `8fed530b` | Update mdc.h | PENDING | -| `a2b42620` | Update CMakeLists.txt to fix #3029 | PENDING | +| `a2b42620` | Update CMakeLists.txt to fix #3029 | SUPERSEDED (v2 `cmake_minimum_required(VERSION 3.23)` — supersedes v1 `3.10...3.21`) | | `1e7d7e07` | Updated bundled fmt to 10.2.1 | PENDING | | `e3f5a4fe` | Update cmake to define FMT_LIB_EXPORT when building shared lib | SUPERSEDED (v2 links `fmt::fmt` from FetchContent / external; fmt target owns `FMT_*` exports — not inlined bundled fmt in `spdlog`) | | `a0d2187d` | README.md has include missing (#3066) | N/A (docs-only) | @@ -111,7 +111,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `27cb4c76` | Added mdc example to readme | N/A (docs; v2 has no MDC yet) | | `c3aed4b6` | Add wide character formatting and output support to wincolor_sink. (#3092) | PENDING | | `eeb22c13` | Allow customization of syslog_sink (#3124) | SUPERSEDED (`syslog_sink.h` — `virtual syslog_prio_from_level`, `levels_array` protected) | -| `d276069a` | make example compatible with fmt 11 (#3130) | PENDING | +| `d276069a` | make example compatible with fmt 11 (#3130) | SUPERSEDED (`example/example.cpp` `fmt::formatter::format` already `const`) | | `885b5473` | Fix building with `FMT_ENFORCE_COMPILE_STRING` (#3137) | PENDING | | `5ebfc927` | fix: set `/Zc:__cplusplus` and `/MP` to MSVC only (#3139) | SUPERSEDED (`CMakeLists.txt` already uses `CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"` for `/Zc:__cplusplus` and `/MP`) | | `a3a0c9d6` | compilation error gcc 8.5 with [-Werror=suggest-override] (#3158) | SUPERSEDED (`base_sink.h` already `final override` on `log`/`flush`/`set_pattern`/`set_formatter`) | @@ -172,7 +172,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `951c5b99` | Allow manual rotation of rotating_file_sink (#3269) | SUPERSEDED (`rotating_file_sink::rotate_now`, `tests/test_file_logging.cpp` `rotating_file_logger4`) | | `1e6250e1` | Gabime/fwrite unlocked (#3276) | PENDING | | `65e388e8` | Adding on demand truncation for basic file sinks (#3280) | PENDING | -| `24dde318` | Adding lock to rotate_now() (#3281) | PENDING | +| `24dde318` | Adding lock to rotate_now() (#3281) | PORTED (`std::lock_guard` in `rotating_file_sink::rotate_now`) | | `276ee5f5` | fix: update to_string_view function for fmt 11.1 (#3301) | PENDING | | `7f8060d5` | fix: Compatibility with external fmtlib 11.1.1 (#3312) | PENDING | | `96a8f625` | fix: remove unused to_string_view overload in fmt >= 11.1 (#3314) | PENDING | @@ -184,7 +184,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `ae1de0dc` | Support custom environment variables for load_env_levels (#3327) | N/A (v2 has no `spdlog/cfg/` — `load_env_levels` not present) | | `3c23c27d` | Revert "fix: Compatibility with external fmtlib 11.1.1 (#3312)" (#3331) | PENDING | | `ac432c36` | Gabime/v1.15.1 (#3332) | N/A (v1.x release / tag commit) | -| `f355b3d5` | Fix test_daily_logger | PENDING | +| `f355b3d5` | Fix test_daily_logger | SUPERSEDED (v2 `tests/test_daily_and_rotation_loggers.cpp` — `fmt_lib::format` in custom calculator; no `SPDLOG_BUF_TO_STRING`) | | `3335c380` | Update README.md (#3338) | N/A (docs-only) | | `10320184` | Fixed issue #3360 (#3361) | SUPERSEDED (scoped_padder truncate clamp; `%D` field width — already in `pattern_formatter.cpp`) | | `faa0a7a9` | Bump fmt to version 11.1.4 | PENDING | From 9af3bcc42cf275fd4108e075c1ef77696bcb66f6 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 10:43:18 +0200 Subject: [PATCH 21/35] parity: basic_file_sink::truncate (#3280); triage fwrite/fmt/test batch - truncate(): lock + file_helper::reopen(true) - test basic_file_sink_truncate - SUPERSEDED: b7e0e2c2 71925ca3 fa6605dc 885b5473 96c9a62b 1e6250e1 d7155530 Made-with: Cursor --- include/spdlog/sinks/basic_file_sink.h | 1 + src/sinks/basic_file_sink.cpp | 6 ++++++ tasks/commits-ported.txt | 7 +++++++ tasks/merge-report-v2x-v1x.md | 8 ++++++++ tasks/tasks-v2x-v1x-feature-parity.md | 6 +++--- tasks/v1-triage-complete.md | 18 +++++++++--------- tests/test_file_logging.cpp | 20 ++++++++++++++++++++ 7 files changed, 54 insertions(+), 12 deletions(-) diff --git a/include/spdlog/sinks/basic_file_sink.h b/include/spdlog/sinks/basic_file_sink.h index 3377061a8c..fe68af3d96 100644 --- a/include/spdlog/sinks/basic_file_sink.h +++ b/include/spdlog/sinks/basic_file_sink.h @@ -20,6 +20,7 @@ class basic_file_sink final : public base_sink { public: explicit basic_file_sink(const filename_t &filename, bool truncate = false, const file_event_handlers &event_handlers = {}); const filename_t &filename() const; + void truncate(); protected: void sink_it_(const details::log_msg &msg) override; diff --git a/src/sinks/basic_file_sink.cpp b/src/sinks/basic_file_sink.cpp index d324427fc1..9443ba8662 100644 --- a/src/sinks/basic_file_sink.cpp +++ b/src/sinks/basic_file_sink.cpp @@ -21,6 +21,12 @@ const filename_t &basic_file_sink::filename() const { return file_helper_.filename(); } +template +void basic_file_sink::truncate() { + std::lock_guard lock(base_sink::mutex_); + file_helper_.reopen(true); +} + template void basic_file_sink::sink_it_(const details::log_msg &msg) { memory_buf_t formatted; diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt index 75e3530889..fe6c083274 100644 --- a/tasks/commits-ported.txt +++ b/tasks/commits-ported.txt @@ -31,6 +31,7 @@ cdbd64e2 qt_sinks: qsizetype for fromUtf8 lengths; colors_.at size_t (#3487) 687226d9 udp_sink: const udp_sink_config& ctor (#3520); dist_sink already std::move(sinks) 1245bf8e README.md user-defined type: fmt::format_to (#3259); example already used fmt:: 24dde318 rotating_file_sink::rotate_now: lock mutex (#3281) +65e388e8 basic_file_sink::truncate() + test (#3280) # SUPERSEDED (no code change): d5af52d9 format_string propagation — v2 API already correct # SUPERSEDED: 6c5d6329 should_log comment — v2 logger.h already correct # SUPERSEDED: 2aa8b6c9 file_helper write fd_ — v2 file_helper.cpp already has guard @@ -92,3 +93,9 @@ cdbd64e2 qt_sinks: qsizetype for fromUtf8 lengths; colors_.at size_t (#3487) # SUPERSEDED: 951c5b99 rotate_now — rotating_file_sink.cpp + test rotating_file_logger4 # SUPERSEDED: a2b42620 cmake_minimum 3.10..3.21 — v2 requires 3.23 (#3029) # SUPERSEDED: f355b3d5 test_daily custom calculator — test_daily_and_rotation_loggers.cpp uses fmt::format +# SUPERSEDED: b7e0e2c2 #3073 source_loc::empty — v2 source_loc.h (unsigned line + null checks) +# SUPERSEDED: 71925ca3 FMT_DEPRECATED_* in fmt.h — v2 fmt via common.h / no v1 fmt.h shim +# SUPERSEDED: fa6605dc test_create_dir comment — already fixed +# SUPERSEDED: 885b5473 FMT_ENFORCE_COMPILE_STRING — rotating calc_filename uses ostringstream (#3137) +# SUPERSEDED: 96c9a62b clone async race — test_misc uses test_sink_mt +# SUPERSEDED: 1e6250e1 d7155530 fwrite_bytes + CMake SPDLOG_FWRITE_UNLOCKED diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index 65aa4fe3d8..4e9a1d6242 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -75,6 +75,14 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | `24dde318` | `rotating_file_sink::rotate_now` takes **`std::lock_guard`** before `rotate_()` (#3281). | `src/sinks/rotating_file_sink.cpp` | | `a2b42620` | *(SUPERSEDED)* `cmake_minimum_required` range for FetchContent — v2 requires **CMake 3.23**. | — | | `f355b3d5` | *(SUPERSEDED)* daily logger test uses `fmt::format` for custom calculator — `tests/test_daily_and_rotation_loggers.cpp` already matches. | — | +| `65e388e8` | `basic_file_sink::truncate()` — lock + `file_helper_.reopen(true)` (#3280). | `include/spdlog/sinks/basic_file_sink.h`, `src/sinks/basic_file_sink.cpp`, `tests/test_file_logging.cpp` | +| `b7e0e2c2` | *(SUPERSEDED)* `#3073` `source_loc::empty` — v2 uses `uint_least32_t` line and null checks (`source_loc.h`). | — | +| `71925ca3` | *(SUPERSEDED)* drop `FMT_DEPRECATED_*` from bundled fmt shim — v2 has no v1 `spdlog/fmt/fmt.h` block. | — | +| `fa6605dc` | *(SUPERSEDED)* `test_create_dir` comment typo — already fixed. | — | +| `885b5473` | *(SUPERSEDED)* `FMT_ENFORCE_COMPILE_STRING` + rotating `calc_filename` — v2 builds filename via `ostringstream` (`rotating_file_sink.cpp`). | — | +| `96c9a62b` | *(SUPERSEDED)* async clone test race — `test_misc.cpp` uses `test_sink_mt`. | — | +| `1e6250e1` | *(SUPERSEDED)* `fwrite_bytes` / non-locking fwrite — `os_unix.cpp`, `os_windows.cpp`, `file_helper`, CMake. | — | +| `d7155530` | *(SUPERSEDED)* `SPDLOG_FWRITE_UNLOCKED` from symbol check — same CMake path as above. | — | | `566b2d14` | Case-insensitive `level_from_str` (env / argv level names). | `src/common.cpp`; `tests/test_misc.cpp` | | `dd3ca04a` | Set default `CMAKE_BUILD_TYPE` only when spdlog is the top-level CMake project. | `CMakeLists.txt` | | `d5af52d9` | *(SUPERSEDED)* format_string propagation — v2.x already uses unified `format_string_t` forwarding to `log_with_format_`. | — | diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index cce3564fcb..126a281e0e 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -6,8 +6,8 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D - **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). - **Ports:** [`commits-ported.txt`](commits-ported.txt). **Full triage (245 v1-only SHAs):** [`v1-triage-complete.md`](v1-triage-complete.md) — **PORTED**, **PENDING**, **SUPERSEDED**, or **N/A** (merge commits). **All unit tests pass** (`ctest` Release, Windows). -- **Latest pass:** `24dde318` **`rotate_now`** mutex lock (#3281); **SUPERSEDED** `a2b42620` (CMake min), `f355b3d5` (daily test), triage row **`d276069a`**. Prior: `1245bf8e` README. See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). -- **Triage snapshot:** **38 PORTED**, **44 SUPERSEDED**, **118 N/A**, **45 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). +- **Latest pass:** `65e388e8` **`basic_file_sink::truncate`** + test (#3280); **SUPERSEDED** batch: `b7e0e2c2`, `71925ca3`, `fa6605dc`, `885b5473`, `96c9a62b`, `1e6250e1`, `d7155530`. Prior: `24dde318` rotate_now lock. See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). +- **Triage snapshot:** **39 PORTED**, **51 SUPERSEDED**, **118 N/A**, **37 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). - **Remaining:** Topical ports from `v1-commit-inventory.txt` — **fmt / CMake 5A** (bundled fmt bump, warning flags); large batches still **PENDING**. ## Relevant Files @@ -71,7 +71,7 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 4.5 Spot-check platform-specific areas called out in PRD (e.g. Windows/UWP, POSIX `TZ`, TCP) on representative configs if possible. - [ ] 5.0 Documentation, merge report, and release readiness (4B) - - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **38** ported, **44** superseded, **118** N/A, **45** **PENDING** — reclassify PENDING over time.)* + - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **39** ported, **51** superseded, **118** N/A, **37** **PENDING** — reclassify PENDING over time.)* - [x] 5.2 Write **merge report**: areas touched, conflict resolutions, rejected or deferred ports with rationale. - [ ] 5.3 Update **README** (build, fmt version, branch notes) and version header for v2.x pre-release. - [ ] 5.4 Add **migration / release notes** for downstream users (API preserved per **2A**, dependency changes per **5A**). diff --git a/tasks/v1-triage-complete.md b/tasks/v1-triage-complete.md index 8503bcdeff..90eaa6c773 100644 --- a/tasks/v1-triage-complete.md +++ b/tasks/v1-triage-complete.md @@ -10,7 +10,7 @@ Source: `git log --reverse origin/v2.x..origin/v1.x` (245 commits). Integration Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (many paths removed/split), so not every v1 commit cherry-picks cleanly. -**Counts (this revision):** 38 **PORTED**, 44 **SUPERSEDED**, 118 **N/A**, 45 **PENDING**. +**Counts (this revision):** 39 **PORTED**, 51 **SUPERSEDED**, 118 **N/A**, 37 **PENDING**. | SHA | Subject | Status | |-----|---------|--------| @@ -92,17 +92,17 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `1e7d7e07` | Updated bundled fmt to 10.2.1 | PENDING | | `e3f5a4fe` | Update cmake to define FMT_LIB_EXPORT when building shared lib | SUPERSEDED (v2 links `fmt::fmt` from FetchContent / external; fmt target owns `FMT_*` exports — not inlined bundled fmt in `spdlog`) | | `a0d2187d` | README.md has include missing (#3066) | N/A (docs-only) | -| `b7e0e2c2` | Fix #3073 | PENDING | +| `b7e0e2c2` | Fix #3073 | SUPERSEDED (v2 `source_loc::line` is unsigned; `empty()` also checks `filename`/`short_filename` — `include/spdlog/source_loc.h`) | | `dd6c9c6e` | Update comment | N/A (comment-only) | | `66ac83e7` | Update gitginore to ignore .vs and out/build | SUPERSEDED (`.gitignore` already has `/.vs`, `/out/build`) | | `fd61ea93` | Merge branch 'v1.x' of https://github.com/gabime/spdlog into v1.x | N/A (merge commit) | -| `71925ca3` | Revmoed definition of deprecated fmt macros | PENDING | +| `71925ca3` | Revmoed definition of deprecated fmt macros | SUPERSEDED (v2 has no v1 `spdlog/fmt/fmt.h` shim with `FMT_DEPRECATED_*`; includes `fmt/base.h` via `common.h`) | | `a34e08c7` | Added CMakeSettings.json to gitignore | SUPERSEDED (`.gitignore` already has `/CMakeSettings.json`) | | `3403f278` | Don't remove previous defaullt logger from registry in set_default_logger. Fix #3016 | N/A (v2 uses `set_global_logger` / single global logger, not v1 registry) | | `3b4c775b` | Update comment about set_default_logger | N/A (v1 registry API; v2 uses `set_global_logger`) | | `238c9ffa` | Bump spdlog to version 1.14.0 | N/A (v1.x release version bump) | | `94a8e87c` | Fix #3079 | SUPERSEDED (`create_dir` in `os_filesystem.cpp` uses `std::filesystem::create_directories`; Windows tests in `test_create_dir.cpp` already present) | -| `fa6605dc` | Fix compile | PENDING | +| `fa6605dc` | Fix compile | SUPERSEDED (`tests/test_create_dir.cpp` Windows comment already ends `C:\\some-folder` without stray `\`) | | `37b84769` | Revert pr #3023 (std::string_view overloads for logger accessor for c++17) | N/A (revert of `5532231b`; registry not on v2) | | `22b0f4fc` | Clang format | N/A (formatting only) | | `2122eb21` | Update spdlog version to 1.14.1 | N/A (v1.x release version bump) | @@ -112,7 +112,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `c3aed4b6` | Add wide character formatting and output support to wincolor_sink. (#3092) | PENDING | | `eeb22c13` | Allow customization of syslog_sink (#3124) | SUPERSEDED (`syslog_sink.h` — `virtual syslog_prio_from_level`, `levels_array` protected) | | `d276069a` | make example compatible with fmt 11 (#3130) | SUPERSEDED (`example/example.cpp` `fmt::formatter::format` already `const`) | -| `885b5473` | Fix building with `FMT_ENFORCE_COMPILE_STRING` (#3137) | PENDING | +| `885b5473` | Fix building with `FMT_ENFORCE_COMPILE_STRING` (#3137) | SUPERSEDED (`rotating_file_sink::calc_filename` builds path via `ostringstream`, not `fmt::format` literal — `rotating_file_sink.cpp`) | | `5ebfc927` | fix: set `/Zc:__cplusplus` and `/MP` to MSVC only (#3139) | SUPERSEDED (`CMakeLists.txt` already uses `CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"` for `/Zc:__cplusplus` and `/MP`) | | `a3a0c9d6` | compilation error gcc 8.5 with [-Werror=suggest-override] (#3158) | SUPERSEDED (`base_sink.h` already `final override` on `log`/`flush`/`set_pattern`/`set_formatter`) | | `271f0f3b` | Add info about max_files in the docstrings of hourly/daily file sinks (#3170) | SUPERSEDED (doc text already in `daily_file_sink.h` / `hourly_file_sink.h`; removed duplicate `max_files` line in daily) | @@ -128,7 +128,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `b6da5944` | Ensure flush callback gets called in move-assign operator (#3232) | PENDING | | `63d18842` | Gabime/async flush (#3235) | PENDING | | `85bdab0c` | Update bundled fmt to 11.0.2 (#3236) | PENDING | -| `96c9a62b` | Fixed race condition in tests | PENDING | +| `96c9a62b` | Fixed race condition in tests | SUPERSEDED (`tests/test_misc.cpp` “clone async” uses `test_sink_mt` / `async_sink`) | | `9fe79692` | Gabime/tsan (#3237) | PENDING | | `7a950e02` | add /utf-8 flag for msvc | PORTED (`CMakeLists.txt` — `SPDLOG_MSVC_UTF8` + MSVC-only genex; see `9edab1b5`) | | `d3730937` | Better support for FMT_UNICODE in cmake | N/A (pair with `a5cfbf36` revert; triage **FMT_UNICODE** under **5A**) | @@ -170,14 +170,14 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `43dcb398` | Update CMakeLists.txt comment | N/A (comment-only) | | `15f53968` | Update null_sink to be final (#3267) | SUPERSEDED (`null_sink` already `final` in `null_sink.h`) | | `951c5b99` | Allow manual rotation of rotating_file_sink (#3269) | SUPERSEDED (`rotating_file_sink::rotate_now`, `tests/test_file_logging.cpp` `rotating_file_logger4`) | -| `1e6250e1` | Gabime/fwrite unlocked (#3276) | PENDING | -| `65e388e8` | Adding on demand truncation for basic file sinks (#3280) | PENDING | +| `1e6250e1` | Gabime/fwrite unlocked (#3276) | SUPERSEDED (`details::os::fwrite_bytes`, `CMakeLists.txt` `HAVE_FWRITE_UNLOCKED`, `file_helper` / sinks) | +| `65e388e8` | Adding on demand truncation for basic file sinks (#3280) | PORTED (`basic_file_sink::truncate`, `tests/test_file_logging.cpp` `basic_file_sink_truncate`) | | `24dde318` | Adding lock to rotate_now() (#3281) | PORTED (`std::lock_guard` in `rotating_file_sink::rotate_now`) | | `276ee5f5` | fix: update to_string_view function for fmt 11.1 (#3301) | PENDING | | `7f8060d5` | fix: Compatibility with external fmtlib 11.1.1 (#3312) | PENDING | | `96a8f625` | fix: remove unused to_string_view overload in fmt >= 11.1 (#3314) | PENDING | | `ad0f31c0` | Enabled bin_to_hex utest for stdformat, fixed std::formatter (#3315) | PENDING | -| `d7155530` | Added SPDLOG_FWRITE_UNLOCKED option to CMakeLists.txt (#3318) | PENDING | +| `d7155530` | Added SPDLOG_FWRITE_UNLOCKED option to CMakeLists.txt (#3318) | SUPERSEDED (same `CheckSymbolExists` / `SPDLOG_FWRITE_UNLOCKED` wiring as `1e6250e1` on v2) | | `96a7d2a1` | Format CMakeLists.txt | N/A (formatting only) | | `57505989` | SPDLOG_LEVEL_NAMES, comment use string_view_literals (#3291) | N/A (v2 has no `tweakme.h` / `SPDLOG_LEVEL_NAMES`; levels in `common.h`) | | `7cbf2a69` | Gabime/ansicolor sink improvements (#3323) | PORTED (`src/sinks/ansicolor_sink.cpp` — `set_color_mode` holds mutex, `set_color_mode_` does not; fixes double-lock vs v1 pattern; const helpers already present) | diff --git a/tests/test_file_logging.cpp b/tests/test_file_logging.cpp index 56c7650ebb..2fcaa852f2 100644 --- a/tests/test_file_logging.cpp +++ b/tests/test_file_logging.cpp @@ -41,6 +41,26 @@ TEST_CASE("flush_on", "[flush_on]") { default_eol, default_eol, default_eol)); } +TEST_CASE("basic_file_sink_truncate", "[truncate]") { + prepare_logdir(); + const spdlog::filename_t filename = SPDLOG_FILENAME_T(SIMPLE_LOG); + const bool truncate = true; + const auto sink = std::make_shared(filename, truncate); + const auto logger = std::make_shared("simple_file_logger", sink); + + logger->info("Test message {}", 3.14); + logger->info("Test message {}", 2.71); + logger->flush(); + REQUIRE(count_lines(SIMPLE_LOG) == 2); + + sink->truncate(); + REQUIRE(count_lines(SIMPLE_LOG) == 0); + + logger->info("Test message {}", 6.28); + logger->flush(); + REQUIRE(count_lines(SIMPLE_LOG) == 1); +} + TEST_CASE("rotating_file_logger1", "[rotating_logger]") { prepare_logdir(); size_t max_size = 1024 * 10; From dff6fa100ba6de59aacc4dbbef6ed4e256219d81 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 10:44:43 +0200 Subject: [PATCH 22/35] parity: test_sink/callback iterator cast (#3315); triage Catch2 #3038 - difference_type cast for formatted.end() - eol_len (ad0f31c0) - SUPERSEDED: c1569a3d Catch2 v3.5.0, 73e2e02b wstr_to_utf8buf bounds Made-with: Cursor --- tasks/commits-ported.txt | 3 +++ tasks/merge-report-v2x-v1x.md | 3 +++ tasks/tasks-v2x-v1x-feature-parity.md | 6 +++--- tasks/v1-triage-complete.md | 8 ++++---- tests/test_custom_callbacks.cpp | 6 +++++- tests/test_sink.h | 4 +++- 6 files changed, 21 insertions(+), 9 deletions(-) diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt index fe6c083274..9984b21f56 100644 --- a/tasks/commits-ported.txt +++ b/tasks/commits-ported.txt @@ -32,6 +32,7 @@ cdbd64e2 qt_sinks: qsizetype for fromUtf8 lengths; colors_.at size_t (#3487) 1245bf8e README.md user-defined type: fmt::format_to (#3259); example already used fmt:: 24dde318 rotating_file_sink::rotate_now: lock mutex (#3281) 65e388e8 basic_file_sink::truncate() + test (#3280) +ad0f31c0 test_sink + callback_sink tests: iterator_traits cast for end()-eol (#3315) # SUPERSEDED (no code change): d5af52d9 format_string propagation — v2 API already correct # SUPERSEDED: 6c5d6329 should_log comment — v2 logger.h already correct # SUPERSEDED: 2aa8b6c9 file_helper write fd_ — v2 file_helper.cpp already has guard @@ -99,3 +100,5 @@ cdbd64e2 qt_sinks: qsizetype for fromUtf8 lengths; colors_.at size_t (#3487) # SUPERSEDED: 885b5473 FMT_ENFORCE_COMPILE_STRING — rotating calc_filename uses ostringstream (#3137) # SUPERSEDED: 96c9a62b clone async race — test_misc uses test_sink_mt # SUPERSEDED: 1e6250e1 d7155530 fwrite_bytes + CMake SPDLOG_FWRITE_UNLOCKED +# SUPERSEDED: c1569a3d Catch2 v3.5.0 — tests/CMakeLists.txt GIT_TAG +# SUPERSEDED: 73e2e02b #3038 wstr_to_utf8buf — os_windows.cpp /4 and *4 diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index 4e9a1d6242..4b791a97ed 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -83,6 +83,9 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | `96c9a62b` | *(SUPERSEDED)* async clone test race — `test_misc.cpp` uses `test_sink_mt`. | — | | `1e6250e1` | *(SUPERSEDED)* `fwrite_bytes` / non-locking fwrite — `os_unix.cpp`, `os_windows.cpp`, `file_helper`, CMake. | — | | `d7155530` | *(SUPERSEDED)* `SPDLOG_FWRITE_UNLOCKED` from symbol check — same CMake path as above. | — | +| `c1569a3d` | *(SUPERSEDED)* Catch2 **v3.5.0** — `tests/CMakeLists.txt` `FetchContent` `GIT_TAG`. | — | +| `73e2e02b` | *(SUPERSEDED)* `#3038` / `#3044` UTF-16→UTF-8 size checks — `wstr_to_utf8buf` in `os_windows.cpp`. | — | +| `ad0f31c0` | `test_sink` / callback tests: **`iterator_traits::difference_type`** cast for `end() - eol_len` (#3315). | `tests/test_sink.h`, `tests/test_custom_callbacks.cpp` | | `566b2d14` | Case-insensitive `level_from_str` (env / argv level names). | `src/common.cpp`; `tests/test_misc.cpp` | | `dd3ca04a` | Set default `CMAKE_BUILD_TYPE` only when spdlog is the top-level CMake project. | `CMakeLists.txt` | | `d5af52d9` | *(SUPERSEDED)* format_string propagation — v2.x already uses unified `format_string_t` forwarding to `log_with_format_`. | — | diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index 126a281e0e..ab66277967 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -6,8 +6,8 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D - **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). - **Ports:** [`commits-ported.txt`](commits-ported.txt). **Full triage (245 v1-only SHAs):** [`v1-triage-complete.md`](v1-triage-complete.md) — **PORTED**, **PENDING**, **SUPERSEDED**, or **N/A** (merge commits). **All unit tests pass** (`ctest` Release, Windows). -- **Latest pass:** `65e388e8` **`basic_file_sink::truncate`** + test (#3280); **SUPERSEDED** batch: `b7e0e2c2`, `71925ca3`, `fa6605dc`, `885b5473`, `96c9a62b`, `1e6250e1`, `d7155530`. Prior: `24dde318` rotate_now lock. See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). -- **Triage snapshot:** **39 PORTED**, **51 SUPERSEDED**, **118 N/A**, **37 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). +- **Latest pass:** `ad0f31c0` test **iterator** cast (#3315); **SUPERSEDED** `c1569a3d` (Catch2 3.5.0), `73e2e02b` (#3038 UTF-16→UTF-8 bounds). Prior: `65e388e8` truncate. See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). +- **Triage snapshot:** **40 PORTED**, **53 SUPERSEDED**, **118 N/A**, **34 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). - **Remaining:** Topical ports from `v1-commit-inventory.txt` — **fmt / CMake 5A** (bundled fmt bump, warning flags); large batches still **PENDING**. ## Relevant Files @@ -71,7 +71,7 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 4.5 Spot-check platform-specific areas called out in PRD (e.g. Windows/UWP, POSIX `TZ`, TCP) on representative configs if possible. - [ ] 5.0 Documentation, merge report, and release readiness (4B) - - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **39** ported, **51** superseded, **118** N/A, **37** **PENDING** — reclassify PENDING over time.)* + - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **40** ported, **53** superseded, **118** N/A, **34** **PENDING** — reclassify PENDING over time.)* - [x] 5.2 Write **merge report**: areas touched, conflict resolutions, rejected or deferred ports with rationale. - [ ] 5.3 Update **README** (build, fmt version, branch notes) and version header for v2.x pre-release. - [ ] 5.4 Add **migration / release notes** for downstream users (API preserved per **2A**, dependency changes per **5A**). diff --git a/tasks/v1-triage-complete.md b/tasks/v1-triage-complete.md index 90eaa6c773..0a55632b55 100644 --- a/tasks/v1-triage-complete.md +++ b/tasks/v1-triage-complete.md @@ -10,7 +10,7 @@ Source: `git log --reverse origin/v2.x..origin/v1.x` (245 commits). Integration Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (many paths removed/split), so not every v1 commit cherry-picks cleanly. -**Counts (this revision):** 39 **PORTED**, 51 **SUPERSEDED**, 118 **N/A**, 37 **PENDING**. +**Counts (this revision):** 40 **PORTED**, 53 **SUPERSEDED**, 118 **N/A**, 34 **PENDING**. | SHA | Subject | Status | |-----|---------|--------| @@ -44,7 +44,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `ddce4215` | fmt/*.h: include tweakme.h to set SPDLOG_FMT_EXTERNAL according to system (#2923) | N/A (v2 has no `tweakme.h`; fmt wiring is CMake-driven) | | `ac55e604` | Update README.md | N/A (docs-only) | | `ba508057` | Update example.cpp to fix the vector issue in bin_example (#2963) | SUPERSEDED (`example/example.cpp` `binary_example` uses `push_back`; not `vector(80)`) | -| `c1569a3d` | Bump to catch2 v3.5.0 | PENDING | +| `c1569a3d` | Bump to catch2 v3.5.0 | SUPERSEDED (`tests/CMakeLists.txt` FetchContent `GIT_TAG` … `v3.5.0`) | | `1ef8d3ce` | Fix #2967 | SUPERSEDED (`LICENSE` fmt URL already `raw.githubusercontent.com/.../LICENSE`) | | `7cb90d1a` | Fix MSVC compile flag for no exceptions (#2974) | N/A (v2 `CMakeLists.txt` has no `SPDLOG_NO_EXCEPTIONS` / `-fno-exceptions` wiring; add when porting that option) | | `2aa8b6c9` | Check fd_ is not nullptr in file_helper | SUPERSEDED (`src/details/file_helper.cpp` `write` already guards `fd_ == nullptr`) | @@ -73,7 +73,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `819eb27c` | Use find if registry is bigger than 10 in registry::get(std::string_view logger_name) | N/A (same) | | `23587b0d` | Fixed regisry-inl.h | N/A (same) | | `d03eb40c` | Added Mapped Diagnostic Context (MDC) support (#2907) | PENDING | -| `73e2e02b` | Fix #3038 (#3044) | PENDING | +| `73e2e02b` | Fix #3038 (#3044) | SUPERSEDED (`src/details/os_windows.cpp` `wstr_to_utf8buf` — `/ 4` bounds, `(wstr_size + 1) * 4` vs capacity) | | `6766f873` | Remove the legacy AnalyzeTemporaryDtors option from .clang-tidy. (#3048) | SUPERSEDED (`.clang-tidy` on v2 does not set `AnalyzeTemporaryDtors`) | | `6725584e` | Make async_logger::flush() synchronous and wait for the flush to complete (#3049) | PENDING | | `c9ce17ab` | INSTALL.md has been updated to provide current status information. (#3052) | N/A (no `INSTALL.md` on v2 tree) | @@ -176,7 +176,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `276ee5f5` | fix: update to_string_view function for fmt 11.1 (#3301) | PENDING | | `7f8060d5` | fix: Compatibility with external fmtlib 11.1.1 (#3312) | PENDING | | `96a8f625` | fix: remove unused to_string_view overload in fmt >= 11.1 (#3314) | PENDING | -| `ad0f31c0` | Enabled bin_to_hex utest for stdformat, fixed std::formatter (#3315) | PENDING | +| `ad0f31c0` | Enabled bin_to_hex utest for stdformat, fixed std::formatter (#3315) | PORTED (`test_sink.h` / `test_custom_callbacks.cpp` iterator `difference_type` cast; v2 `bin_to_hex` non-`const` `delimiter`; tests always include `test_bin_to_hex.cpp`) | | `d7155530` | Added SPDLOG_FWRITE_UNLOCKED option to CMakeLists.txt (#3318) | SUPERSEDED (same `CheckSymbolExists` / `SPDLOG_FWRITE_UNLOCKED` wiring as `1e6250e1` on v2) | | `96a7d2a1` | Format CMakeLists.txt | N/A (formatting only) | | `57505989` | SPDLOG_LEVEL_NAMES, comment use string_view_literals (#3291) | N/A (v2 has no `tweakme.h` / `SPDLOG_LEVEL_NAMES`; levels in `common.h`) | diff --git a/tests/test_custom_callbacks.cpp b/tests/test_custom_callbacks.cpp index cfae2119ce..7a095b3749 100644 --- a/tests/test_custom_callbacks.cpp +++ b/tests/test_custom_callbacks.cpp @@ -3,6 +3,9 @@ * https://raw.githubusercontent.com/gabime/spdlog/v2.x/LICENSE */ #include "includes.h" + +#include + #include "spdlog/common.h" #include "spdlog/sinks/callback_sink.h" #include "test_sink.h" @@ -14,7 +17,8 @@ TEST_CASE("custom_callback_logger", "[custom_callback_logger]") { spdlog::memory_buf_t formatted; formatter.format(msg, formatted); auto eol_len = strlen(spdlog::details::os::default_eol); - lines.emplace_back(formatted.begin(), formatted.end() - eol_len); + using diff_t = typename std::iterator_traits::difference_type; + lines.emplace_back(formatted.begin(), formatted.end() - static_cast(eol_len)); }); std::shared_ptr test_sink(new spdlog::sinks::test_sink_st); diff --git a/tests/test_sink.h b/tests/test_sink.h index ae7da23720..09318712b6 100644 --- a/tests/test_sink.h +++ b/tests/test_sink.h @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -57,7 +58,8 @@ class test_sink : public base_sink { // save the line without the eol auto eol_len = strlen(details::os::default_eol); if (lines_.size() < lines_to_save) { - lines_.emplace_back(formatted.begin(), formatted.end() - eol_len); + using diff_t = typename std::iterator_traits::difference_type; + lines_.emplace_back(formatted.begin(), formatted.end() - static_cast(eol_len)); } msg_counter_++; std::this_thread::sleep_for(delay_); From 0a9563c77ca72ed80ab45fc379854f0b948fd346 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 10:47:37 +0200 Subject: [PATCH 23/35] parity: SPDLOG_WCHAR_CONSOLE WriteConsoleW path (#3092); triage b6da5944 - WIN32 option SPDLOG_WCHAR_CONSOLE; SPDLOG_UTF8_TO_WCHAR_CONSOLE in private defs - wincolor print_range_: utf8_to_wstrbuf + WriteConsoleW when defined - N/A: async_msg flush_callback move-assign (no v1 shape on v2) Made-with: Cursor --- CMakeLists.txt | 9 ++++++++- src/sinks/wincolor_sink.cpp | 8 ++++++++ tasks/commits-ported.txt | 2 ++ tasks/merge-report-v2x-v1x.md | 2 ++ tasks/tasks-v2x-v1x-feature-parity.md | 6 +++--- tasks/v1-triage-complete.md | 6 +++--- 6 files changed, 26 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 733a2936d8..e3f7557ede 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,11 @@ option(SPDLOG_TIDY "run clang-tidy" OFF) set(SPDLOG_DEBUG_POSTFIX "-${SPDLOG_VERSION_MAJOR}.${SPDLOG_VERSION_MINOR}d" CACHE STRING "Filename postfix for libraries in debug builds (empty string allowed)") option(SPDLOG_MSVC_UTF8 "Enable/disable MSVC /utf-8 flag (recommended for fmt)" ON) +if (WIN32) + option(SPDLOG_WCHAR_CONSOLE "Decode UTF-8 and write with WriteConsoleW (Unicode console output)" OFF) +else () + set(SPDLOG_WCHAR_CONSOLE OFF CACHE BOOL "non supported option" FORCE) +endif () if (SPDLOG_TIDY) set(CMAKE_CXX_CLANG_TIDY "clang-tidy") set(CMAKE_EXPORT_COMPILE_COMMANDS ON) @@ -263,13 +268,15 @@ endif () # --------------------------------------------------------------------------------------- # Private defines according to the options # --------------------------------------------------------------------------------------- +set(SPDLOG_UTF8_TO_WCHAR_CONSOLE ${SPDLOG_WCHAR_CONSOLE}) foreach (SPDLOG_OPTION SPDLOG_CLOCK_COARSE SPDLOG_PREVENT_CHILD_FD SPDLOG_NO_THREAD_ID SPDLOG_DISABLE_GLOBAL_LOGGER SPDLOG_NO_TLS - SPDLOG_FWRITE_UNLOCKED) + SPDLOG_FWRITE_UNLOCKED + SPDLOG_UTF8_TO_WCHAR_CONSOLE) if (${SPDLOG_OPTION}) target_compile_definitions(spdlog PRIVATE ${SPDLOG_OPTION}) endif () diff --git a/src/sinks/wincolor_sink.cpp b/src/sinks/wincolor_sink.cpp index 20c0a4ed38..bc6b137a45 100644 --- a/src/sinks/wincolor_sink.cpp +++ b/src/sinks/wincolor_sink.cpp @@ -10,6 +10,7 @@ #include "spdlog/sinks/wincolor_sink.h" #include "spdlog/common.h" +#include "spdlog/details/os.h" namespace spdlog { namespace sinks { @@ -108,8 +109,15 @@ std::uint16_t wincolor_sink::set_foreground_color_(std::uint16_t attribs) template void wincolor_sink::print_range_(const memory_buf_t &formatted, size_t start, size_t end) { if (end > start) { +#if defined(SPDLOG_UTF8_TO_WCHAR_CONSOLE) + wmemory_buf_t wformatted; + details::os::utf8_to_wstrbuf(string_view_t(formatted.data() + start, end - start), wformatted); + auto size = static_cast(wformatted.size()); + auto ignored = ::WriteConsoleW(static_cast(out_handle_), wformatted.data(), size, nullptr, nullptr); +#else auto size = static_cast(end - start); auto ignored = ::WriteConsoleA(static_cast(out_handle_), formatted.data() + start, size, nullptr, nullptr); +#endif (void)(ignored); } } diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt index 9984b21f56..0bcec25e49 100644 --- a/tasks/commits-ported.txt +++ b/tasks/commits-ported.txt @@ -33,6 +33,7 @@ cdbd64e2 qt_sinks: qsizetype for fromUtf8 lengths; colors_.at size_t (#3487) 24dde318 rotating_file_sink::rotate_now: lock mutex (#3281) 65e388e8 basic_file_sink::truncate() + test (#3280) ad0f31c0 test_sink + callback_sink tests: iterator_traits cast for end()-eol (#3315) +c3aed4b6 SPDLOG_WCHAR_CONSOLE / WriteConsoleW + utf8_to_wstrbuf path in wincolor_sink (#3092) # SUPERSEDED (no code change): d5af52d9 format_string propagation — v2 API already correct # SUPERSEDED: 6c5d6329 should_log comment — v2 logger.h already correct # SUPERSEDED: 2aa8b6c9 file_helper write fd_ — v2 file_helper.cpp already has guard @@ -102,3 +103,4 @@ ad0f31c0 test_sink + callback_sink tests: iterator_traits cast for end()-eol (#3 # SUPERSEDED: 1e6250e1 d7155530 fwrite_bytes + CMake SPDLOG_FWRITE_UNLOCKED # SUPERSEDED: c1569a3d Catch2 v3.5.0 — tests/CMakeLists.txt GIT_TAG # SUPERSEDED: 73e2e02b #3038 wstr_to_utf8buf — os_windows.cpp /4 and *4 +# N/A: b6da5944 async_msg flush_callback move-assign — no v1 async_msg on v2 (#3232) diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index 4b791a97ed..34f1bcbc3d 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -86,6 +86,8 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | `c1569a3d` | *(SUPERSEDED)* Catch2 **v3.5.0** — `tests/CMakeLists.txt` `FetchContent` `GIT_TAG`. | — | | `73e2e02b` | *(SUPERSEDED)* `#3038` / `#3044` UTF-16→UTF-8 size checks — `wstr_to_utf8buf` in `os_windows.cpp`. | — | | `ad0f31c0` | `test_sink` / callback tests: **`iterator_traits::difference_type`** cast for `end() - eol_len` (#3315). | `tests/test_sink.h`, `tests/test_custom_callbacks.cpp` | +| `c3aed4b6` | Optional **UTF-8 → wide** console output: `SPDLOG_WCHAR_CONSOLE` / `SPDLOG_UTF8_TO_WCHAR_CONSOLE`; `print_range_` uses `utf8_to_wstrbuf` + `WriteConsoleW` (#3092). | `CMakeLists.txt`, `src/sinks/wincolor_sink.cpp` | +| `b6da5944` | *(N/A)* `async_msg` move-assign flush callback — v2 has no v1 `async_msg` / `flush_callback` shape (#3232). | — | | `566b2d14` | Case-insensitive `level_from_str` (env / argv level names). | `src/common.cpp`; `tests/test_misc.cpp` | | `dd3ca04a` | Set default `CMAKE_BUILD_TYPE` only when spdlog is the top-level CMake project. | `CMakeLists.txt` | | `d5af52d9` | *(SUPERSEDED)* format_string propagation — v2.x already uses unified `format_string_t` forwarding to `log_with_format_`. | — | diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index ab66277967..76b10a0dd7 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -6,8 +6,8 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D - **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). - **Ports:** [`commits-ported.txt`](commits-ported.txt). **Full triage (245 v1-only SHAs):** [`v1-triage-complete.md`](v1-triage-complete.md) — **PORTED**, **PENDING**, **SUPERSEDED**, or **N/A** (merge commits). **All unit tests pass** (`ctest` Release, Windows). -- **Latest pass:** `ad0f31c0` test **iterator** cast (#3315); **SUPERSEDED** `c1569a3d` (Catch2 3.5.0), `73e2e02b` (#3038 UTF-16→UTF-8 bounds). Prior: `65e388e8` truncate. See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). -- **Triage snapshot:** **40 PORTED**, **53 SUPERSEDED**, **118 N/A**, **34 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). +- **Latest pass:** `c3aed4b6` **`SPDLOG_WCHAR_CONSOLE`** / `WriteConsoleW` UTF-8 path in `wincolor_sink` (#3092); **N/A** `b6da5944` (no v1 `async_msg`). Prior: `ad0f31c0` iterator cast. See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). +- **Triage snapshot:** **41 PORTED**, **53 SUPERSEDED**, **119 N/A**, **32 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). - **Remaining:** Topical ports from `v1-commit-inventory.txt` — **fmt / CMake 5A** (bundled fmt bump, warning flags); large batches still **PENDING**. ## Relevant Files @@ -71,7 +71,7 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 4.5 Spot-check platform-specific areas called out in PRD (e.g. Windows/UWP, POSIX `TZ`, TCP) on representative configs if possible. - [ ] 5.0 Documentation, merge report, and release readiness (4B) - - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **40** ported, **53** superseded, **118** N/A, **34** **PENDING** — reclassify PENDING over time.)* + - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **41** ported, **53** superseded, **119** N/A, **32** **PENDING** — reclassify PENDING over time.)* - [x] 5.2 Write **merge report**: areas touched, conflict resolutions, rejected or deferred ports with rationale. - [ ] 5.3 Update **README** (build, fmt version, branch notes) and version header for v2.x pre-release. - [ ] 5.4 Add **migration / release notes** for downstream users (API preserved per **2A**, dependency changes per **5A**). diff --git a/tasks/v1-triage-complete.md b/tasks/v1-triage-complete.md index 0a55632b55..66d41037ae 100644 --- a/tasks/v1-triage-complete.md +++ b/tasks/v1-triage-complete.md @@ -10,7 +10,7 @@ Source: `git log --reverse origin/v2.x..origin/v1.x` (245 commits). Integration Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (many paths removed/split), so not every v1 commit cherry-picks cleanly. -**Counts (this revision):** 40 **PORTED**, 53 **SUPERSEDED**, 118 **N/A**, 34 **PENDING**. +**Counts (this revision):** 41 **PORTED**, 53 **SUPERSEDED**, 119 **N/A**, 32 **PENDING**. | SHA | Subject | Status | |-----|---------|--------| @@ -109,7 +109,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `3b4fd93b` | Updated comment about mdc | PENDING | | `2d4acf8c` | Added mdc example | PENDING | | `27cb4c76` | Added mdc example to readme | N/A (docs; v2 has no MDC yet) | -| `c3aed4b6` | Add wide character formatting and output support to wincolor_sink. (#3092) | PENDING | +| `c3aed4b6` | Add wide character formatting and output support to wincolor_sink. (#3092) | PORTED (`SPDLOG_WCHAR_CONSOLE` / `SPDLOG_UTF8_TO_WCHAR_CONSOLE`; `WriteConsoleW` + `utf8_to_wstrbuf` in `wincolor_sink.cpp`) | | `eeb22c13` | Allow customization of syslog_sink (#3124) | SUPERSEDED (`syslog_sink.h` — `virtual syslog_prio_from_level`, `levels_array` protected) | | `d276069a` | make example compatible with fmt 11 (#3130) | SUPERSEDED (`example/example.cpp` `fmt::formatter::format` already `const`) | | `885b5473` | Fix building with `FMT_ENFORCE_COMPILE_STRING` (#3137) | SUPERSEDED (`rotating_file_sink::calc_filename` builds path via `ostringstream`, not `fmt::format` literal — `rotating_file_sink.cpp`) | @@ -125,7 +125,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `e593f669` | Fix warning - extra ';' for -Wextra-semi (#3198) | SUPERSEDED (v2 `bench` / `example` / `callback_sink` / `msvc_sink` already match; no stray `};` / `override{};`) | | `ee168957` | Improve Cross-Platform Build Instructions in Documentation (#3229) | N/A (v1 docs) | | `16e0d2e7` | Exchange promise for condition_variable when flushing (fixes #3221) (#3228) | PENDING | -| `b6da5944` | Ensure flush callback gets called in move-assign operator (#3232) | PENDING | +| `b6da5944` | Ensure flush callback gets called in move-assign operator (#3232) | N/A (v2 has no v1 `async_msg` / `flush_callback` in `thread_pool.hpp` — different async message path) | | `63d18842` | Gabime/async flush (#3235) | PENDING | | `85bdab0c` | Update bundled fmt to 11.0.2 (#3236) | PENDING | | `96c9a62b` | Fixed race condition in tests | SUPERSEDED (`tests/test_misc.cpp` “clone async” uses `test_sink_mt` / `async_sink`) | From aeb67cfee7573d2aff96236ee8da20a627b36797 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 10:49:33 +0200 Subject: [PATCH 24/35] triage: v1 async_logger/thread_pool + fmt 11.1 batch (15 SHAs) - N/A: fe79bfcc 6725584e async tests 16e0d2e7 63d18842 d8e0ad46 1e7d7e07 3c23c27d - SUPERSEDED: faa0a7a9 85bdab0c 276ee5f5 7f8060d5 96a8f625 - Counts: 58 SUPERSEDED, 129 N/A, 17 PENDING; merge-report subsection Made-with: Cursor --- tasks/commits-ported.txt | 6 +++++ tasks/merge-report-v2x-v1x.md | 11 +++++++++ tasks/tasks-v2x-v1x-feature-parity.md | 6 ++--- tasks/v1-triage-complete.md | 32 +++++++++++++-------------- 4 files changed, 36 insertions(+), 19 deletions(-) diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt index 0bcec25e49..08f0752d86 100644 --- a/tasks/commits-ported.txt +++ b/tasks/commits-ported.txt @@ -104,3 +104,9 @@ c3aed4b6 SPDLOG_WCHAR_CONSOLE / WriteConsoleW + utf8_to_wstrbuf path in wincolor # SUPERSEDED: c1569a3d Catch2 v3.5.0 — tests/CMakeLists.txt GIT_TAG # SUPERSEDED: 73e2e02b #3038 wstr_to_utf8buf — os_windows.cpp /4 and *4 # N/A: b6da5944 async_msg flush_callback move-assign — no v1 async_msg on v2 (#3232) +# Triage batch (no code): fe79bfcc 6725584e ec661f98 a19c76a4 62302019 — v1 async_logger/thread_pool; v2 async_sink +# N/A: d8e0ad46 1e7d7e07 fmt 10.2.1 bumps — superseded by bundled fmt (5A) +# N/A: 16e0d2e7 63d18842 — v1 thread_pool flush promise/callback path +# SUPERSEDED: faa0a7a9 85bdab0c — fmt 11.1.4 / 11.0.2 vs cmake fmtlib.cmake +# SUPERSEDED: 276ee5f5 7f8060d5 96a8f625 — fmt 11.1 to_string_view / external; v2 common.h + vformat_to +# N/A: 3c23c27d revert #3312 — pairs with 7f8060d5 diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index 34f1bcbc3d..567688c0e8 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -154,6 +154,17 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | `3edc8036` | *(N/A)* Catch2 test declaration order — optional. | — | | `c5061bb9` | *(N/A)* `LICENSE` text update — reconcile at release if needed. | — | +### Triage-only batch (v1 async / fmt delta vs v2) + +| v1.x commit | Disposition | Notes | +|-------------|---------------|--------| +| `fe79bfcc` `6725584e` `ec661f98` `a19c76a4` `62302019` | **N/A** | v1 `async_logger` / `thread_pool`; v2 uses **`async_sink`** + `mpmc_blocking_q` (`tests/test_async.cpp` differs). | +| `16e0d2e7` `63d18842` | **N/A** | v1 flush **promise** / **condition_variable** thread-pool path; not present on v2. | +| `d8e0ad46` `1e7d7e07` | **N/A** | Bundled fmt **10.2.1** bumps; current bundle is **11.1.4** (`cmake/fmtlib.cmake`); align with **5A**. | +| `faa0a7a9` `85bdab0c` | **SUPERSEDED** | fmt **11.1.4** / prior **11.0.2** — satisfied by bundled pin. | +| `276ee5f5` `7f8060d5` `96a8f625` | **SUPERSEDED** | fmt **11.1** `to_string_view` / external fmt fixes — v2 `logger::log_with_format_` + no v1 `common.h` `to_string_view(fmt)` chain (`1685e694` triage). | +| `3c23c27d` | **N/A** | Revert of `7f8060d5`; no separate port. | + **Full SHA list:** [`v1-triage-complete.md`](v1-triage-complete.md). **Validation:** `ctest` Release on Windows — all unit tests passed after these ports. diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index 76b10a0dd7..0db0161b56 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -6,8 +6,8 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D - **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). - **Ports:** [`commits-ported.txt`](commits-ported.txt). **Full triage (245 v1-only SHAs):** [`v1-triage-complete.md`](v1-triage-complete.md) — **PORTED**, **PENDING**, **SUPERSEDED**, or **N/A** (merge commits). **All unit tests pass** (`ctest` Release, Windows). -- **Latest pass:** `c3aed4b6` **`SPDLOG_WCHAR_CONSOLE`** / `WriteConsoleW` UTF-8 path in `wincolor_sink` (#3092); **N/A** `b6da5944` (no v1 `async_msg`). Prior: `ad0f31c0` iterator cast. See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). -- **Triage snapshot:** **41 PORTED**, **53 SUPERSEDED**, **119 N/A**, **32 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). +- **Latest pass:** Triage batch — **SUPERSEDED** fmt **11.1.x** / `to_string_view` / bundled pin (`faa0a7a9`, `85bdab0c`, `276ee5f5`, `7f8060d5`, `96a8f625`); **N/A** v1 `async_logger` / `thread_pool` flush (`fe79bfcc`, `6725584e`, `ec661f98`, `a19c76a4`, `62302019`, `16e0d2e7`, `63d18842`), fmt 10.2.1 bumps (`d8e0ad46`, `1e7d7e07`), revert `3c23c27d`. Prior: `c3aed4b6` wchar console. See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). +- **Triage snapshot:** **41 PORTED**, **58 SUPERSEDED**, **129 N/A**, **17 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). - **Remaining:** Topical ports from `v1-commit-inventory.txt` — **fmt / CMake 5A** (bundled fmt bump, warning flags); large batches still **PENDING**. ## Relevant Files @@ -71,7 +71,7 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 4.5 Spot-check platform-specific areas called out in PRD (e.g. Windows/UWP, POSIX `TZ`, TCP) on representative configs if possible. - [ ] 5.0 Documentation, merge report, and release readiness (4B) - - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **41** ported, **53** superseded, **119** N/A, **32** **PENDING** — reclassify PENDING over time.)* + - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **41** ported, **58** superseded, **129** N/A, **17** **PENDING** — reclassify PENDING over time.)* - [x] 5.2 Write **merge report**: areas touched, conflict resolutions, rejected or deferred ports with rationale. - [ ] 5.3 Update **README** (build, fmt version, branch notes) and version header for v2.x pre-release. - [ ] 5.4 Add **migration / release notes** for downstream users (API preserved per **2A**, dependency changes per **5A**). diff --git a/tasks/v1-triage-complete.md b/tasks/v1-triage-complete.md index 66d41037ae..bb99cfe939 100644 --- a/tasks/v1-triage-complete.md +++ b/tasks/v1-triage-complete.md @@ -10,7 +10,7 @@ Source: `git log --reverse origin/v2.x..origin/v1.x` (245 commits). Integration Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (many paths removed/split), so not every v1 commit cherry-picks cleanly. -**Counts (this revision):** 41 **PORTED**, 53 **SUPERSEDED**, 119 **N/A**, 32 **PENDING**. +**Counts (this revision):** 41 **PORTED**, 58 **SUPERSEDED**, 129 **N/A**, 17 **PENDING**. | SHA | Subject | Status | |-----|---------|--------| @@ -52,7 +52,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `8979f7fb` | Also use _stat() on Windows to be more UTF8 friendly (#2978) | SUPERSEDED (`src/details/os_filesystem.cpp` — `path_exists` uses `std::filesystem::exists`) | | `696db97f` | docs: details about how compile time macros work (#2981) | N/A (v1 docs; v2 macro story differs) | | `47b7e7c7` | Fix typos found by codespell (#3011) | SUPERSEDED (`qt_sinks.h` / `test_file_helper.cpp` match; `test_errors.cpp` differs on v2) | -| `fe79bfcc` | Expose the flusher thread object to user in order to allow setting of thread name and thread affinity when needed (#3009) | PENDING | +| `fe79bfcc` | Expose the flusher thread object to user in order to allow setting of thread name and thread affinity when needed (#3009) | N/A (v2 uses `async_sink` + `mpmc_blocking_q`; no v1 `thread_pool` flusher thread handle) | | `134f9194` | Update registry.h code formatting | N/A (v2.x has no `registry.h` / multi-logger registry) | | `d387fdf9` | support MINGW (#3022) | SUPERSEDED (`CMakeLists.txt` — `CMAKE_CXX_EXTENSIONS` ON for `MINGW` with `CYGWIN`/`MSYS`) | | `9a445245` | Update ci.yml | N/A (v1 `ci.yml` / legacy CI; v2 uses `.github/workflows`) | @@ -75,12 +75,12 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `d03eb40c` | Added Mapped Diagnostic Context (MDC) support (#2907) | PENDING | | `73e2e02b` | Fix #3038 (#3044) | SUPERSEDED (`src/details/os_windows.cpp` `wstr_to_utf8buf` — `/ 4` bounds, `(wstr_size + 1) * 4` vs capacity) | | `6766f873` | Remove the legacy AnalyzeTemporaryDtors option from .clang-tidy. (#3048) | SUPERSEDED (`.clang-tidy` on v2 does not set `AnalyzeTemporaryDtors`) | -| `6725584e` | Make async_logger::flush() synchronous and wait for the flush to complete (#3049) | PENDING | +| `6725584e` | Make async_logger::flush() synchronous and wait for the flush to complete (#3049) | N/A (v2 has no `async_logger` class; use `async_sink::flush` / `wait_all`) | | `c9ce17ab` | INSTALL.md has been updated to provide current status information. (#3052) | N/A (no `INSTALL.md` on v2 tree) | -| `ec661f98` | Update test_async.cpp | PENDING | -| `a19c76a4` | Fix flush test in test_async.cpp | PENDING | -| `62302019` | Update test_async.cpp | PENDING | -| `d8e0ad46` | Updated bundled fmt to 10.2.1 | PENDING | +| `ec661f98` | Update test_async.cpp | N/A (v1 `async_logger` / thread-pool tests; v2 `tests/test_async.cpp` targets `async_sink`) | +| `a19c76a4` | Fix flush test in test_async.cpp | N/A (same) | +| `62302019` | Update test_async.cpp | N/A (same) | +| `d8e0ad46` | Updated bundled fmt to 10.2.1 | N/A (superseded by current bundled fmt in `cmake/fmtlib.cmake`; track fmt under **5A**) | | `2969dde4` | Revert "Updated bundled fmt to 10.2.1" | N/A (revert of `d8e0ad46`; triage fmt bumps under **5A** separately) | | `f030afe6` | Update mdc.h | PENDING | | `1f930174` | Update mdc.h | PENDING | @@ -89,7 +89,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `1253a57d` | Add mdc support for default format | PENDING | | `8fed530b` | Update mdc.h | PENDING | | `a2b42620` | Update CMakeLists.txt to fix #3029 | SUPERSEDED (v2 `cmake_minimum_required(VERSION 3.23)` — supersedes v1 `3.10...3.21`) | -| `1e7d7e07` | Updated bundled fmt to 10.2.1 | PENDING | +| `1e7d7e07` | Updated bundled fmt to 10.2.1 | N/A (duplicate fmt bump line; **5A**) | | `e3f5a4fe` | Update cmake to define FMT_LIB_EXPORT when building shared lib | SUPERSEDED (v2 links `fmt::fmt` from FetchContent / external; fmt target owns `FMT_*` exports — not inlined bundled fmt in `spdlog`) | | `a0d2187d` | README.md has include missing (#3066) | N/A (docs-only) | | `b7e0e2c2` | Fix #3073 | SUPERSEDED (v2 `source_loc::line` is unsigned; `empty()` also checks `filename`/`short_filename` — `include/spdlog/source_loc.h`) | @@ -124,10 +124,10 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `2c76e610` | Fix #3194 - Use Sep instead of Sept for abbreviated month | SUPERSEDED (`src/pattern_formatter.cpp` abbreviated months already use `"Sep"`) | | `e593f669` | Fix warning - extra ';' for -Wextra-semi (#3198) | SUPERSEDED (v2 `bench` / `example` / `callback_sink` / `msvc_sink` already match; no stray `};` / `override{};`) | | `ee168957` | Improve Cross-Platform Build Instructions in Documentation (#3229) | N/A (v1 docs) | -| `16e0d2e7` | Exchange promise for condition_variable when flushing (fixes #3221) (#3228) | PENDING | +| `16e0d2e7` | Exchange promise for condition_variable when flushing (fixes #3221) (#3228) | N/A (v2 has no v1 `thread_pool` / `async_msg` flush promise path) | | `b6da5944` | Ensure flush callback gets called in move-assign operator (#3232) | N/A (v2 has no v1 `async_msg` / `flush_callback` in `thread_pool.hpp` — different async message path) | -| `63d18842` | Gabime/async flush (#3235) | PENDING | -| `85bdab0c` | Update bundled fmt to 11.0.2 (#3236) | PENDING | +| `63d18842` | Gabime/async flush (#3235) | N/A (follow-on to v1 thread-pool flush; not applicable on v2 `async_sink`) | +| `85bdab0c` | Update bundled fmt to 11.0.2 (#3236) | SUPERSEDED (bundled fmt **11.1.4** in `cmake/fmtlib.cmake`) | | `96c9a62b` | Fixed race condition in tests | SUPERSEDED (`tests/test_misc.cpp` “clone async” uses `test_sink_mt` / `async_sink`) | | `9fe79692` | Gabime/tsan (#3237) | PENDING | | `7a950e02` | add /utf-8 flag for msvc | PORTED (`CMakeLists.txt` — `SPDLOG_MSVC_UTF8` + MSVC-only genex; see `9edab1b5`) | @@ -173,21 +173,21 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `1e6250e1` | Gabime/fwrite unlocked (#3276) | SUPERSEDED (`details::os::fwrite_bytes`, `CMakeLists.txt` `HAVE_FWRITE_UNLOCKED`, `file_helper` / sinks) | | `65e388e8` | Adding on demand truncation for basic file sinks (#3280) | PORTED (`basic_file_sink::truncate`, `tests/test_file_logging.cpp` `basic_file_sink_truncate`) | | `24dde318` | Adding lock to rotate_now() (#3281) | PORTED (`std::lock_guard` in `rotating_file_sink::rotate_now`) | -| `276ee5f5` | fix: update to_string_view function for fmt 11.1 (#3301) | PENDING | -| `7f8060d5` | fix: Compatibility with external fmtlib 11.1.1 (#3312) | PENDING | -| `96a8f625` | fix: remove unused to_string_view overload in fmt >= 11.1 (#3314) | PENDING | +| `276ee5f5` | fix: update to_string_view function for fmt 11.1 (#3301) | SUPERSEDED (v2 `common.h` has no `details::to_string_view(fmt)` helpers; `logger` uses `fmt::vformat_to` — c.f. `1685e694`) | +| `7f8060d5` | fix: Compatibility with external fmtlib 11.1.1 (#3312) | SUPERSEDED (v2 + bundled fmt **11.1.4**; external fmt via `SPDLOG_FMT_EXTERNAL`) | +| `96a8f625` | fix: remove unused to_string_view overload in fmt >= 11.1 (#3314) | SUPERSEDED (same as `276ee5f5` — no v1-style overloads in v2 `common.h`) | | `ad0f31c0` | Enabled bin_to_hex utest for stdformat, fixed std::formatter (#3315) | PORTED (`test_sink.h` / `test_custom_callbacks.cpp` iterator `difference_type` cast; v2 `bin_to_hex` non-`const` `delimiter`; tests always include `test_bin_to_hex.cpp`) | | `d7155530` | Added SPDLOG_FWRITE_UNLOCKED option to CMakeLists.txt (#3318) | SUPERSEDED (same `CheckSymbolExists` / `SPDLOG_FWRITE_UNLOCKED` wiring as `1e6250e1` on v2) | | `96a7d2a1` | Format CMakeLists.txt | N/A (formatting only) | | `57505989` | SPDLOG_LEVEL_NAMES, comment use string_view_literals (#3291) | N/A (v2 has no `tweakme.h` / `SPDLOG_LEVEL_NAMES`; levels in `common.h`) | | `7cbf2a69` | Gabime/ansicolor sink improvements (#3323) | PORTED (`src/sinks/ansicolor_sink.cpp` — `set_color_mode` holds mutex, `set_color_mode_` does not; fixes double-lock vs v1 pattern; const helpers already present) | | `ae1de0dc` | Support custom environment variables for load_env_levels (#3327) | N/A (v2 has no `spdlog/cfg/` — `load_env_levels` not present) | -| `3c23c27d` | Revert "fix: Compatibility with external fmtlib 11.1.1 (#3312)" (#3331) | PENDING | +| `3c23c27d` | Revert "fix: Compatibility with external fmtlib 11.1.1 (#3312)" (#3331) | N/A (revert commit; pairs with `7f8060d5` / fmt 11.1.1 churn) | | `ac432c36` | Gabime/v1.15.1 (#3332) | N/A (v1.x release / tag commit) | | `f355b3d5` | Fix test_daily_logger | SUPERSEDED (v2 `tests/test_daily_and_rotation_loggers.cpp` — `fmt_lib::format` in custom calculator; no `SPDLOG_BUF_TO_STRING`) | | `3335c380` | Update README.md (#3338) | N/A (docs-only) | | `10320184` | Fixed issue #3360 (#3361) | SUPERSEDED (scoped_padder truncate clamp; `%D` field width — already in `pattern_formatter.cpp`) | -| `faa0a7a9` | Bump fmt to version 11.1.4 | PENDING | +| `faa0a7a9` | Bump fmt to version 11.1.4 | SUPERSEDED (`cmake/fmtlib.cmake` — `11.1.4.tar.gz`) | | `9c582574` | Fix zformatter on Apple and POSIX.1-2024 conforming platform (#3366) | SUPERSEDED (`src/details/os_unix.cpp` `utc_minutes_offset` — `__APPLE__` / `_POSIX_VERSION` guard matches #3366) | | `48bcf39a` | Version 1.15.2 | N/A (v1.x release version bump) | | `1f4959c8` | Fix link to wiki. (#3377) | N/A (docs-only) | From 8927cd19568576782a9abe1de6309549fe49881c Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 10:54:31 +0200 Subject: [PATCH 25/35] Port v1 TSAN CMake (#3237); close 3A triage (MDC N/A, fmt 5A) Made-with: Cursor --- CMakeLists.txt | 9 ++++++ tasks/commits-ported.txt | 4 +++ tasks/merge-report-v2x-v1x.md | 9 ++++++ tasks/tasks-v2x-v1x-feature-parity.md | 13 ++++++--- tasks/v1-triage-complete.md | 40 +++++++++++++-------------- 5 files changed, 51 insertions(+), 24 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e3f7557ede..534f8b76cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,6 +53,10 @@ option(SPDLOG_BUILD_EXAMPLE "Build example" ${SPDLOG_MASTER_PROJECT}) option(SPDLOG_BUILD_TESTS "Build tests" OFF) option(SPDLOG_BUILD_BENCH "Build benchmarks (Requires https://github.com/google/benchmark.git to be installed)" OFF) option(SPDLOG_SANITIZE_ADDRESS "Enable address sanitizer in tests" OFF) +option(SPDLOG_SANITIZE_THREAD "Enable thread sanitizer in tests" OFF) +if (SPDLOG_SANITIZE_ADDRESS AND SPDLOG_SANITIZE_THREAD) + message(FATAL_ERROR "SPDLOG_SANITIZE_ADDRESS and SPDLOG_SANITIZE_THREAD are mutually exclusive") +endif () option(SPDLOG_BUILD_WARNINGS "Enable compiler warnings" OFF) option(SPDLOG_SYSTEM_INCLUDES "Include as system headers (skip for clang-tidy)." OFF) option(SPDLOG_INSTALL "Generate the install target" ${SPDLOG_MASTER_PROJECT}) @@ -247,6 +251,11 @@ if (MSVC) endif () endif () spdlog_enable_warnings(spdlog) +if (SPDLOG_SANITIZE_ADDRESS) + spdlog_enable_addr_sanitizer(spdlog) +elseif (SPDLOG_SANITIZE_THREAD) + spdlog_enable_thread_sanitizer(spdlog) +endif () set_target_properties(spdlog PROPERTIES VERSION ${SPDLOG_VERSION} SOVERSION ${SPDLOG_VERSION_MAJOR}.${SPDLOG_VERSION_MINOR}) set(SPDLOG_NAME spdlog-${SPDLOG_VERSION_MAJOR}) diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt index 08f0752d86..8ac9fc6997 100644 --- a/tasks/commits-ported.txt +++ b/tasks/commits-ported.txt @@ -5,6 +5,7 @@ b656d1ce Windows utc_minutes_offset(): DST accuracy + tests (pattern_formatter, test_timezone) 0f7562a0 tests: timezone: explicit POSIX TZ DST rules (musl / POSIX 2024) d2100d5d Include fcntl.h in Unix tcp client header (v2: tcp_client_unix.h) +9fe79692 TSAN: SPDLOG_SANITIZE_THREAD option, mutual exclusion, sanitizer on spdlog lib (#3237) 3c61b051 [ci] actions/checkout@v6 (linux, macos, windows) 9ecdf5c8 TCP connect/send/recv timeouts (tcp_client_*, tcp_sink) 45b67eee dup_filter_sink: constructor taking vector of sinks (#3549) @@ -110,3 +111,6 @@ c3aed4b6 SPDLOG_WCHAR_CONSOLE / WriteConsoleW + utf8_to_wstrbuf path in wincolor # SUPERSEDED: faa0a7a9 85bdab0c — fmt 11.1.4 / 11.0.2 vs cmake fmtlib.cmake # SUPERSEDED: 276ee5f5 7f8060d5 96a8f625 — fmt 11.1 to_string_view / external; v2 common.h + vformat_to # N/A: 3c23c27d revert #3312 — pairs with 7f8060d5 +# N/A (MDC): d03eb40c f030afe6 1f930174 4517ce8b cba66029 1253a57d 8fed530b 3b4fd93b 2d4acf8c 362214a3 c1fbafdc — no mdc.h on v2 +# N/A: 7e022c43 Feature 3379 — v1 MDC + mixed tree; non-MDC slices elsewhere +# N/A (5A fmt): 0d31acae 4418909a ea3e747e 878ad2e3 2c1eafc8 3f03542d — fmt 11.2+ / 12.x / C4834 chain diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index 567688c0e8..238b5c4cd3 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -165,6 +165,15 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | `276ee5f5` `7f8060d5` `96a8f625` | **SUPERSEDED** | fmt **11.1** `to_string_view` / external fmt fixes — v2 `logger::log_with_format_` + no v1 `common.h` `to_string_view(fmt)` chain (`1685e694` triage). | | `3c23c27d` | **N/A** | Revert of `7f8060d5`; no separate port. | +### Triage close-out (MDC / TSAN / fmt **5A**) + +| v1.x commit(s) | Disposition | Notes | +|----------------|-------------|--------| +| `d03eb40c` … `c1fbafdc` | **N/A** | **MDC** stack (`mdc.h`, examples, TLS fix) — v2 tree has no MDC public API (**PRD 2A**). | +| `7e022c43` | **N/A** | **Feature #3379** bundles MDC with v1-only layout; non-MDC behavior covered by other ports. | +| `9fe79692` | **PORTED** | **TSAN:** `SPDLOG_SANITIZE_THREAD` CMake option, mutual exclusion with address sanitizer, `spdlog_enable_thread_sanitizer` / `spdlog_enable_addr_sanitizer` on **`spdlog`** target (tests already used helpers). | +| `0d31acae` `4418909a` `ea3e747e` `878ad2e3` `2c1eafc8` `3f03542d` | **N/A** | **fmt 11.2+ / 12.x** and **MSVC C4834** follow-on — defer to **5A** (current bundled **11.1.4**). | + **Full SHA list:** [`v1-triage-complete.md`](v1-triage-complete.md). **Validation:** `ctest` Release on Windows — all unit tests passed after these ports. diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index 0db0161b56..48f9bc0e22 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -6,9 +6,14 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D - **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). - **Ports:** [`commits-ported.txt`](commits-ported.txt). **Full triage (245 v1-only SHAs):** [`v1-triage-complete.md`](v1-triage-complete.md) — **PORTED**, **PENDING**, **SUPERSEDED**, or **N/A** (merge commits). **All unit tests pass** (`ctest` Release, Windows). -- **Latest pass:** Triage batch — **SUPERSEDED** fmt **11.1.x** / `to_string_view` / bundled pin (`faa0a7a9`, `85bdab0c`, `276ee5f5`, `7f8060d5`, `96a8f625`); **N/A** v1 `async_logger` / `thread_pool` flush (`fe79bfcc`, `6725584e`, `ec661f98`, `a19c76a4`, `62302019`, `16e0d2e7`, `63d18842`), fmt 10.2.1 bumps (`d8e0ad46`, `1e7d7e07`), revert `3c23c27d`. Prior: `c3aed4b6` wchar console. See [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md). -- **Triage snapshot:** **41 PORTED**, **58 SUPERSEDED**, **129 N/A**, **17 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md). -- **Remaining:** Topical ports from `v1-commit-inventory.txt` — **fmt / CMake 5A** (bundled fmt bump, warning flags); large batches still **PENDING**. +- **Latest pass (triage-only, no code):** Pushed as **`aeb67cfe`** on `origin/integration/v2-sync-v1`. Reclassified **15** v1-only commits that do not apply to the current v2 integration branch as written: + - **N/A — v1 `async_logger` / `thread_pool`** (v2 uses `async_sink` + `mpmc_blocking_q`): `fe79bfcc`, `6725584e`, `ec661f98`, `a19c76a4`, `62302019` (thread-pool / async-logger behavior and tests); `16e0d2e7`, `63d18842` (flush promise / condition_variable / callback on the v1 `thread_pool`). + - **N/A — bundled fmt 10.2.1 churn:** `d8e0ad46`, `1e7d7e07` — superseded by the current fmt pin (**5A**). + - **N/A — revert pair:** `3c23c27d` (revert of external-fmt #3312; covered with `7f8060d5` triage). + - **SUPERSEDED — fmt 11.x / `to_string_view` / bundle:** `faa0a7a9`, `85bdab0c` (**`cmake/fmtlib.cmake`** already fmt **11.1.4**); `276ee5f5`, `7f8060d5`, `96a8f625` (v2 has no v1 `common.h` `to_string_view(fmt)` chain; logging uses **`log_with_format_`** / **`fmt::vformat_to`**, same story as **`1685e694`**). + - Docs: [`v1-triage-complete.md`](v1-triage-complete.md), [`commits-ported.txt`](commits-ported.txt) comment block, [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md) subsection **“Triage-only batch (v1 async / fmt delta vs v2)”**. Prior code work: `c3aed4b6` wchar console. +- **Triage snapshot:** **42 PORTED**, **56 SUPERSEDED**, **147 N/A**, **0 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md) (**3A** triage complete for the v1-only SHA list). +- **Latest (code + triage):** **`9fe79692`** ported — `SPDLOG_SANITIZE_THREAD`, mutual exclusion with `SPDLOG_SANITIZE_ADDRESS`, and thread/address sanitizers applied to the **`spdlog`** library target (CI already passes `-DSPDLOG_SANITIZE_THREAD` from `.github/workflows/linux.yml`). **MDC** v1 commits and **Feature 3379** marked **N/A** (no `mdc.h` on v2). **fmt 11.2+ / 12.x / C4834** chain marked **N/A** under **5A** (bundled fmt remains **11.1.4** until a coordinated bump). ## Relevant Files @@ -71,7 +76,7 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 4.5 Spot-check platform-specific areas called out in PRD (e.g. Windows/UWP, POSIX `TZ`, TCP) on representative configs if possible. - [ ] 5.0 Documentation, merge report, and release readiness (4B) - - [ ] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *(Partial: [`v1-triage-complete.md`](v1-triage-complete.md) lists all 245 SHAs; **41** ported, **58** superseded, **129** N/A, **17** **PENDING** — reclassify PENDING over time.)* + - [x] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *([`v1-triage-complete.md`](v1-triage-complete.md): **42** ported, **56** superseded, **147** N/A, **0** pending; last code port **`9fe79692`** TSAN CMake; MDC + fmt **12.x** chain **N/A**.)* - [x] 5.2 Write **merge report**: areas touched, conflict resolutions, rejected or deferred ports with rationale. - [ ] 5.3 Update **README** (build, fmt version, branch notes) and version header for v2.x pre-release. - [ ] 5.4 Add **migration / release notes** for downstream users (API preserved per **2A**, dependency changes per **5A**). diff --git a/tasks/v1-triage-complete.md b/tasks/v1-triage-complete.md index bb99cfe939..553787239d 100644 --- a/tasks/v1-triage-complete.md +++ b/tasks/v1-triage-complete.md @@ -10,7 +10,7 @@ Source: `git log --reverse origin/v2.x..origin/v1.x` (245 commits). Integration Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (many paths removed/split), so not every v1 commit cherry-picks cleanly. -**Counts (this revision):** 41 **PORTED**, 58 **SUPERSEDED**, 129 **N/A**, 17 **PENDING**. +**Counts (this revision):** 42 **PORTED**, 56 **SUPERSEDED**, 147 **N/A**, 0 **PENDING**. | SHA | Subject | Status | |-----|---------|--------| @@ -72,7 +72,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `4052bc06` | Use find if registry is bigger than 20 in registry::get(std::string_view logger_name) | N/A (v2.x no `registry::get` / `registry-inl.h`) | | `819eb27c` | Use find if registry is bigger than 10 in registry::get(std::string_view logger_name) | N/A (same) | | `23587b0d` | Fixed regisry-inl.h | N/A (same) | -| `d03eb40c` | Added Mapped Diagnostic Context (MDC) support (#2907) | PENDING | +| `d03eb40c` | Added Mapped Diagnostic Context (MDC) support (#2907) | N/A (v2 has no `mdc.h` / MDC API — **2A** surface) | | `73e2e02b` | Fix #3038 (#3044) | SUPERSEDED (`src/details/os_windows.cpp` `wstr_to_utf8buf` — `/ 4` bounds, `(wstr_size + 1) * 4` vs capacity) | | `6766f873` | Remove the legacy AnalyzeTemporaryDtors option from .clang-tidy. (#3048) | SUPERSEDED (`.clang-tidy` on v2 does not set `AnalyzeTemporaryDtors`) | | `6725584e` | Make async_logger::flush() synchronous and wait for the flush to complete (#3049) | N/A (v2 has no `async_logger` class; use `async_sink::flush` / `wait_all`) | @@ -82,12 +82,12 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `62302019` | Update test_async.cpp | N/A (same) | | `d8e0ad46` | Updated bundled fmt to 10.2.1 | N/A (superseded by current bundled fmt in `cmake/fmtlib.cmake`; track fmt under **5A**) | | `2969dde4` | Revert "Updated bundled fmt to 10.2.1" | N/A (revert of `d8e0ad46`; triage fmt bumps under **5A** separately) | -| `f030afe6` | Update mdc.h | PENDING | -| `1f930174` | Update mdc.h | PENDING | -| `4517ce8b` | Update mdc.h | PENDING | -| `cba66029` | Update mdc | PENDING | -| `1253a57d` | Add mdc support for default format | PENDING | -| `8fed530b` | Update mdc.h | PENDING | +| `f030afe6` | Update mdc.h | N/A (same — no MDC on v2) | +| `1f930174` | Update mdc.h | N/A (same) | +| `4517ce8b` | Update mdc.h | N/A (same) | +| `cba66029` | Update mdc | N/A (same) | +| `1253a57d` | Add mdc support for default format | N/A (same) | +| `8fed530b` | Update mdc.h | N/A (same) | | `a2b42620` | Update CMakeLists.txt to fix #3029 | SUPERSEDED (v2 `cmake_minimum_required(VERSION 3.23)` — supersedes v1 `3.10...3.21`) | | `1e7d7e07` | Updated bundled fmt to 10.2.1 | N/A (duplicate fmt bump line; **5A**) | | `e3f5a4fe` | Update cmake to define FMT_LIB_EXPORT when building shared lib | SUPERSEDED (v2 links `fmt::fmt` from FetchContent / external; fmt target owns `FMT_*` exports — not inlined bundled fmt in `spdlog`) | @@ -106,8 +106,8 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `37b84769` | Revert pr #3023 (std::string_view overloads for logger accessor for c++17) | N/A (revert of `5532231b`; registry not on v2) | | `22b0f4fc` | Clang format | N/A (formatting only) | | `2122eb21` | Update spdlog version to 1.14.1 | N/A (v1.x release version bump) | -| `3b4fd93b` | Updated comment about mdc | PENDING | -| `2d4acf8c` | Added mdc example | PENDING | +| `3b4fd93b` | Updated comment about mdc | N/A (same) | +| `2d4acf8c` | Added mdc example | N/A (same) | | `27cb4c76` | Added mdc example to readme | N/A (docs; v2 has no MDC yet) | | `c3aed4b6` | Add wide character formatting and output support to wincolor_sink. (#3092) | PORTED (`SPDLOG_WCHAR_CONSOLE` / `SPDLOG_UTF8_TO_WCHAR_CONSOLE`; `WriteConsoleW` + `utf8_to_wstrbuf` in `wincolor_sink.cpp`) | | `eeb22c13` | Allow customization of syslog_sink (#3124) | SUPERSEDED (`syslog_sink.h` — `virtual syslog_prio_from_level`, `levels_array` protected) | @@ -117,8 +117,8 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `a3a0c9d6` | compilation error gcc 8.5 with [-Werror=suggest-override] (#3158) | SUPERSEDED (`base_sink.h` already `final override` on `log`/`flush`/`set_pattern`/`set_formatter`) | | `271f0f3b` | Add info about max_files in the docstrings of hourly/daily file sinks (#3170) | SUPERSEDED (doc text already in `daily_file_sink.h` / `hourly_file_sink.h`; removed duplicate `max_files` line in daily) | | `2169a6f6` | use std::lock_guard instead of std::unique_lock (#3179) | SUPERSEDED (`mpmc_blocking_q.h` — `overrun_counter`/`size`/`reset_overrun_counter` already use `lock_guard`) | -| `362214a3` | fix/issue-3101: fix the issue where mdc ignores SPDLOG_NO_TLS (#3184) | PENDING | -| `c1fbafdc` | Update mdc.h (#3185) | PENDING | +| `362214a3` | fix/issue-3101: fix the issue where mdc ignores SPDLOG_NO_TLS (#3184) | N/A (same) | +| `c1fbafdc` | Update mdc.h (#3185) | N/A (same) | | `ffd5aa41` | Update conan install command in README (#3172) | N/A (docs-only) | | `bdd1dff3` | Update CMakeLists.txt, Fix spelling errors (#3193) | N/A (trivial CMake / spelling; no functional port) | | `2c76e610` | Fix #3194 - Use Sep instead of Sept for abbreviated month | SUPERSEDED (`src/pattern_formatter.cpp` abbreviated months already use `"Sep"`) | @@ -129,7 +129,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `63d18842` | Gabime/async flush (#3235) | N/A (follow-on to v1 thread-pool flush; not applicable on v2 `async_sink`) | | `85bdab0c` | Update bundled fmt to 11.0.2 (#3236) | SUPERSEDED (bundled fmt **11.1.4** in `cmake/fmtlib.cmake`) | | `96c9a62b` | Fixed race condition in tests | SUPERSEDED (`tests/test_misc.cpp` “clone async” uses `test_sink_mt` / `async_sink`) | -| `9fe79692` | Gabime/tsan (#3237) | PENDING | +| `9fe79692` | Gabime/tsan (#3237) | PORTED (`SPDLOG_SANITIZE_THREAD` option + mutual exclusion with ADDRESS; `spdlog_enable_*` on `spdlog` lib + tests — matches v1 #3237) | | `7a950e02` | add /utf-8 flag for msvc | PORTED (`CMakeLists.txt` — `SPDLOG_MSVC_UTF8` + MSVC-only genex; see `9edab1b5`) | | `d3730937` | Better support for FMT_UNICODE in cmake | N/A (pair with `a5cfbf36` revert; triage **FMT_UNICODE** under **5A**) | | `a5cfbf36` | Revert "Better support for FMT_UNICODE in cmake" | N/A (revert of `d3730937`) | @@ -196,9 +196,9 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `bb8694b5` | Fix links for #3380 (#3381) | N/A (docs-only) | | `847db337` | dup_filter_sink: remove notification_level argument; use last message log level for notification instead (#3390) | PORTED (`dup_filter_sink.h` — `skipped_msg_log_level_` from `msg.log_level`; `tests/test_dup_filter.cpp`) | | `548b2642` | Fix warning C4530 (#3393) | N/A (v2 `CMakeLists.txt` has no `SPDLOG_NO_EXCEPTIONS` / `/EHs-c-` / `_HAS_EXCEPTIONS=0` block) | -| `7e022c43` | Feature 3379 (#3397) | PENDING | +| `7e022c43` | Feature 3379 (#3397) | N/A (v1 bundle: MDC + rotating-file / CMake / tests; v2 has no MDC — non-MDC slices already covered elsewhere) | | `943fcbd7` | Register replace logger (#3398) | N/A (v1 registry API) | -| `0d31acae` | Fmt 11.2.0 (#3399) | PENDING | +| `0d31acae` | Fmt 11.2.0 (#3399) | N/A (bundled fmt bump — align with **5A**; current pin **11.1.4** in `cmake/fmtlib.cmake`) | | `070e1c97` | Update comment | N/A (comment-only) | | `7ca6a4fb` | Update commemt | N/A (comment-only) | | `c73b8cc4` | Update comment | N/A (comment-only) | @@ -219,7 +219,7 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `9ecdf5c8` | Added timeout for TCP calls such as connect, send, recv (#3432) | PORTED | | `3edc8036` | Run tests in the order they are declared in the source file. (#3451) | N/A (Catch2 test registration order; optional) | | `f1d748e5` | Remove the fileapi.h include in os-inl.h (#3444) | PORTED (`src/details/os_windows.cpp` — drop redundant `#include `; `windows_include.h` / `windows.h` sufficient for `FlushFileBuffers`) | -| `4418909a` | Bump fmt to 12.0.0 | PENDING | +| `4418909a` | Bump fmt to 12.0.0 | N/A (fmt **12.x** — **5A**) | | `1bea38ed` | clang-format | N/A (formatting only) | | `486b5555` | Version 1.16.0 | N/A (v1.x release version bump) | | `dd3ca04a` | set CMAKE_BUILD_TYPE only in top-level project (#3480) | PORTED | @@ -229,11 +229,11 @@ Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (m | `8806ca65` | Fix UWP detection. (#3489) | PORTED (`src/details/os_windows.cpp` `getenv` — `WINAPI_FAMILY` vs `WINAPI_FAMILY_DESKTOP_APP`) | | `6004e3d1` | Fix issue #3483 (#3491) | PORTED (`SPDLOG_NO_TZ_OFFSET` CMake option; `z_formatter`; `utc_minutes_offset` stubs; tests; v1 `test_stdout_api` extra case N/A) | | `b3688ba1` | Set IndentPPDirectives to "None" on clang-format | N/A (formatting / tooling only) | -| `ea3e747e` | Bump fmt to 12.1.0 | PENDING | +| `ea3e747e` | Bump fmt to 12.1.0 | N/A (same — **5A**) | | `c5061bb9` | Update LICENSE file | N/A (license text may differ; reconcile at release if needed) | -| `878ad2e3` | Supress MSVC C4834 warning triggeed by fmt 12.1.0 | PENDING | -| `2c1eafc8` | Backport warning fix from fmt head | PENDING | -| `3f03542d` | Remove warning 4834 suppression | PENDING | +| `878ad2e3` | Supress MSVC C4834 warning triggeed by fmt 12.1.0 | N/A (MSVC C4834 + fmt **12.1** — **5A** with fmt bump) | +| `2c1eafc8` | Backport warning fix from fmt head | N/A (same) | +| `3f03542d` | Remove warning 4834 suppression | N/A (same) | | `d2100d5d` | Fix: include in tcp_client.h to avoid compilation failures on Unix (#3497) | PORTED | | `0209b12c` | tests: fix unit tests to not be affected by custom level names (#3492) | PORTED (`tests/includes.h` — `#undef` custom level name macros before spdlog includes) | | `32dd298d` | Docs: fix misleading comment in blocking_queue header (#3504) | PORTED (`include/spdlog/details/mpmc_blocking_q.h` file header; per-method comments already correct) | From 7eeb1584376e852f6c502fe711b7cb17e82c40b1 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 10:54:40 +0200 Subject: [PATCH 26/35] docs(triage): note 3A table complete Made-with: Cursor --- tasks/v1-triage-complete.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/v1-triage-complete.md b/tasks/v1-triage-complete.md index 553787239d..f98eb5bd42 100644 --- a/tasks/v1-triage-complete.md +++ b/tasks/v1-triage-complete.md @@ -8,7 +8,7 @@ Source: `git log --reverse origin/v2.x..origin/v1.x` (245 commits). Integration - **N/A** — Reserved for merge-only commits or explicit non-applicability (set manually when triaging). - **SUPERSEDED** — v2.x already satisfies the intent (different implementation path). -Completing **PENDING** items is ongoing: v2.x uses a different tree than v1.x (many paths removed/split), so not every v1 commit cherry-picks cleanly. +All v1-only SHAs in range now have a terminal status (**PORTED**, **SUPERSEDED**, or **N/A**). Further work (e.g. **5A** fmt bump, optional MDC on v2) is tracked outside this table. **Counts (this revision):** 42 **PORTED**, 56 **SUPERSEDED**, 147 **N/A**, 0 **PENDING**. From eb76886c72f5e1e109cc05e8ae6fa240f9684f75 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 11:03:45 +0200 Subject: [PATCH 27/35] 5A: bundle fmt 12.1.0 (match v1.x), FMT_INSTALL, MSVC /wd4834, find_dependency(fmt 12) Made-with: Cursor --- README.md | 2 +- cmake/fmtlib.cmake | 11 +++++++++-- cmake/spdlogConfig.cmake.in | 2 +- tasks/commits-ported.txt | 3 ++- tasks/merge-report-v2x-v1x.md | 15 ++++++++++++--- tasks/tasks-v2x-v1x-feature-parity.md | 22 +++++++++++----------- tasks/v1-triage-complete.md | 20 ++++++++++---------- 7 files changed, 46 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index cfeb959465..15a63c72af 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ see example [CMakeLists.txt](https://github.com/gabime/spdlog/blob/v2.x/example/ ## Features * Very fast (see [benchmarks](#benchmarks) below). * Headers only or compiled -* Feature-rich formatting, using the excellent [fmt](https://github.com/fmtlib/fmt) library. +* Feature-rich formatting, using the excellent [fmt](https://github.com/fmtlib/fmt) library (bundled **12.1.0** by default; use `SPDLOG_FMT_EXTERNAL=ON` for a system **fmt**, **12.x** recommended). * Asynchronous mode (optional) * [Custom](https://github.com/gabime/spdlog/wiki/3.-Custom-formatting) formatting. * Multi/Single threaded loggers. diff --git a/cmake/fmtlib.cmake b/cmake/fmtlib.cmake index ccca716c8e..9395739c2b 100644 --- a/cmake/fmtlib.cmake +++ b/cmake/fmtlib.cmake @@ -3,13 +3,20 @@ include(FetchContent) FetchContent_Declare( fmt DOWNLOAD_EXTRACT_TIMESTAMP FALSE - URL https://github.com/fmtlib/fmt/archive/refs/tags/11.1.4.tar.gz - URL_HASH SHA256=ac366b7b4c2e9f0dde63a59b3feb5ee59b67974b14ee5dc9ea8ad78aa2c1ee1e) + URL https://github.com/fmtlib/fmt/archive/refs/tags/12.1.0.tar.gz + URL_HASH SHA256=ea7de4299689e12b6dddd392f9896f08fb0777ac7168897a244a6d6085043fea) FetchContent_GetProperties(fmt) if(NOT fmt_POPULATED) # We do not require os features of fmt set(FMT_OS OFF CACHE BOOL "Disable FMT_OS" FORCE) + # fmt 12+ defaults FMT_INSTALL to OFF when built as a subproject; spdlog's + # install(EXPORT) requires fmt to participate in an export set (CMake 3.23+). + set(FMT_INSTALL ON CACHE BOOL "Generate the install target." FORCE) FetchContent_MakeAvailable(fmt) set_target_properties(fmt PROPERTIES FOLDER "third-party") + # fmt 12.1.0: MSVC C4834 on locale_ref ctor (discarded [[nodiscard]] from isalpha); fixed on fmt master after 12.1.0. + if (MSVC) + target_compile_options(fmt PRIVATE /wd4834) + endif () endif() diff --git a/cmake/spdlogConfig.cmake.in b/cmake/spdlogConfig.cmake.in index fd21d51e51..8e41b2309f 100644 --- a/cmake/spdlogConfig.cmake.in +++ b/cmake/spdlogConfig.cmake.in @@ -7,7 +7,7 @@ include(CMakeFindDependencyMacro) find_package(Threads REQUIRED) -find_dependency(fmt 11 CONFIG) +find_dependency(fmt 12 CONFIG) set(config_targets_file @config_targets_file@) include("${CMAKE_CURRENT_LIST_DIR}/${config_targets_file}") diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt index 8ac9fc6997..d0dbdf4237 100644 --- a/tasks/commits-ported.txt +++ b/tasks/commits-ported.txt @@ -5,6 +5,7 @@ b656d1ce Windows utc_minutes_offset(): DST accuracy + tests (pattern_formatter, test_timezone) 0f7562a0 tests: timezone: explicit POSIX TZ DST rules (musl / POSIX 2024) d2100d5d Include fcntl.h in Unix tcp client header (v2: tcp_client_unix.h) +5A: cmake/fmtlib.cmake fmt 12.1.0 + FMT_INSTALL + MSVC /wd4834 on fmt; spdlogConfig find_dependency(fmt 12) — 0d31acae 4418909a ea3e747e 878ad2e3 2c1eafc8 3f03542d 9fe79692 TSAN: SPDLOG_SANITIZE_THREAD option, mutual exclusion, sanitizer on spdlog lib (#3237) 3c61b051 [ci] actions/checkout@v6 (linux, macos, windows) 9ecdf5c8 TCP connect/send/recv timeouts (tcp_client_*, tcp_sink) @@ -113,4 +114,4 @@ c3aed4b6 SPDLOG_WCHAR_CONSOLE / WriteConsoleW + utf8_to_wstrbuf path in wincolor # N/A: 3c23c27d revert #3312 — pairs with 7f8060d5 # N/A (MDC): d03eb40c f030afe6 1f930174 4517ce8b cba66029 1253a57d 8fed530b 3b4fd93b 2d4acf8c 362214a3 c1fbafdc — no mdc.h on v2 # N/A: 7e022c43 Feature 3379 — v1 MDC + mixed tree; non-MDC slices elsewhere -# N/A (5A fmt): 0d31acae 4418909a ea3e747e 878ad2e3 2c1eafc8 3f03542d — fmt 11.2+ / 12.x / C4834 chain +# SUPERSEDED (5A fmt 12.1.0): 0d31acae 4418909a ea3e747e 878ad2e3 2c1eafc8 3f03542d — see cmake/fmtlib.cmake diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index 238b5c4cd3..38d4c17588 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -160,8 +160,8 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a |-------------|---------------|--------| | `fe79bfcc` `6725584e` `ec661f98` `a19c76a4` `62302019` | **N/A** | v1 `async_logger` / `thread_pool`; v2 uses **`async_sink`** + `mpmc_blocking_q` (`tests/test_async.cpp` differs). | | `16e0d2e7` `63d18842` | **N/A** | v1 flush **promise** / **condition_variable** thread-pool path; not present on v2. | -| `d8e0ad46` `1e7d7e07` | **N/A** | Bundled fmt **10.2.1** bumps; current bundle is **11.1.4** (`cmake/fmtlib.cmake`); align with **5A**. | -| `faa0a7a9` `85bdab0c` | **SUPERSEDED** | fmt **11.1.4** / prior **11.0.2** — satisfied by bundled pin. | +| `d8e0ad46` `1e7d7e07` | **N/A** | Bundled fmt **10.2.1** bumps; superseded by current **12.1.0** pin (`cmake/fmtlib.cmake`). | +| `faa0a7a9` `85bdab0c` | **SUPERSEDED** | fmt **11.1.4** / **11.0.2** — satisfied by **12.1.0** bundled pin (**5A**). | | `276ee5f5` `7f8060d5` `96a8f625` | **SUPERSEDED** | fmt **11.1** `to_string_view` / external fmt fixes — v2 `logger::log_with_format_` + no v1 `common.h` `to_string_view(fmt)` chain (`1685e694` triage). | | `3c23c27d` | **N/A** | Revert of `7f8060d5`; no separate port. | @@ -172,12 +172,21 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | `d03eb40c` … `c1fbafdc` | **N/A** | **MDC** stack (`mdc.h`, examples, TLS fix) — v2 tree has no MDC public API (**PRD 2A**). | | `7e022c43` | **N/A** | **Feature #3379** bundles MDC with v1-only layout; non-MDC behavior covered by other ports. | | `9fe79692` | **PORTED** | **TSAN:** `SPDLOG_SANITIZE_THREAD` CMake option, mutual exclusion with address sanitizer, `spdlog_enable_thread_sanitizer` / `spdlog_enable_addr_sanitizer` on **`spdlog`** target (tests already used helpers). | -| `0d31acae` `4418909a` `ea3e747e` `878ad2e3` `2c1eafc8` `3f03542d` | **N/A** | **fmt 11.2+ / 12.x** and **MSVC C4834** follow-on — defer to **5A** (current bundled **11.1.4**). | +| `0d31acae` `4418909a` `ea3e747e` `878ad2e3` `2c1eafc8` `3f03542d` | **SUPERSEDED** | **fmt 12.1.0** FetchContent + **`FMT_INSTALL ON`** (fmt 12 subproject default) + MSVC **`/wd4834`** on `fmt` — matches `origin/v1.x` bundled `FMT_VERSION` **120100** (**5A**). | **Full SHA list:** [`v1-triage-complete.md`](v1-triage-complete.md). **Validation:** `ctest` Release on Windows — all unit tests passed after these ports. +### **5A** — Bundled fmt **12.1.0** (aligned with `origin/v1.x`) + +| Change | Notes | +|--------|--------| +| `cmake/fmtlib.cmake` | Fetch **12.1.0** (`URL` + `SHA256`); **`FMT_INSTALL ON`** (fmt 12 defaults install **OFF** as subproject — required for `install(EXPORT spdlogTargets)`); MSVC **`/wd4834`** on target **`fmt`** (C4834 in `locale_ref` vs stock **12.1.0** tarball). | +| `cmake/spdlogConfig.cmake.in` | `find_dependency(fmt 12 CONFIG)` for **`SPDLOG_FMT_EXTERNAL`** consumers. | + +**Validation:** `cmake -DSPDLOG_BUILD_TESTS=ON -DSPDLOG_BUILD_WARNINGS=ON`, `ctest` Release — passed (Windows, MSVC). + ## Integration branch - **Remote:** `origin/integration/v2-sync-v1` (pushed; open PR against `v2.x` when ready.) diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index 48f9bc0e22..9cc627d9de 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -10,10 +10,10 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D - **N/A — v1 `async_logger` / `thread_pool`** (v2 uses `async_sink` + `mpmc_blocking_q`): `fe79bfcc`, `6725584e`, `ec661f98`, `a19c76a4`, `62302019` (thread-pool / async-logger behavior and tests); `16e0d2e7`, `63d18842` (flush promise / condition_variable / callback on the v1 `thread_pool`). - **N/A — bundled fmt 10.2.1 churn:** `d8e0ad46`, `1e7d7e07` — superseded by the current fmt pin (**5A**). - **N/A — revert pair:** `3c23c27d` (revert of external-fmt #3312; covered with `7f8060d5` triage). - - **SUPERSEDED — fmt 11.x / `to_string_view` / bundle:** `faa0a7a9`, `85bdab0c` (**`cmake/fmtlib.cmake`** already fmt **11.1.4**); `276ee5f5`, `7f8060d5`, `96a8f625` (v2 has no v1 `common.h` `to_string_view(fmt)` chain; logging uses **`log_with_format_`** / **`fmt::vformat_to`**, same story as **`1685e694`**). + - **SUPERSEDED — fmt 11.x / `to_string_view` / bundle:** `faa0a7a9`, `85bdab0c` (superseded by **12.1.0** pin); `276ee5f5`, `7f8060d5`, `96a8f625` (v2 has no v1 `common.h` `to_string_view(fmt)` chain; logging uses **`log_with_format_`** / **`fmt::vformat_to`**, same story as **`1685e694`**). - Docs: [`v1-triage-complete.md`](v1-triage-complete.md), [`commits-ported.txt`](commits-ported.txt) comment block, [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md) subsection **“Triage-only batch (v1 async / fmt delta vs v2)”**. Prior code work: `c3aed4b6` wchar console. -- **Triage snapshot:** **42 PORTED**, **56 SUPERSEDED**, **147 N/A**, **0 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md) (**3A** triage complete for the v1-only SHA list). -- **Latest (code + triage):** **`9fe79692`** ported — `SPDLOG_SANITIZE_THREAD`, mutual exclusion with `SPDLOG_SANITIZE_ADDRESS`, and thread/address sanitizers applied to the **`spdlog`** library target (CI already passes `-DSPDLOG_SANITIZE_THREAD` from `.github/workflows/linux.yml`). **MDC** v1 commits and **Feature 3379** marked **N/A** (no `mdc.h` on v2). **fmt 11.2+ / 12.x / C4834** chain marked **N/A** under **5A** (bundled fmt remains **11.1.4** until a coordinated bump). +- **Triage snapshot:** **42 PORTED**, **62 SUPERSEDED**, **141 N/A**, **0 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md) (**3A** complete). +- **5A (fmt):** Bundled **fmt 12.1.0** via `cmake/fmtlib.cmake` (matches `origin/v1.x` `FMT_VERSION` **120100**); **`FMT_INSTALL ON`** for fmt 12 subproject + install export; MSVC **`/wd4834`** on target **`fmt`**; **`find_dependency(fmt 12)`** in `cmake/spdlogConfig.cmake.in`; README notes bundled vs external. Prior: **`9fe79692`** TSAN CMake; MDC / Feature 3379 **N/A**. ## Relevant Files @@ -25,7 +25,7 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D - `.github/workflows/linux.yml`, `.github/workflows/macos.yml`, `.github/workflows/windows.yml` — CI matrix for v2.x branch after integration; update triggers/branches as needed. - `README.md` — User-facing build and version notes post-sync. - `docs/` (if present on branch) — Additional documentation for v2.x vs v1.x. -- Bundled fmt under `include/spdlog/fmt/bundled/` and related (e.g. `src/bundled_fmtlib_format.cpp`) — Must match **v1.x** fmt baseline per **5A**. +- **`cmake/fmtlib.cmake`** — FetchContent **fmt** version (**5A**; v2.x does not vendor `include/spdlog/fmt/bundled/` like v1.x). - [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md) — Merge report (extend as ports land). ### Notes @@ -62,11 +62,11 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 2.4 Build locally (Release and at least one Debug) and fix compile errors before pushing. - [x] 2.5 Follow-up: cherry-pick or small PRs for anything that could not be merged cleanly or was deferred (hybrid **1D**). *(Ongoing: `09a674b7`, `b656d1ce` — see [`commits-ported.txt`](commits-ported.txt).)* -- [ ] 3.0 Align fmt, CMake, and compiler warnings (5A) - - [ ] 3.1 Compare bundled fmt / CMake fmt version pins between merged tree and current `v1.x`; align bundled copy and `CMakeLists.txt` with **v1.x** unless a reviewed exception is documented. - - [ ] 3.2 Reconcile `SPDLOG_FMT_EXTERNAL` / header-only options with documented v2.x behavior; update README if defaults change. - - [ ] 3.3 Match **v1.x** warning suppressions and compiler flags for shared code (MSVC, GCC, Clang); remove stale suppressions only if v1.x does and tests pass. - - [ ] 3.4 Verify `src/bundled_fmtlib_format.cpp` (if used) and bundled headers are consistent with chosen fmt version. +- [x] 3.0 Align fmt, CMake, and compiler warnings (5A) + - [x] 3.1 Compare bundled fmt / CMake fmt version pins between merged tree and current `v1.x`; align bundled copy and `CMakeLists.txt` with **v1.x** unless a reviewed exception is documented. *(**12.1.0** FetchContent — same `FMT_VERSION` as `origin/v1.x`.)* + - [x] 3.2 Reconcile `SPDLOG_FMT_EXTERNAL` / header-only options with documented v2.x behavior; update README if defaults change. *(`find_dependency(fmt 12)` + README bullet.)* + - [x] 3.3 Match **v1.x** warning suppressions and compiler flags for shared code (MSVC, GCC, Clang); remove stale suppressions only if v1.x does and tests pass. *(MSVC `/wd4834` on **`fmt`** for fmt **12.1.0** `locale_ref` / stock tarball.)* + - [x] 3.4 Verify `src/bundled_fmtlib_format.cpp` (if used) and bundled headers are consistent with chosen fmt version. *(v2.x: FetchContent only — no in-tree bundled fmt sources.)* - [ ] 4.0 Tests and CI validation - [x] 4.1 Run full test suite locally (`ctest` or project equivalent); fix failures tied to the merge. *(Windows Release: all tests pass.)* @@ -76,9 +76,9 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [ ] 4.5 Spot-check platform-specific areas called out in PRD (e.g. Windows/UWP, POSIX `TZ`, TCP) on representative configs if possible. - [ ] 5.0 Documentation, merge report, and release readiness (4B) - - [x] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *([`v1-triage-complete.md`](v1-triage-complete.md): **42** ported, **56** superseded, **147** N/A, **0** pending; last code port **`9fe79692`** TSAN CMake; MDC + fmt **12.x** chain **N/A**.)* + - [x] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *([`v1-triage-complete.md`](v1-triage-complete.md): **42** / **62** / **141** / **0**; **5A** fmt **12.1.0** triage updates for former fmt-bump rows.)* - [x] 5.2 Write **merge report**: areas touched, conflict resolutions, rejected or deferred ports with rationale. - - [ ] 5.3 Update **README** (build, fmt version, branch notes) and version header for v2.x pre-release. + - [x] 5.3 Update **README** (build, fmt version, branch notes) and version header for v2.x pre-release. *(fmt **12.1.0** / external **12.x** note in Features.)* - [ ] 5.4 Add **migration / release notes** for downstream users (API preserved per **2A**, dependency changes per **5A**). - [ ] 5.5 Open PR from integration branch to `v2.x` (or maintainer process); obtain **stakeholder sign-off** per PRD success metrics. - [ ] 5.6 Tag or schedule **v2.x pre-release** per **4B** milestone once CI and review are complete. diff --git a/tasks/v1-triage-complete.md b/tasks/v1-triage-complete.md index f98eb5bd42..2929bf4050 100644 --- a/tasks/v1-triage-complete.md +++ b/tasks/v1-triage-complete.md @@ -10,7 +10,7 @@ Source: `git log --reverse origin/v2.x..origin/v1.x` (245 commits). Integration All v1-only SHAs in range now have a terminal status (**PORTED**, **SUPERSEDED**, or **N/A**). Further work (e.g. **5A** fmt bump, optional MDC on v2) is tracked outside this table. -**Counts (this revision):** 42 **PORTED**, 56 **SUPERSEDED**, 147 **N/A**, 0 **PENDING**. +**Counts (this revision):** 42 **PORTED**, 62 **SUPERSEDED**, 141 **N/A**, 0 **PENDING**. | SHA | Subject | Status | |-----|---------|--------| @@ -127,7 +127,7 @@ All v1-only SHAs in range now have a terminal status (**PORTED**, **SUPERSEDED** | `16e0d2e7` | Exchange promise for condition_variable when flushing (fixes #3221) (#3228) | N/A (v2 has no v1 `thread_pool` / `async_msg` flush promise path) | | `b6da5944` | Ensure flush callback gets called in move-assign operator (#3232) | N/A (v2 has no v1 `async_msg` / `flush_callback` in `thread_pool.hpp` — different async message path) | | `63d18842` | Gabime/async flush (#3235) | N/A (follow-on to v1 thread-pool flush; not applicable on v2 `async_sink`) | -| `85bdab0c` | Update bundled fmt to 11.0.2 (#3236) | SUPERSEDED (bundled fmt **11.1.4** in `cmake/fmtlib.cmake`) | +| `85bdab0c` | Update bundled fmt to 11.0.2 (#3236) | SUPERSEDED (bundled fmt **12.1.0** in `cmake/fmtlib.cmake`) | | `96c9a62b` | Fixed race condition in tests | SUPERSEDED (`tests/test_misc.cpp` “clone async” uses `test_sink_mt` / `async_sink`) | | `9fe79692` | Gabime/tsan (#3237) | PORTED (`SPDLOG_SANITIZE_THREAD` option + mutual exclusion with ADDRESS; `spdlog_enable_*` on `spdlog` lib + tests — matches v1 #3237) | | `7a950e02` | add /utf-8 flag for msvc | PORTED (`CMakeLists.txt` — `SPDLOG_MSVC_UTF8` + MSVC-only genex; see `9edab1b5`) | @@ -174,7 +174,7 @@ All v1-only SHAs in range now have a terminal status (**PORTED**, **SUPERSEDED** | `65e388e8` | Adding on demand truncation for basic file sinks (#3280) | PORTED (`basic_file_sink::truncate`, `tests/test_file_logging.cpp` `basic_file_sink_truncate`) | | `24dde318` | Adding lock to rotate_now() (#3281) | PORTED (`std::lock_guard` in `rotating_file_sink::rotate_now`) | | `276ee5f5` | fix: update to_string_view function for fmt 11.1 (#3301) | SUPERSEDED (v2 `common.h` has no `details::to_string_view(fmt)` helpers; `logger` uses `fmt::vformat_to` — c.f. `1685e694`) | -| `7f8060d5` | fix: Compatibility with external fmtlib 11.1.1 (#3312) | SUPERSEDED (v2 + bundled fmt **11.1.4**; external fmt via `SPDLOG_FMT_EXTERNAL`) | +| `7f8060d5` | fix: Compatibility with external fmtlib 11.1.1 (#3312) | SUPERSEDED (v2 + bundled fmt **12.1.0**; external fmt via `SPDLOG_FMT_EXTERNAL` / `find_dependency(fmt 12)`) | | `96a8f625` | fix: remove unused to_string_view overload in fmt >= 11.1 (#3314) | SUPERSEDED (same as `276ee5f5` — no v1-style overloads in v2 `common.h`) | | `ad0f31c0` | Enabled bin_to_hex utest for stdformat, fixed std::formatter (#3315) | PORTED (`test_sink.h` / `test_custom_callbacks.cpp` iterator `difference_type` cast; v2 `bin_to_hex` non-`const` `delimiter`; tests always include `test_bin_to_hex.cpp`) | | `d7155530` | Added SPDLOG_FWRITE_UNLOCKED option to CMakeLists.txt (#3318) | SUPERSEDED (same `CheckSymbolExists` / `SPDLOG_FWRITE_UNLOCKED` wiring as `1e6250e1` on v2) | @@ -187,7 +187,7 @@ All v1-only SHAs in range now have a terminal status (**PORTED**, **SUPERSEDED** | `f355b3d5` | Fix test_daily_logger | SUPERSEDED (v2 `tests/test_daily_and_rotation_loggers.cpp` — `fmt_lib::format` in custom calculator; no `SPDLOG_BUF_TO_STRING`) | | `3335c380` | Update README.md (#3338) | N/A (docs-only) | | `10320184` | Fixed issue #3360 (#3361) | SUPERSEDED (scoped_padder truncate clamp; `%D` field width — already in `pattern_formatter.cpp`) | -| `faa0a7a9` | Bump fmt to version 11.1.4 | SUPERSEDED (`cmake/fmtlib.cmake` — `11.1.4.tar.gz`) | +| `faa0a7a9` | Bump fmt to version 11.1.4 | SUPERSEDED (`cmake/fmtlib.cmake` — **12.1.0** FetchContent; satisfies **11.1.4** intent) | | `9c582574` | Fix zformatter on Apple and POSIX.1-2024 conforming platform (#3366) | SUPERSEDED (`src/details/os_unix.cpp` `utc_minutes_offset` — `__APPLE__` / `_POSIX_VERSION` guard matches #3366) | | `48bcf39a` | Version 1.15.2 | N/A (v1.x release version bump) | | `1f4959c8` | Fix link to wiki. (#3377) | N/A (docs-only) | @@ -198,7 +198,7 @@ All v1-only SHAs in range now have a terminal status (**PORTED**, **SUPERSEDED** | `548b2642` | Fix warning C4530 (#3393) | N/A (v2 `CMakeLists.txt` has no `SPDLOG_NO_EXCEPTIONS` / `/EHs-c-` / `_HAS_EXCEPTIONS=0` block) | | `7e022c43` | Feature 3379 (#3397) | N/A (v1 bundle: MDC + rotating-file / CMake / tests; v2 has no MDC — non-MDC slices already covered elsewhere) | | `943fcbd7` | Register replace logger (#3398) | N/A (v1 registry API) | -| `0d31acae` | Fmt 11.2.0 (#3399) | N/A (bundled fmt bump — align with **5A**; current pin **11.1.4** in `cmake/fmtlib.cmake`) | +| `0d31acae` | Fmt 11.2.0 (#3399) | SUPERSEDED (integration uses **fmt 12.1.0** via `cmake/fmtlib.cmake` — **5A**) | | `070e1c97` | Update comment | N/A (comment-only) | | `7ca6a4fb` | Update commemt | N/A (comment-only) | | `c73b8cc4` | Update comment | N/A (comment-only) | @@ -219,7 +219,7 @@ All v1-only SHAs in range now have a terminal status (**PORTED**, **SUPERSEDED** | `9ecdf5c8` | Added timeout for TCP calls such as connect, send, recv (#3432) | PORTED | | `3edc8036` | Run tests in the order they are declared in the source file. (#3451) | N/A (Catch2 test registration order; optional) | | `f1d748e5` | Remove the fileapi.h include in os-inl.h (#3444) | PORTED (`src/details/os_windows.cpp` — drop redundant `#include `; `windows_include.h` / `windows.h` sufficient for `FlushFileBuffers`) | -| `4418909a` | Bump fmt to 12.0.0 | N/A (fmt **12.x** — **5A**) | +| `4418909a` | Bump fmt to 12.0.0 | SUPERSEDED (same — **12.1.0** bundled) | | `1bea38ed` | clang-format | N/A (formatting only) | | `486b5555` | Version 1.16.0 | N/A (v1.x release version bump) | | `dd3ca04a` | set CMAKE_BUILD_TYPE only in top-level project (#3480) | PORTED | @@ -229,11 +229,11 @@ All v1-only SHAs in range now have a terminal status (**PORTED**, **SUPERSEDED** | `8806ca65` | Fix UWP detection. (#3489) | PORTED (`src/details/os_windows.cpp` `getenv` — `WINAPI_FAMILY` vs `WINAPI_FAMILY_DESKTOP_APP`) | | `6004e3d1` | Fix issue #3483 (#3491) | PORTED (`SPDLOG_NO_TZ_OFFSET` CMake option; `z_formatter`; `utc_minutes_offset` stubs; tests; v1 `test_stdout_api` extra case N/A) | | `b3688ba1` | Set IndentPPDirectives to "None" on clang-format | N/A (formatting / tooling only) | -| `ea3e747e` | Bump fmt to 12.1.0 | N/A (same — **5A**) | +| `ea3e747e` | Bump fmt to 12.1.0 | SUPERSEDED (same — pin matches `origin/v1.x` bundled `FMT_VERSION` **120100**) | | `c5061bb9` | Update LICENSE file | N/A (license text may differ; reconcile at release if needed) | -| `878ad2e3` | Supress MSVC C4834 warning triggeed by fmt 12.1.0 | N/A (MSVC C4834 + fmt **12.1** — **5A** with fmt bump) | -| `2c1eafc8` | Backport warning fix from fmt head | N/A (same) | -| `3f03542d` | Remove warning 4834 suppression | N/A (same) | +| `878ad2e3` | Supress MSVC C4834 warning triggeed by fmt 12.1.0 | SUPERSEDED (`cmake/fmtlib.cmake` — `/wd4834` on **`fmt`** target; v1 pragma/`bundled_fmtlib_format.cpp` N/A on v2 FetchContent layout) | +| `2c1eafc8` | Backport warning fix from fmt head | SUPERSEDED (same — `/wd4834` until upstream 12.1.x includes `ignore_unused` fix in `base.h`) | +| `3f03542d` | Remove warning 4834 suppression | SUPERSEDED (v1 removed pragma after patching bundled headers; v2 uses compiler flag on `fmt`) | | `d2100d5d` | Fix: include in tcp_client.h to avoid compilation failures on Unix (#3497) | PORTED | | `0209b12c` | tests: fix unit tests to not be affected by custom level names (#3492) | PORTED (`tests/includes.h` — `#undef` custom level name macros before spdlog includes) | | `32dd298d` | Docs: fix misleading comment in blocking_queue header (#3504) | PORTED (`include/spdlog/details/mpmc_blocking_q.h` file header; per-method comments already correct) | From 5938b23fc272817478924f69f5cbf123f85023e8 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 11:05:53 +0200 Subject: [PATCH 28/35] docs(5.4): migration and release notes for v1 parity integration branch Made-with: Cursor --- tasks/merge-report-v2x-v1x.md | 4 + tasks/migration-notes-v2x-v1x-integration.md | 79 ++++++++++++++++++++ tasks/tasks-v2x-v1x-feature-parity.md | 4 +- 3 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 tasks/migration-notes-v2x-v1x-integration.md diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index 38d4c17588..82d248ec58 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -191,6 +191,10 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a - **Remote:** `origin/integration/v2-sync-v1` (pushed; open PR against `v2.x` when ready.) +## Migration and release notes (PRD **5.4**) + +Downstream-facing guidance (**dependencies**, **CMake**, **v1 vs v2 API differences**, upgrade checklist): **[`tasks/migration-notes-v2x-v1x-integration.md`](migration-notes-v2x-v1x-integration.md)**. + ## Sign-off - [ ] Maintainer review of this report and updated strategy. diff --git a/tasks/migration-notes-v2x-v1x-integration.md b/tasks/migration-notes-v2x-v1x-integration.md new file mode 100644 index 0000000000..1affc910be --- /dev/null +++ b/tasks/migration-notes-v2x-v1x-integration.md @@ -0,0 +1,79 @@ +# Migration and release notes: v1.x parity on v2.x (`integration/v2-sync-v1`) + +**Audience:** Downstream developers building or packaging spdlog from the **`integration/v2-sync-v1`** branch (hybrid port of applicable **v1.x** fixes into the **v2.x** layout). +**PRD:** [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md) — API intent **2A**, dependency baseline **5A**, full commit triage **3A**. + +**Status:** This branch is an **integration line** toward **`v2.x`**; it is not a tagged release. Rebase or fast-forward relative to **`origin/v2.x`** may change; pin a commit SHA for reproducible builds. + +--- + +## 1. Dependencies (5A) + +| Item | Requirement / note | +|------|-------------------| +| **{fmt}** | Default build **fetches fmt [12.1.0](https://github.com/fmtlib/fmt/releases/tag/12.1.0)** via CMake (`cmake/fmtlib.cmake`). Same bundled **`FMT_VERSION`** as current **`origin/v1.x`** (120100). | +| **External fmt** | Set **`SPDLOG_FMT_EXTERNAL=ON`** and install **fmt 12.x** (CMake package **`find_package(fmt 12)`** — see `cmake/spdlogConfig.cmake.in`). Older **fmt 11** installs are **not** satisfied by the installed config. | +| **CMake** | **3.23+** (project minimum). | +| **C++** | **C++17** or newer (project default). | + +**MSVC:** The bundled **fmt** target may be built with **`/wd4834`** (workaround for a **C4834** diagnostic in fmt **12.1.0**’s `locale_ref` with the stock tarball). This is scoped to the **fmt** target, not your whole project. + +--- + +## 2. Public API (2A) + +The integration branch **preserves the v2.x public surface**: compiled library layout, **`include/spdlog/`** structure, **`async_sink`**-based async logging, and **no** v1-only headers such as `spdlog/cfg/*.h`, **`mdc.h`**, or the v1 **registry** API. + +**Not ported as v1-shaped APIs** (by design; see [`v1-triage-complete.md`](v1-triage-complete.md)): + +- **Mapped Diagnostic Context (MDC)** — v1 **MDC** commits are triaged **N/A** on this v2 tree. +- **v1 `async_logger` / `thread_pool`** — v2 uses **`async_sink`** and **`mpmc_blocking_q`**; v1 async/thread-pool–specific behavior is **N/A**. +- **`spdlog/cfg`**, **`load_env_levels`**, **registry** helpers that exist only on v1 — **N/A** where v2 uses **`set_global_logger`** / different registration model. + +If you rely on those v1 APIs, stay on **v1.x** or plan an explicit port; this branch does not reintroduce the v1 file tree. + +--- + +## 3. CMake options (high-signal) + +New or particularly relevant options on this branch (non-exhaustive; see top-level **`CMakeLists.txt`**): + +| Option | Purpose | +|--------|---------| +| **`SPDLOG_FMT_EXTERNAL`** | Use system **fmt** instead of FetchContent (**12.x**). | +| **`SPDLOG_SANITIZE_THREAD`** / **`SPDLOG_SANITIZE_ADDRESS`** | Thread / address sanitizer for **tests** (and **spdlog** library when enabled); **mutually exclusive**. CI may pass **`SPDLOG_SANITIZE_THREAD`** on Linux Clang. | +| **`SPDLOG_NO_TZ_OFFSET`** | Platforms without reliable `tm_gmtoff` / offset: **`%z`** placeholder and UTC offset helpers degrade gracefully. | +| **`SPDLOG_WCHAR_CONSOLE`** (Windows) | Optional **UTF-8 → wide** path for **`wincolor_sink`** (**`WriteConsoleW`**). | +| **`SPDLOG_MSVC_UTF8`** | **`/utf-8`** on real MSVC for **fmt** / UTF-8 literals (default **ON**). | +| **`SPDLOG_DEBUG_POSTFIX`** | Cache string for **`DEBUG_POSTFIX`** (may be empty). | + +--- + +## 4. Behavioral and portability fixes (from v1.x ports) + +These are **bug fixes / parity** items you may notice when upgrading from an older **v2.x** snapshot (see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md) and [`commits-ported.txt`](commits-ported.txt)): + +- **Timezones:** **`%z`** with **`pattern_time_type::utc`**, Windows **`utc_minutes_offset`**, POSIX **`TZ`** tests — see **`test_timezone.cpp`** / **`test_pattern_formatter.cpp`**. +- **Sinks / I/O:** **`rotating_file_sink::rotate_now`** mutex; **`basic_file_sink::truncate()`**; **`dup_filter_sink`** ctor / notification level behavior; TCP **timeouts** on **`tcp_sink`**; UDP **`const udp_sink_config&`** ctor. +- **OS:** **`getenv`** via **`std::getenv`** (MSVC / UWP guards), **`utf8_to_wstrbuf`** fixes, **`udp_client_unix`** **`reinterpret_cast`** for **`sockaddr`**. +- **Tests / CI:** **`actions/checkout@v6`**; optional **TSAN** matrix on Linux. + +No separate guarantee of **ABI** stability across pre-release SHAs of this branch (**2A** targets **source**-level v2.x API preservation). + +--- + +## 5. Upgrade checklist + +1. **Bump fmt** to **12.x** if you use **`SPDLOG_FMT_EXTERNAL`** (or drop external and use the default FetchContent pin). +2. **Re-run CMake** in a clean build directory; resolve any **`find_package(spdlog)`** / **`find_package(fmt)`** version errors. +3. **Remove** includes of v1-only headers if you were experimenting with v1 APIs. +4. **Run** your tests plus **`ctest`** for spdlog if you vendor it. +5. **Track** [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md) for the full port list and rationale. + +--- + +## 6. References + +- Full v1-only commit triage: [`v1-triage-complete.md`](v1-triage-complete.md) +- Merge / port report: [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md) +- Landed port SHAs (commentary): [`commits-ported.txt`](commits-ported.txt) diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index 9cc627d9de..4c7878a6b2 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -14,6 +14,7 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D - Docs: [`v1-triage-complete.md`](v1-triage-complete.md), [`commits-ported.txt`](commits-ported.txt) comment block, [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md) subsection **“Triage-only batch (v1 async / fmt delta vs v2)”**. Prior code work: `c3aed4b6` wchar console. - **Triage snapshot:** **42 PORTED**, **62 SUPERSEDED**, **141 N/A**, **0 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md) (**3A** complete). - **5A (fmt):** Bundled **fmt 12.1.0** via `cmake/fmtlib.cmake` (matches `origin/v1.x` `FMT_VERSION` **120100**); **`FMT_INSTALL ON`** for fmt 12 subproject + install export; MSVC **`/wd4834`** on target **`fmt`**; **`find_dependency(fmt 12)`** in `cmake/spdlogConfig.cmake.in`; README notes bundled vs external. Prior: **`9fe79692`** TSAN CMake; MDC / Feature 3379 **N/A**. +- **5.4 (migration / release notes):** [`migration-notes-v2x-v1x-integration.md`](migration-notes-v2x-v1x-integration.md) — fmt **12.x**, CMake options, intentional v1 vs v2 API gaps (**MDC**, **async_logger**, **cfg/registry**), behavioral port summary, upgrade checklist. ## Relevant Files @@ -27,6 +28,7 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D - `docs/` (if present on branch) — Additional documentation for v2.x vs v1.x. - **`cmake/fmtlib.cmake`** — FetchContent **fmt** version (**5A**; v2.x does not vendor `include/spdlog/fmt/bundled/` like v1.x). - [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md) — Merge report (extend as ports land). +- [`migration-notes-v2x-v1x-integration.md`](migration-notes-v2x-v1x-integration.md) — Migration / release notes for downstream users (**5.4**). ### Notes @@ -79,6 +81,6 @@ Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - [x] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *([`v1-triage-complete.md`](v1-triage-complete.md): **42** / **62** / **141** / **0**; **5A** fmt **12.1.0** triage updates for former fmt-bump rows.)* - [x] 5.2 Write **merge report**: areas touched, conflict resolutions, rejected or deferred ports with rationale. - [x] 5.3 Update **README** (build, fmt version, branch notes) and version header for v2.x pre-release. *(fmt **12.1.0** / external **12.x** note in Features.)* - - [ ] 5.4 Add **migration / release notes** for downstream users (API preserved per **2A**, dependency changes per **5A**). + - [x] 5.4 Add **migration / release notes** for downstream users (API preserved per **2A**, dependency changes per **5A**). *([`migration-notes-v2x-v1x-integration.md`](migration-notes-v2x-v1x-integration.md); linked from [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md).)* - [ ] 5.5 Open PR from integration branch to `v2.x` (or maintainer process); obtain **stakeholder sign-off** per PRD success metrics. - [ ] 5.6 Tag or schedule **v2.x pre-release** per **4B** milestone once CI and review are complete. From 9bcb3ecb5feabafa8fde1fe4ba934e2a62c1374b Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 11:09:04 +0200 Subject: [PATCH 29/35] docs: cross-link migration notes; refresh PRD/tasks/merge-report for completed 5A/3A Made-with: Cursor --- README.md | 2 ++ tasks/merge-report-v2x-v1x.md | 4 ++-- tasks/migration-notes-v2x-v1x-integration.md | 1 + tasks/prd-v2x-v1x-feature-parity.md | 5 +++++ tasks/tasks-v2x-v1x-feature-parity.md | 2 +- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 15a63c72af..be8f7b8423 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,8 @@ see example [CMakeLists.txt](https://github.com/gabime/spdlog/blob/v2.x/example/ * Log filtering - log levels can be modified at runtime as well as compile time. * Support for loading log levels from argv or environment var. +**v1.x → v2.x parity (branch `integration/v2-sync-v1`):** dependency and API expectations for that integration line are summarized in [`tasks/migration-notes-v2x-v1x-integration.md`](tasks/migration-notes-v2x-v1x-integration.md). + ## Usage samples #### Basic usage diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index 82d248ec58..51e111d211 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -26,8 +26,8 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a 2. **Do not** rely on a single blind merge commit; use **topical ports**: - Group `v1-commit-inventory.txt` by area (fmt, CI, sinks, OS, tests). - For each v1 commit, either cherry-pick onto `integration/v2-sync-v1` and resolve in the **v2** file set, or **manually port** the diff onto the v2-equivalent file. -3. **fmt / CMake (5A):** After substantive code ports, align **bundled fmt** and **CMake** warning policy with **current v1.x** explicitly (may be one coordinated PR). -4. **Triage:** See **`tasks/v1-triage-complete.md`** — all 245 v1-only SHAs listed with **PORTED**, **PENDING**, or **N/A** (merge commits). Remaining **PENDING** rows must be resolved to **ported**, **superseded**, or **N/A** with rationale (PRD **3A**). +3. **fmt / CMake (5A):** **Done** on this branch — bundled **fmt 12.1.0**, **`FMT_INSTALL`**, MSVC **`/wd4834`** on `fmt`, **`find_dependency(fmt 12)`** (see subsection **“5A — Bundled fmt 12.1.0”** below and [`tasks/migration-notes-v2x-v1x-integration.md`](migration-notes-v2x-v1x-integration.md)). +4. **Triage:** See **`tasks/v1-triage-complete.md`** — all 245 v1-only SHAs classified (**PORTED** / **SUPERSEDED** / **N/A**); **0** **PENDING** (PRD **3A** complete). ## Conflict resolutions diff --git a/tasks/migration-notes-v2x-v1x-integration.md b/tasks/migration-notes-v2x-v1x-integration.md index 1affc910be..19b810dfb9 100644 --- a/tasks/migration-notes-v2x-v1x-integration.md +++ b/tasks/migration-notes-v2x-v1x-integration.md @@ -74,6 +74,7 @@ No separate guarantee of **ABI** stability across pre-release SHAs of this branc ## 6. References +- Product requirements: [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md) (also links back to this file under **Related artifacts**). - Full v1-only commit triage: [`v1-triage-complete.md`](v1-triage-complete.md) - Merge / port report: [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md) - Landed port SHAs (commentary): [`commits-ported.txt`](commits-ported.txt) diff --git a/tasks/prd-v2x-v1x-feature-parity.md b/tasks/prd-v2x-v1x-feature-parity.md index 00d21eb537..b799488c36 100644 --- a/tasks/prd-v2x-v1x-feature-parity.md +++ b/tasks/prd-v2x-v1x-feature-parity.md @@ -167,6 +167,10 @@ The **v1.x** branch is the current main development line for spdlog and receives --- +## Related artifacts (integration branch) + +For the **`integration/v2-sync-v1`** workstream: full triage [`tasks/v1-triage-complete.md`](v1-triage-complete.md), merge report [`tasks/merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md), and downstream **migration / release notes** [`tasks/migration-notes-v2x-v1x-integration.md`](migration-notes-v2x-v1x-integration.md). + ## Document history | Version | Date | Notes | @@ -174,3 +178,4 @@ The **v1.x** branch is the current main development line for spdlog and receives | 1.0 | 2026-04-04 | Initial draft from brief | | 1.1 | 2026-04-04 | Recorded 2A, 3A; added guidance for 1, 4, 5 | | 1.2 | 2026-04-04 | Recorded 1D, 4B, 5A; closed open questions | +| 1.3 | 2026-04-04 | Added “Related artifacts” (triage, merge report, migration notes) | diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md index 4c7878a6b2..ea97e31bad 100644 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ b/tasks/tasks-v2x-v1x-feature-parity.md @@ -18,7 +18,7 @@ Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). D ## Relevant Files -- `CMakeLists.txt` — Top-level CMake options, bundled fmt sources, warnings, install rules; will need alignment with **5A** after merge. +- `CMakeLists.txt` — Top-level CMake options, warnings, install rules (**5A** fmt pin lives in **`cmake/fmtlib.cmake`**). - `include/spdlog/version.h` (or equivalent version header in repo) — Version macros for v2.x pre-release; confirm path under `include/`. - `include/spdlog/**/*.h` — Public API; conflict resolution favors **2A** (v2.x surface) while landing v1.x behavior fixes in implementations. - `src/**/*.cpp` — Implementation files likely touched by merge conflicts and ports. From bfa8e9a74b9fb6833956d0161b63c7eb7d0d9c63 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 11:09:57 +0200 Subject: [PATCH 30/35] revert: remove README and PRD cross-links to migration notes Made-with: Cursor --- README.md | 2 -- tasks/migration-notes-v2x-v1x-integration.md | 2 +- tasks/prd-v2x-v1x-feature-parity.md | 5 ----- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/README.md b/README.md index be8f7b8423..15a63c72af 100644 --- a/README.md +++ b/README.md @@ -57,8 +57,6 @@ see example [CMakeLists.txt](https://github.com/gabime/spdlog/blob/v2.x/example/ * Log filtering - log levels can be modified at runtime as well as compile time. * Support for loading log levels from argv or environment var. -**v1.x → v2.x parity (branch `integration/v2-sync-v1`):** dependency and API expectations for that integration line are summarized in [`tasks/migration-notes-v2x-v1x-integration.md`](tasks/migration-notes-v2x-v1x-integration.md). - ## Usage samples #### Basic usage diff --git a/tasks/migration-notes-v2x-v1x-integration.md b/tasks/migration-notes-v2x-v1x-integration.md index 19b810dfb9..cb3909941b 100644 --- a/tasks/migration-notes-v2x-v1x-integration.md +++ b/tasks/migration-notes-v2x-v1x-integration.md @@ -74,7 +74,7 @@ No separate guarantee of **ABI** stability across pre-release SHAs of this branc ## 6. References -- Product requirements: [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md) (also links back to this file under **Related artifacts**). +- Product requirements: [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md) - Full v1-only commit triage: [`v1-triage-complete.md`](v1-triage-complete.md) - Merge / port report: [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md) - Landed port SHAs (commentary): [`commits-ported.txt`](commits-ported.txt) diff --git a/tasks/prd-v2x-v1x-feature-parity.md b/tasks/prd-v2x-v1x-feature-parity.md index b799488c36..00d21eb537 100644 --- a/tasks/prd-v2x-v1x-feature-parity.md +++ b/tasks/prd-v2x-v1x-feature-parity.md @@ -167,10 +167,6 @@ The **v1.x** branch is the current main development line for spdlog and receives --- -## Related artifacts (integration branch) - -For the **`integration/v2-sync-v1`** workstream: full triage [`tasks/v1-triage-complete.md`](v1-triage-complete.md), merge report [`tasks/merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md), and downstream **migration / release notes** [`tasks/migration-notes-v2x-v1x-integration.md`](migration-notes-v2x-v1x-integration.md). - ## Document history | Version | Date | Notes | @@ -178,4 +174,3 @@ For the **`integration/v2-sync-v1`** workstream: full triage [`tasks/v1-triage-c | 1.0 | 2026-04-04 | Initial draft from brief | | 1.1 | 2026-04-04 | Recorded 2A, 3A; added guidance for 1, 4, 5 | | 1.2 | 2026-04-04 | Recorded 1D, 4B, 5A; closed open questions | -| 1.3 | 2026-04-04 | Added “Related artifacts” (triage, merge report, migration notes) | From 0a128e70d09b0be59b0635ccb0dd03d0ca5af52e Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 11:15:34 +0200 Subject: [PATCH 31/35] =?UTF-8?q?docs(merge-report):=20audit=20=E2=80=94?= =?UTF-8?q?=20add=209fe79692=20to=20ports=20table;=20fix=206004e3d1=20path?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Made-with: Cursor --- tasks/merge-report-v2x-v1x.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md index 51e111d211..fc34fe0196 100644 --- a/tasks/merge-report-v2x-v1x.md +++ b/tasks/merge-report-v2x-v1x.md @@ -42,6 +42,7 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | `0f7562a0` | POSIX `TZ` strings with explicit DST rules in `test_timezone` (avoids musl / impl-defined behavior). | `tests/test_timezone.cpp` | | `d2100d5d` | `#include ` for Unix TCP client (v1 had `tcp_client.h`; v2 uses `tcp_client_unix.h`). | `include/spdlog/details/tcp_client_unix.h` | | `3c61b051` | GitHub Actions `actions/checkout@v6` (Node deprecation). | `.github/workflows/linux.yml`, `macos.yml`, `windows.yml` | +| `9fe79692` | Thread sanitizer: `SPDLOG_SANITIZE_THREAD` option, mutual exclusion with address sanitizer, sanitizers applied to **`spdlog`** lib target (#3237). | `CMakeLists.txt` (options + `spdlog_enable_*` on `spdlog`); `tests/CMakeLists.txt` already used helpers | | `9ecdf5c8` | Optional connect timeout (non-blocking + `select`); `SO_RCVTIMEO` / `SO_SNDTIMEO` when `timeout_ms` is positive; `tcp_sink_config::timeout_ms` + ctor overload. | `tcp_client_windows.h`, `tcp_client_unix.h`, `tcp_sink.h` | | `45b67eee` | `dup_filter_sink` constructor taking `std::vector>`. | `include/spdlog/sinks/dup_filter_sink.h` | | `847db337` | `dup_filter_sink`: drop ctor `notification_level`; “Skipped …” uses level of last duplicate (`msg.log_level`). | `include/spdlog/sinks/dup_filter_sink.h`, `tests/test_dup_filter.cpp` | @@ -52,7 +53,7 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | `ae1de0dc` | *(N/A)* `load_env_levels("VAR")` — no `spdlog/cfg/` on v2. | — | | `cdbd64e2` | `qt_color_sink`: `QString::fromUtf8` length `qsizetype`; `colors_.at` index `static_cast(msg.log_level)`. | `include/spdlog/sinks/qt_sinks.h` | | `9c582574` | *(SUPERSEDED)* Apple / POSIX.1-2024 use `tm.tm_gmtoff` — v2 `os_unix.cpp` already has the `#if` guard from #3366. | — | -| `6004e3d1` | **`SPDLOG_NO_TZ_OFFSET`**: `%z` prints `+??:??`; `utc_minutes_offset` returns 0; CMake `PUBLIC` define. `test_timezone` already guarded. | `CMakeLists.txt`, `src/pattern_formatter.cpp`, `os_unix.cpp`, `os_windows.cpp`, `tests/test_pattern_formatter.cpp` | +| `6004e3d1` | **`SPDLOG_NO_TZ_OFFSET`**: `%z` prints `+??:??`; `utc_minutes_offset` returns 0; CMake `PUBLIC` define. `test_timezone` already guarded. | `CMakeLists.txt`, `src/pattern_formatter.cpp`, `src/details/os_unix.cpp`, `src/details/os_windows.cpp`, `tests/test_pattern_formatter.cpp` | | `10320184` | *(SUPERSEDED)* `#3360` padding truncate / `%D` width — v2 `pattern_formatter.cpp` already matches. | — | | `5931a3d6` | *(SUPERSEDED)* Win32 header include order (`windows_include.h` before others) — v2 `src/details/os_windows.cpp`; no `os-inl.h`. | — | | `ba508057` | *(SUPERSEDED)* `binary_example` must not use `vector(80)` with 80 pushes — v2 `example.cpp` builds buffer with `push_back` in a loop. | — | @@ -165,13 +166,14 @@ A direct `git merge origin/v1.x` into the integration branch was **attempted** a | `276ee5f5` `7f8060d5` `96a8f625` | **SUPERSEDED** | fmt **11.1** `to_string_view` / external fmt fixes — v2 `logger::log_with_format_` + no v1 `common.h` `to_string_view(fmt)` chain (`1685e694` triage). | | `3c23c27d` | **N/A** | Revert of `7f8060d5`; no separate port. | -### Triage close-out (MDC / TSAN / fmt **5A**) +### Triage close-out (MDC / fmt **5A**) + +*`9fe79692` (TSAN CMake) is listed in **Ports landed** above.* | v1.x commit(s) | Disposition | Notes | |----------------|-------------|--------| | `d03eb40c` … `c1fbafdc` | **N/A** | **MDC** stack (`mdc.h`, examples, TLS fix) — v2 tree has no MDC public API (**PRD 2A**). | | `7e022c43` | **N/A** | **Feature #3379** bundles MDC with v1-only layout; non-MDC behavior covered by other ports. | -| `9fe79692` | **PORTED** | **TSAN:** `SPDLOG_SANITIZE_THREAD` CMake option, mutual exclusion with address sanitizer, `spdlog_enable_thread_sanitizer` / `spdlog_enable_addr_sanitizer` on **`spdlog`** target (tests already used helpers). | | `0d31acae` `4418909a` `ea3e747e` `878ad2e3` `2c1eafc8` `3f03542d` | **SUPERSEDED** | **fmt 12.1.0** FetchContent + **`FMT_INSTALL ON`** (fmt 12 subproject default) + MSVC **`/wd4834`** on `fmt` — matches `origin/v1.x` bundled `FMT_VERSION` **120100** (**5A**). | **Full SHA list:** [`v1-triage-complete.md`](v1-triage-complete.md). From a7ecbd37066d4c4fd0e8e8b9d019cf6aee1c4730 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sat, 4 Apr 2026 11:47:50 +0200 Subject: [PATCH 32/35] Remove tasks --- tasks/commits-ported.txt | 117 --------- tasks/merge-base.txt | 3 - tasks/merge-report-v2x-v1x.md | 202 -------------- tasks/migration-notes-v2x-v1x-integration.md | 80 ------ tasks/prd-v2x-v1x-feature-parity.md | 176 ------------- tasks/tasks-v2x-v1x-feature-parity.md | 86 ------ tasks/triage-template.md | 31 --- tasks/v1-commit-inventory.txt | 245 ----------------- tasks/v1-triage-complete.md | 261 ------------------- 9 files changed, 1201 deletions(-) delete mode 100644 tasks/commits-ported.txt delete mode 100644 tasks/merge-base.txt delete mode 100644 tasks/merge-report-v2x-v1x.md delete mode 100644 tasks/migration-notes-v2x-v1x-integration.md delete mode 100644 tasks/prd-v2x-v1x-feature-parity.md delete mode 100644 tasks/tasks-v2x-v1x-feature-parity.md delete mode 100644 tasks/triage-template.md delete mode 100644 tasks/v1-commit-inventory.txt delete mode 100644 tasks/v1-triage-complete.md diff --git a/tasks/commits-ported.txt b/tasks/commits-ported.txt deleted file mode 100644 index d0dbdf4237..0000000000 --- a/tasks/commits-ported.txt +++ /dev/null @@ -1,117 +0,0 @@ -# v1.x commits ported to integration/v2-sync-v1 (manual / cherry-pick) -# One line per landed port: - -09a674b7 Fix %z when pattern_type_type is utc - should be +00:00 -b656d1ce Windows utc_minutes_offset(): DST accuracy + tests (pattern_formatter, test_timezone) -0f7562a0 tests: timezone: explicit POSIX TZ DST rules (musl / POSIX 2024) -d2100d5d Include fcntl.h in Unix tcp client header (v2: tcp_client_unix.h) -5A: cmake/fmtlib.cmake fmt 12.1.0 + FMT_INSTALL + MSVC /wd4834 on fmt; spdlogConfig find_dependency(fmt 12) — 0d31acae 4418909a ea3e747e 878ad2e3 2c1eafc8 3f03542d -9fe79692 TSAN: SPDLOG_SANITIZE_THREAD option, mutual exclusion, sanitizer on spdlog lib (#3237) -3c61b051 [ci] actions/checkout@v6 (linux, macos, windows) -9ecdf5c8 TCP connect/send/recv timeouts (tcp_client_*, tcp_sink) -45b67eee dup_filter_sink: constructor taking vector of sinks (#3549) -566b2d14 Case-insensitive level_from_str (src/common.cpp; tests) -dd3ca04a CMAKE_BUILD_TYPE default only for top-level project (CMakeLists.txt) -32dd298d mpmc_blocking_q.h file-header comment (enqueue_nowait overrun behavior) -0209b12c tests/includes.h: undef SPDLOG_LEVEL_NAMES / SHORT for default test expectations (#3492) -4397dac5 c49c7cf9 SPDLOG_DEBUG_POSTFIX cache + quoted DEBUG_POSTFIX (#3433 #3530) -ae525b75 circular_q.h include spdlog/common.h (#3026) -33375433 null_atomic T value{} value-initialize (#3513) -6b240a89 udp_client_unix sendto reinterpret_cast sockaddr (#3509) -88a0e07a ansicolor_sink: target_file_ protected for custom sinks (#3486) -7a950e02 d343d413 ebfa9069 9edab1b5 SPDLOG_MSVC_UTF8 + /utf-8 only for MSVC (CXX_COMPILER_ID) (#3260) -f1d748e5 os_windows: drop fileapi.h include (#3444; v2 uses os_windows.cpp not os-inl.h) -7cbf2a69 ansicolor: set_color_mode_ without nested mutex (matches #3323; fixes double-lock) -ad725d34 os::getenv via std::getenv (MSVC 4996); 677a2d93 test_stopwatch 500ms waits -3f7e5028 utf8_to_wstrbuf assert: result_size vs static_cast(target.size()) (#3479) -a6215527 ringbuffer_sink: throw if n_items==0; test_ringbuffer_sink (#3436) -847db337 dup_filter_sink: skipped-msg notification level from last duplicate (#3390) -8806ca65 os_windows getenv: UWP via WINAPI_FAMILY vs WINAPI_FAMILY_DESKTOP_APP (#3489) -cdbd64e2 qt_sinks: qsizetype for fromUtf8 lengths; colors_.at size_t (#3487) -6004e3d1 SPDLOG_NO_TZ_OFFSET CMake + %z placeholder + utc_minutes_offset stubs (#3483) -1774e700 309204d5 f2a9dec0 472945ba MSVC/clang hygiene: dup_filter filter_ const; should_flush/flush_level(); daily new_filename; should_log param; example my_type (#3515–#3519 #3521) -687226d9 udp_sink: const udp_sink_config& ctor (#3520); dist_sink already std::move(sinks) -1245bf8e README.md user-defined type: fmt::format_to (#3259); example already used fmt:: -24dde318 rotating_file_sink::rotate_now: lock mutex (#3281) -65e388e8 basic_file_sink::truncate() + test (#3280) -ad0f31c0 test_sink + callback_sink tests: iterator_traits cast for end()-eol (#3315) -c3aed4b6 SPDLOG_WCHAR_CONSOLE / WriteConsoleW + utf8_to_wstrbuf path in wincolor_sink (#3092) -# SUPERSEDED (no code change): d5af52d9 format_string propagation — v2 API already correct -# SUPERSEDED: 6c5d6329 should_log comment — v2 logger.h already correct -# SUPERSEDED: 2aa8b6c9 file_helper write fd_ — v2 file_helper.cpp already has guard -# SUPERSEDED: 2d5179ba syslog_prio_from_level protected — v2 syslog_sink.h already -# SUPERSEDED: 8b331e2c systemd TID — v2 systemd_sink.h uses msg.thread_id -# SUPERSEDED: 479a5ac3 Apple pthread_threadid_np / iOS — v2 os_unix.cpp already -# SUPERSEDED: f24f7fa2 base_sink mutex include — v2 base_sink.cpp -# SUPERSEDED: 2169a6f6 lock_guard in mpmc_blocking_q — v2 already -# SUPERSEDED: 271f0f3b daily/hourly max_files docs — v2 already (deduped daily comment line) -# SUPERSEDED: 8979f7fb Windows path_exists UTF-8 — v2 std::filesystem::exists -# SUPERSEDED: a3a0c9d6 suggest-override — v2 base_sink.h final override -# SUPERSEDED: 5ebfc927 MSVC flags clang-cl — v2 CMAKE_CXX_COMPILER_ID STREQUAL MSVC -# SUPERSEDED: 94a8e87c create_dir drive letter #3079 — v2 filesystem::create_directories -# N/A: 7cb90d1a MSVC no-exceptions flag — no SPDLOG_NO_EXCEPTIONS in v2 CMake yet -# SUPERSEDED: d387fdf9 MINGW CMAKE_CXX_EXTENSIONS — already in CMakeLists.txt -# N/A: 4052bc06 819eb27c 23587b0d registry-inl get() — v2 has no multi-logger registry -# N/A: 134f9194 registry formatting — no registry headers on v2 -# N/A: 3403f278 set_default_logger registry — v2 global logger API differs -# N/A: b6eeb736 e5865186 logger-register callbacks + revert — no lasting v1 delta -# N/A: ddce4215 fmt tweakme include — v2 no tweakme.h -# N/A: 5532231b 37b84769 registry string_view accessor + revert — no registry on v2 -# N/A: 3b4c775b set_default_logger comment — registry -# N/A: c9ce17ab INSTALL.md — not in v2 tree -# N/A: 2969dde4 revert fmt 10.2.1 bump — pair with d8e0ad46 / 5A -# SUPERSEDED: 6766f873 clang-tidy AnalyzeTemporaryDtors — not in v2 .clang-tidy -# N/A batch: clang-format / mass reformat SHAs (9e36a158 … b3688ba1, 22b0f4fc, 1bea38ed) -# N/A: logo / jetbrains assets (c5452e05, 595a5247, ff205fd2, 5d89b5b9) -# N/A: v1.x version bumps (7c02e204, 238c9ffa, 2122eb21, 8e561337, ac432c36, 48bcf39a, 486b5555, 6fa36017, 79524ddd) -# N/A: 508d20f0 blame-ignore-revs; 0c4fb032 SPDLOG_CONSTEXPR_FUNC; f4afd81c trivial common.h -# N/A: d3730937 a5cfbf36 FMT_UNICODE cmake + revert -# SUPERSEDED: 15f53968 null_sink final -# SUPERSEDED: 51a0deca daily_file_sink duplicate doc line — already fixed on integration branch -# SUPERSEDED: 66ac83e7 a34e08c7 .gitignore .vs out/build CMakeSettings — already in .gitignore -# SUPERSEDED: 2c76e610 Sep vs Sept — src/pattern_formatter.cpp already uses "Sep" -# SUPERSEDED: e593f669 -Wextra-semi — v2 sources already avoid extra `;` after `}` / `override {}` -# SUPERSEDED: a45c9390 stopwatch elapsed_ms — already in stopwatch.h -# SUPERSEDED: eeb22c13 syslog virtual prio — already in syslog_sink.h -# SUPERSEDED: 5673e9e5 fe4f9952 utf8_to_wstrbuf + tests — os_windows + test_misc -# SUPERSEDED: 287333ee color sinks final — v2 ansicolor/wincolor headers differ from v1 -# N/A batch: README / wiki / docs-only SHAs; v1 ci.yml & win CI churn; CMake comment-only; LICENSE optional -# N/A: 943fcbd7 registry; 27cb4c76 MDC readme; 3edc8036 catch test order; Coverity CI; 7cee026b v1 TSAN CI line -# N/A: ae1de0dc cfg load_env_levels var name — no spdlog/cfg on v2 -# N/A: 548b2642 MSVC C4530 / no-exceptions — no SPDLOG_NO_EXCEPTIONS in v2 CMake -# SUPERSEDED: e3f5a4fe FMT_LIB_EXPORT on spdlog — v2 uses fmt::fmt target -# SUPERSEDED: e655dbb6 fmt.h drop base.h — v2 uses common.h → fmt/base.h (no fmt.h) -# SUPERSEDED: 9c582574 Apple/POSIX tm_gmtoff — os_unix.cpp utc_minutes_offset guard matches #3366 -# SUPERSEDED: 10320184 pattern_formatter ScopedPadder / %D — already in pattern_formatter.cpp (#3360) -# SUPERSEDED: 5931a3d6 Windows include order — v2 os_windows.cpp (no os-inl.h) -# SUPERSEDED: ba508057 example binary_example vector — v2 uses push_back loop (#2963) -# SUPERSEDED: 47b7e7c7 codespell typos — qt_sinks / test_file_helper already fixed (#3011) -# SUPERSEDED: 1ef8d3ce LICENSE fmt third-party URL (#2967) -# SUPERSEDED: 8cfd4a7e bench latency __linux__ macro -# N/A: d299603e #3514 — registry + MDC hunk; v2 layout (dup_filter in 1774e700) -# N/A: 57505989 tweakme SPDLOG_LEVEL_NAMES string_view_literals — no tweakme on v2 (#3291) -# SUPERSEDED: fc7e9c87 common-inl.h — no common-inl.h; common.cpp has cctype -# SUPERSEDED: 1685e694 fmt::format_string copy — v2 log_with_format_ + vformat_to (#3541) -# SUPERSEDED: 2670f47d z_formatter warning — pattern_formatter.cpp structure matches -# SUPERSEDED: d276069a fmt 11 formatter const — example.cpp already const -# SUPERSEDED: 951c5b99 rotate_now — rotating_file_sink.cpp + test rotating_file_logger4 -# SUPERSEDED: a2b42620 cmake_minimum 3.10..3.21 — v2 requires 3.23 (#3029) -# SUPERSEDED: f355b3d5 test_daily custom calculator — test_daily_and_rotation_loggers.cpp uses fmt::format -# SUPERSEDED: b7e0e2c2 #3073 source_loc::empty — v2 source_loc.h (unsigned line + null checks) -# SUPERSEDED: 71925ca3 FMT_DEPRECATED_* in fmt.h — v2 fmt via common.h / no v1 fmt.h shim -# SUPERSEDED: fa6605dc test_create_dir comment — already fixed -# SUPERSEDED: 885b5473 FMT_ENFORCE_COMPILE_STRING — rotating calc_filename uses ostringstream (#3137) -# SUPERSEDED: 96c9a62b clone async race — test_misc uses test_sink_mt -# SUPERSEDED: 1e6250e1 d7155530 fwrite_bytes + CMake SPDLOG_FWRITE_UNLOCKED -# SUPERSEDED: c1569a3d Catch2 v3.5.0 — tests/CMakeLists.txt GIT_TAG -# SUPERSEDED: 73e2e02b #3038 wstr_to_utf8buf — os_windows.cpp /4 and *4 -# N/A: b6da5944 async_msg flush_callback move-assign — no v1 async_msg on v2 (#3232) -# Triage batch (no code): fe79bfcc 6725584e ec661f98 a19c76a4 62302019 — v1 async_logger/thread_pool; v2 async_sink -# N/A: d8e0ad46 1e7d7e07 fmt 10.2.1 bumps — superseded by bundled fmt (5A) -# N/A: 16e0d2e7 63d18842 — v1 thread_pool flush promise/callback path -# SUPERSEDED: faa0a7a9 85bdab0c — fmt 11.1.4 / 11.0.2 vs cmake fmtlib.cmake -# SUPERSEDED: 276ee5f5 7f8060d5 96a8f625 — fmt 11.1 to_string_view / external; v2 common.h + vformat_to -# N/A: 3c23c27d revert #3312 — pairs with 7f8060d5 -# N/A (MDC): d03eb40c f030afe6 1f930174 4517ce8b cba66029 1253a57d 8fed530b 3b4fd93b 2d4acf8c 362214a3 c1fbafdc — no mdc.h on v2 -# N/A: 7e022c43 Feature 3379 — v1 MDC + mixed tree; non-MDC slices elsewhere -# SUPERSEDED (5A fmt 12.1.0): 0d31acae 4418909a ea3e747e 878ad2e3 2c1eafc8 3f03542d — see cmake/fmtlib.cmake diff --git a/tasks/merge-base.txt b/tasks/merge-base.txt deleted file mode 100644 index bb754820c6..0000000000 --- a/tasks/merge-base.txt +++ /dev/null @@ -1,3 +0,0 @@ -merge-base origin/v1.x origin/v2.x: b9cb721b9276cc93bf43910e65b1c047b3d707b5 -commits on v1.x not in v2.x: 245 -commits on v2.x not in v1.x: 464 diff --git a/tasks/merge-report-v2x-v1x.md b/tasks/merge-report-v2x-v1x.md deleted file mode 100644 index fc34fe0196..0000000000 --- a/tasks/merge-report-v2x-v1x.md +++ /dev/null @@ -1,202 +0,0 @@ -# Merge report: v2.x ↔ v1.x integration (draft) - -**Branch:** `integration/v2-sync-v1` (from `origin/v2.x`) -**PRD:** `tasks/prd-v2x-v1x-feature-parity.md` -**Date:** 2026-04-04 - -## Summary - -A direct `git merge origin/v1.x` into the integration branch was **attempted** and **aborted** due to **extensive conflicts**, including many **modify/delete** cases: files **removed or reorganized on v2.x** were **modified on v1.x** after the merge-base. A one-shot textual merge is not automatable without a **file-by-file strategy** aligned with v2.x’s layout (PRD **2A**: preserve v2 public API and structure). - -## Merge-base - -- **SHA:** `b9cb721b9276cc93bf43910e65b1c047b3d707b5` -- **Commits on v1.x not in v2.x:** 245 (`git rev-list --count origin/v2.x..origin/v1.x`) -- **Commits on v2.x not in v1.x:** 464 (`git rev-list --count origin/v1.x..origin/v2.x`) - -## Merge attempt (2.1) - -- **Command:** `git merge origin/v1.x -m "Merge branch 'v1.x' into integration/v2-sync-v1 (v1.x feature parity)"` -- **Result:** Automatic merge failed; conflicts across CMake, workflows, README, benches, and a large fraction of `include/spdlog/**` and `tests/**`. -- **Notable pattern:** `CONFLICT (modify/delete)` — v2 **deleted** paths (e.g. split headers, removed `*-inl.h`, relocated or dropped translation units) while v1.x **continued to patch** those paths. Resolving by “taking v1” would **reintroduce v1 file tree** and violate v2 architecture; resolving by “taking v2” drops v1 fixes until **re-applied** against v2 files. - -## Recommended next steps (hybrid 1D) - -1. **Keep** `integration/v2-sync-v1` tracking v2.x (this branch is pushed to `origin`). -2. **Do not** rely on a single blind merge commit; use **topical ports**: - - Group `v1-commit-inventory.txt` by area (fmt, CI, sinks, OS, tests). - - For each v1 commit, either cherry-pick onto `integration/v2-sync-v1` and resolve in the **v2** file set, or **manually port** the diff onto the v2-equivalent file. -3. **fmt / CMake (5A):** **Done** on this branch — bundled **fmt 12.1.0**, **`FMT_INSTALL`**, MSVC **`/wd4834`** on `fmt`, **`find_dependency(fmt 12)`** (see subsection **“5A — Bundled fmt 12.1.0”** below and [`tasks/migration-notes-v2x-v1x-integration.md`](migration-notes-v2x-v1x-integration.md)). -4. **Triage:** See **`tasks/v1-triage-complete.md`** — all 245 v1-only SHAs classified (**PORTED** / **SUPERSEDED** / **N/A**); **0** **PENDING** (PRD **3A** complete). - -## Conflict resolutions - -*(None from a merge commit — merge was aborted.)* - -## Ports landed (manual / topical) - -| v1.x commit | Summary | v2.x location | -|-------------|---------|---------------| -| `09a674b7` | `%z` with `pattern_time_type::utc` must print `+00:00` (not local offset). | `src/pattern_formatter.cpp` — `z_formatter` takes `pattern_time_type`; early return for UTC. | -| `b656d1ce` | Windows `utc_minutes_offset()` via `mktime` / `_mkgmtime`; pattern tests + dedicated timezone tests. | `src/details/os_windows.cpp`; `tests/test_pattern_formatter.cpp`; `tests/test_timezone.cpp` (new); `tests/CMakeLists.txt`; `include/spdlog/details/os.h` (doc comment). | -| `0f7562a0` | POSIX `TZ` strings with explicit DST rules in `test_timezone` (avoids musl / impl-defined behavior). | `tests/test_timezone.cpp` | -| `d2100d5d` | `#include ` for Unix TCP client (v1 had `tcp_client.h`; v2 uses `tcp_client_unix.h`). | `include/spdlog/details/tcp_client_unix.h` | -| `3c61b051` | GitHub Actions `actions/checkout@v6` (Node deprecation). | `.github/workflows/linux.yml`, `macos.yml`, `windows.yml` | -| `9fe79692` | Thread sanitizer: `SPDLOG_SANITIZE_THREAD` option, mutual exclusion with address sanitizer, sanitizers applied to **`spdlog`** lib target (#3237). | `CMakeLists.txt` (options + `spdlog_enable_*` on `spdlog`); `tests/CMakeLists.txt` already used helpers | -| `9ecdf5c8` | Optional connect timeout (non-blocking + `select`); `SO_RCVTIMEO` / `SO_SNDTIMEO` when `timeout_ms` is positive; `tcp_sink_config::timeout_ms` + ctor overload. | `tcp_client_windows.h`, `tcp_client_unix.h`, `tcp_sink.h` | -| `45b67eee` | `dup_filter_sink` constructor taking `std::vector>`. | `include/spdlog/sinks/dup_filter_sink.h` | -| `847db337` | `dup_filter_sink`: drop ctor `notification_level`; “Skipped …” uses level of last duplicate (`msg.log_level`). | `include/spdlog/sinks/dup_filter_sink.h`, `tests/test_dup_filter.cpp` | -| `8806ca65` | UWP / non-desktop: `getenv` unsupported — detect via `WINAPI_FAMILY` vs `WINAPI_FAMILY_DESKTOP_APP` (not `__cplusplus_winrt` alone). | `src/details/os_windows.cpp` | -| `e3f5a4fe` | *(SUPERSEDED)* `FMT_LIB_EXPORT` on spdlog when shared — v2 links `fmt::fmt`; fmt CMake owns exports. | — | -| `e655dbb6` | *(SUPERSEDED)* `#3408` trim `fmt.h` includes — v2 has no `spdlog/fmt/fmt.h`; `common.h` includes `fmt/base.h`. | — | -| `548b2642` | *(N/A)* MSVC C4530 / `_HAS_EXCEPTIONS` with no-exceptions — v2 has no `SPDLOG_NO_EXCEPTIONS` option in CMake. | — | -| `ae1de0dc` | *(N/A)* `load_env_levels("VAR")` — no `spdlog/cfg/` on v2. | — | -| `cdbd64e2` | `qt_color_sink`: `QString::fromUtf8` length `qsizetype`; `colors_.at` index `static_cast(msg.log_level)`. | `include/spdlog/sinks/qt_sinks.h` | -| `9c582574` | *(SUPERSEDED)* Apple / POSIX.1-2024 use `tm.tm_gmtoff` — v2 `os_unix.cpp` already has the `#if` guard from #3366. | — | -| `6004e3d1` | **`SPDLOG_NO_TZ_OFFSET`**: `%z` prints `+??:??`; `utc_minutes_offset` returns 0; CMake `PUBLIC` define. `test_timezone` already guarded. | `CMakeLists.txt`, `src/pattern_formatter.cpp`, `src/details/os_unix.cpp`, `src/details/os_windows.cpp`, `tests/test_pattern_formatter.cpp` | -| `10320184` | *(SUPERSEDED)* `#3360` padding truncate / `%D` width — v2 `pattern_formatter.cpp` already matches. | — | -| `5931a3d6` | *(SUPERSEDED)* Win32 header include order (`windows_include.h` before others) — v2 `src/details/os_windows.cpp`; no `os-inl.h`. | — | -| `ba508057` | *(SUPERSEDED)* `binary_example` must not use `vector(80)` with 80 pushes — v2 `example.cpp` builds buffer with `push_back` in a loop. | — | -| `47b7e7c7` | *(SUPERSEDED)* codespell comment fixes (`qt_sinks.h`, `test_file_helper.cpp`) — already on branch; v2 `test_errors.cpp` differs from v1. | — | -| `1ef8d3ce` | *(SUPERSEDED)* fmt third-party license URL in `LICENSE` — already points at raw `fmt` `LICENSE`. | — | -| `8cfd4a7e` | *(SUPERSEDED)* `bench/latency.cpp` `__linux__` — already correct. | — | -| `57505989` | *(N/A)* `tweakme.h` comment for `SPDLOG_LEVEL_NAMES` + `string_view_literals` — v2 has no tweakme; level strings live in `common.h`. | — | -| `d299603e` | *(N/A)* #3514 registry + MDC `const` tweaks — no v1 `registry-inl` / MDC block in v2 `pattern_formatter`; see `1774e700` for `dup_filter_sink`. | — | -| `1774e700` | `dup_filter_sink::filter_` **const** + `const` filter duration; `pattern_formatter::get_time_` was already **const** on v2. | `include/spdlog/sinks/dup_filter_sink.h` | -| `309204d5` | `logger::should_flush` uses **`flush_level()`**; `daily_file_sink` locals **`new_filename`** (avoid shadowing `filename()`). | `include/spdlog/logger.h`, `include/spdlog/sinks/daily_file_sink.h` | -| `f2a9dec0` | `spdlog::should_log(level log_level)` parameter rename (#3519); v1 cfg/async renames not ported (no `spdlog/cfg` on v2). | `include/spdlog/spdlog.h`, `src/spdlog.cpp` | -| `472945ba` | Example `my_type`: `value_` / ctor param vs member shadow (#3521). | `example/example.cpp` | -| `687226d9` | `udp_sink` ctor takes **`const udp_sink_config &`** (#3520). `dist_sink` already used **`std::move(sinks)`**. | `include/spdlog/sinks/udp_sink.h` | -| `fc7e9c87` | *(SUPERSEDED)* `common-inl.h` add `` — v2 has no `common-inl.h`; `level_from_str` lives in `src/common.cpp` with ``. | — | -| `1685e694` | *(SUPERSEDED)* Avoid deprecated `fmt::format_string` copy — v2 `logger::log_with_format_` holds `const format_string_t &` and calls `fmt::vformat_to` (no v1 `to_string_view(fmt)` indirection). | — | -| `1245bf8e` | User-defined type docs: **`fmt::format_to`** in `README.md` snippet (#3259). `example.cpp` already used `fmt::format_to`. | `README.md` | -| `2670f47d` | *(SUPERSEDED)* `z_formatter` / `-W` ordering with `SPDLOG_NO_TZ_OFFSET` — `src/pattern_formatter.cpp` already matches the v1 layout. | — | -| `d276069a` | *(SUPERSEDED)* `fmt::formatter::format` **const** for fmt 11 — `example/example.cpp` already `const`. | — | -| `951c5b99` | *(SUPERSEDED)* `rotating_file_sink::rotate_now` + test — `src/sinks/rotating_file_sink.cpp`, `tests/test_file_logging.cpp` `rotating_file_logger4`. | — | -| `24dde318` | `rotating_file_sink::rotate_now` takes **`std::lock_guard`** before `rotate_()` (#3281). | `src/sinks/rotating_file_sink.cpp` | -| `a2b42620` | *(SUPERSEDED)* `cmake_minimum_required` range for FetchContent — v2 requires **CMake 3.23**. | — | -| `f355b3d5` | *(SUPERSEDED)* daily logger test uses `fmt::format` for custom calculator — `tests/test_daily_and_rotation_loggers.cpp` already matches. | — | -| `65e388e8` | `basic_file_sink::truncate()` — lock + `file_helper_.reopen(true)` (#3280). | `include/spdlog/sinks/basic_file_sink.h`, `src/sinks/basic_file_sink.cpp`, `tests/test_file_logging.cpp` | -| `b7e0e2c2` | *(SUPERSEDED)* `#3073` `source_loc::empty` — v2 uses `uint_least32_t` line and null checks (`source_loc.h`). | — | -| `71925ca3` | *(SUPERSEDED)* drop `FMT_DEPRECATED_*` from bundled fmt shim — v2 has no v1 `spdlog/fmt/fmt.h` block. | — | -| `fa6605dc` | *(SUPERSEDED)* `test_create_dir` comment typo — already fixed. | — | -| `885b5473` | *(SUPERSEDED)* `FMT_ENFORCE_COMPILE_STRING` + rotating `calc_filename` — v2 builds filename via `ostringstream` (`rotating_file_sink.cpp`). | — | -| `96c9a62b` | *(SUPERSEDED)* async clone test race — `test_misc.cpp` uses `test_sink_mt`. | — | -| `1e6250e1` | *(SUPERSEDED)* `fwrite_bytes` / non-locking fwrite — `os_unix.cpp`, `os_windows.cpp`, `file_helper`, CMake. | — | -| `d7155530` | *(SUPERSEDED)* `SPDLOG_FWRITE_UNLOCKED` from symbol check — same CMake path as above. | — | -| `c1569a3d` | *(SUPERSEDED)* Catch2 **v3.5.0** — `tests/CMakeLists.txt` `FetchContent` `GIT_TAG`. | — | -| `73e2e02b` | *(SUPERSEDED)* `#3038` / `#3044` UTF-16→UTF-8 size checks — `wstr_to_utf8buf` in `os_windows.cpp`. | — | -| `ad0f31c0` | `test_sink` / callback tests: **`iterator_traits::difference_type`** cast for `end() - eol_len` (#3315). | `tests/test_sink.h`, `tests/test_custom_callbacks.cpp` | -| `c3aed4b6` | Optional **UTF-8 → wide** console output: `SPDLOG_WCHAR_CONSOLE` / `SPDLOG_UTF8_TO_WCHAR_CONSOLE`; `print_range_` uses `utf8_to_wstrbuf` + `WriteConsoleW` (#3092). | `CMakeLists.txt`, `src/sinks/wincolor_sink.cpp` | -| `b6da5944` | *(N/A)* `async_msg` move-assign flush callback — v2 has no v1 `async_msg` / `flush_callback` shape (#3232). | — | -| `566b2d14` | Case-insensitive `level_from_str` (env / argv level names). | `src/common.cpp`; `tests/test_misc.cpp` | -| `dd3ca04a` | Set default `CMAKE_BUILD_TYPE` only when spdlog is the top-level CMake project. | `CMakeLists.txt` | -| `d5af52d9` | *(SUPERSEDED)* format_string propagation — v2.x already uses unified `format_string_t` forwarding to `log_with_format_`. | — | -| `32dd298d` | Misleading `enqueue_nowait` comment in blocking queue header. | `include/spdlog/details/mpmc_blocking_q.h` (file-level header; method comments already matched behavior). | -| `6c5d6329` | *(SUPERSEDED)* `should_log` doc comment — v2.x already says “if logging is enabled”. | — | -| `2aa8b6c9` | *(SUPERSEDED)* `file_helper::write` null `fd_` — already guarded in v2 `file_helper.cpp`. | — | -| `0209b12c` | Tests immune to custom `SPDLOG_LEVEL_NAMES` / `SPDLOG_SHORT_LEVEL_NAMES` in tweakme.h. | `tests/includes.h` | -| `33375433` | Value-initialize `null_atomic::value` (was `null_atomic_int` on v1). | `include/spdlog/details/null_mutex.h` | -| `6b240a89` | `sendto` / `reinterpret_cast` in UDP client. | `include/spdlog/details/udp_client_unix.h` | -| `88a0e07a` | `ansicolor_sink::target_file_` **protected** for subclasses (e.g. stdout/stderr split). | `include/spdlog/sinks/ansicolor_sink.h` | -| `7a950e02` `d343d413` `ebfa9069` `9edab1b5` | MSVC `/utf-8`: cache option **`SPDLOG_MSVC_UTF8`** (default ON) and apply only when `$`. | `CMakeLists.txt` | -| `2c76e610` | *(SUPERSEDED)* abbreviated September **Sep** not **Sept** — v2 `pattern_formatter.cpp` already uses `"Sep"`. | — | -| `f1d748e5` | Drop redundant `#include ` when `windows.h` already provides APIs (older SDK compatibility). | `src/details/os_windows.cpp` (v1 had `os-inl.h`) | -| `7cbf2a69` | `ansicolor_sink`: public `set_color_mode` locks; internal `set_color_mode_` must not re-lock (v1 #3323). | `src/sinks/ansicolor_sink.cpp` — removed nested `lock_guard` in `set_color_mode_` (avoids deadlock). | -| `e593f669` | *(SUPERSEDED)* `-Wextra-semi` / stray `;` after `}` — v2 `bench`, `example`, `callback_sink`, `msvc_sink` already clean. | — | -| `ad725d34` | `std::getenv` in `spdlog::details::os::getenv` (MSVC: suppress C4996; UWP: empty). | `src/details/os_windows.cpp`, `src/details/os_unix.cpp` | -| `677a2d93` | Less flaky stopwatch tests (longer sleep). | `tests/test_stopwatch.cpp` | -| `a45c9390` | *(SUPERSEDED)* `stopwatch::elapsed_ms()` — already on v2. | — | -| `eeb22c13` | *(SUPERSEDED)* `syslog_sink` virtual `syslog_prio_from_level` — already on v2. | — | -| `5673e9e5` `fe4f9952` | *(SUPERSEDED)* UTF-8 → UTF-16 conversion behavior + tests — v2 `os_windows.cpp` / `test_misc.cpp`. | — | -| `3f7e5028` | `assert` sign-compare in `utf8_to_wstrbuf` (`int` vs `size_t`). | `src/details/os_windows.cpp` | -| `a6215527` | `ringbuffer_sink(0)` throws; test expects `spdlog_ex` (v2 uses `drain` API, not v1 `last_formatted`). | `include/spdlog/sinks/ringbuffer_sink.h`, `tests/test_ringbuffer_sink.cpp` | -| `287333ee` | *(SUPERSEDED)* drop `final` from color sinks — v2 headers differ from v1 patch context. | — | -| `4397dac5` | `SPDLOG_DEBUG_POSTFIX` CMake cache (override debug library name suffix). | `CMakeLists.txt` — default `-${MAJOR}.${MINOR}d` (same as previous v2 hardcode). | -| `c49c7cf9` | Allow **empty** debug postfix (quoted property). | Same `CMakeLists.txt` change as `4397dac5`. | -| `ae525b75` | Self-contained `circular_q.h` (include `common.h`). | `include/spdlog/details/circular_q.h` | -| `2d5179ba` | *(SUPERSEDED)* `syslog_prio_from_level` visibility — v2 already `protected`/`virtual`. | — | -| `8b331e2c` | *(SUPERSEDED)* systemd `TID` — v2 uses `msg.thread_id`. | — | -| `479a5ac3` | *(SUPERSEDED)* Apple `pthread_threadid_np` availability — v2 `os_unix.cpp` already has the guarded block. | — | -| `f24f7fa2` | *(SUPERSEDED)* `#include ` for `base_sink` — v2 `src/sinks/base_sink.cpp` already includes it. | — | -| `2169a6f6` | *(SUPERSEDED)* `lock_guard` vs `unique_lock` in `mpmc_blocking_q` — v2 already uses `lock_guard` where applicable. | — | -| `271f0f3b` | *(SUPERSEDED)* daily/hourly `max_files` doc note — v2 headers already document; duplicate line removed in `daily_file_sink.h`. | — | -| `8979f7fb` | *(SUPERSEDED)* Windows `path_exists` / UTF-8 — v2 uses `std::filesystem::exists` in `os_filesystem.cpp`. | — | -| `a3a0c9d6` | *(SUPERSEDED)* `-Wsuggest-override` — v2 `base_sink.h` uses `final override`. | — | -| `5ebfc927` | *(SUPERSEDED)* `/Zc:__cplusplus` / `/MP` only for real MSVC — v2 already gates on `CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"`. | — | -| `94a8e87c` | *(SUPERSEDED)* `#3079` `create_dir` on drive-letter paths — v2 uses `std::filesystem::create_directories`. | — | -| `7cb90d1a` | *(N/A)* MSVC flags when `SPDLOG_NO_EXCEPTIONS` — v2 CMake has no such option yet. | — | -| `d387fdf9` | *(SUPERSEDED)* MINGW + `CMAKE_CXX_EXTENSIONS` — already enabled for `MINGW` in `CMakeLists.txt`. | — | -| `4052bc06` `819eb27c` `23587b0d` | *(N/A)* `registry::get` / `registry-inl.h` — v2.x uses a global logger API; no v1-style registry. | — | -| `134f9194` | *(N/A)* registry formatting — no `registry.h` on v2. | — | -| `3403f278` | *(N/A)* `set_default_logger` registry behavior — v2 `set_global_logger` / PRD **2A** surface. | — | -| `b6eeb736` `e5865186` | *(N/A)* Logger-registration callbacks + immediate revert — no persistent v1 behavior. | — | -| `ddce4215` | *(N/A)* `tweakme.h` in fmt headers — v2 has no `tweakme.h`. | — | -| `5532231b` `37b84769` | *(N/A)* Registry `string_view` accessors / revert — no v1-style registry on v2. | — | -| `3b4c775b` | *(N/A)* Comment on `set_default_logger` — registry-only. | — | -| `c9ce17ab` | *(N/A)* `INSTALL.md` — file not present on v2. | — | -| `2969dde4` | *(N/A)* Revert fmt bump — handled with `d8e0ad46` under **5A** / fmt alignment. | — | -| `6766f873` | *(SUPERSEDED)* Drop `AnalyzeTemporaryDtors` from `.clang-tidy` — v2 config never had it. | — | -| *(batch)* | *(N/A)* **Clang-format / mass reformat** (e.g. `9e36a158` … `b3688ba1`, `22b0f4fc`, `1bea38ed`) — style-only; no per-commit functional port. | — | -| *(batch)* | *(N/A)* **Logo / sponsor image** commits — v2 assets differ. | — | -| *(batch)* | *(N/A)* **v1.x version bumps** (`7c02e204`, `238c9ffa`, `2122eb21`, `8e561337`, `ac432c36`, `48bcf39a`, `486b5555`, `6fa36017`, `79524ddd`) — v2 versioning is separate. | — | -| `508d20f0` | *(N/A)* `.git-blame-ignore-revs` — optional. | — | -| `0c4fb032` | *(N/A)* `SPDLOG_CONSTEXPR_FUNC` / `FMT_CONSTEXPR` — v2 macro model differs (**5A**). | — | -| `f4afd81c` | *(N/A)* trivial v1 `common.h` edit. | — | -| `d3730937` `a5cfbf36` | *(N/A)* `FMT_UNICODE` CMake + revert — triage under **5A**. | — | -| `15f53968` | *(SUPERSEDED)* `null_sink` `final` — already `final` in v2. | — | -| `51a0deca` | *(SUPERSEDED)* duplicate `daily_file_sink` comment line — already addressed on integration branch. | — | -| `66ac83e7` `a34e08c7` | *(SUPERSEDED)* `.gitignore` entries — v2 `.gitignore` already ignores `/.vs`, `/out/build`, `/CMakeSettings.json`. | — | -| *(batch)* | *(N/A)* **README / wiki / doc-link** updates — v2 docs maintained separately. | — | -| *(batch)* | *(N/A)* **Legacy v1 CI** (`ci.yml`, Windows CI WIP, Coverity) — v2 uses `.github/workflows`. | — | -| *(batch)* | *(N/A)* **CMake comment-only** / trivial one-line CMake / formatted `CMakeLists` — no behavior port. | — | -| `943fcbd7` | *(N/A)* “Register replace logger” — registry API. | — | -| `27cb4c76` | *(N/A)* MDC readme example — v2 has no MDC stack yet. | — | -| `3edc8036` | *(N/A)* Catch2 test declaration order — optional. | — | -| `c5061bb9` | *(N/A)* `LICENSE` text update — reconcile at release if needed. | — | - -### Triage-only batch (v1 async / fmt delta vs v2) - -| v1.x commit | Disposition | Notes | -|-------------|---------------|--------| -| `fe79bfcc` `6725584e` `ec661f98` `a19c76a4` `62302019` | **N/A** | v1 `async_logger` / `thread_pool`; v2 uses **`async_sink`** + `mpmc_blocking_q` (`tests/test_async.cpp` differs). | -| `16e0d2e7` `63d18842` | **N/A** | v1 flush **promise** / **condition_variable** thread-pool path; not present on v2. | -| `d8e0ad46` `1e7d7e07` | **N/A** | Bundled fmt **10.2.1** bumps; superseded by current **12.1.0** pin (`cmake/fmtlib.cmake`). | -| `faa0a7a9` `85bdab0c` | **SUPERSEDED** | fmt **11.1.4** / **11.0.2** — satisfied by **12.1.0** bundled pin (**5A**). | -| `276ee5f5` `7f8060d5` `96a8f625` | **SUPERSEDED** | fmt **11.1** `to_string_view` / external fmt fixes — v2 `logger::log_with_format_` + no v1 `common.h` `to_string_view(fmt)` chain (`1685e694` triage). | -| `3c23c27d` | **N/A** | Revert of `7f8060d5`; no separate port. | - -### Triage close-out (MDC / fmt **5A**) - -*`9fe79692` (TSAN CMake) is listed in **Ports landed** above.* - -| v1.x commit(s) | Disposition | Notes | -|----------------|-------------|--------| -| `d03eb40c` … `c1fbafdc` | **N/A** | **MDC** stack (`mdc.h`, examples, TLS fix) — v2 tree has no MDC public API (**PRD 2A**). | -| `7e022c43` | **N/A** | **Feature #3379** bundles MDC with v1-only layout; non-MDC behavior covered by other ports. | -| `0d31acae` `4418909a` `ea3e747e` `878ad2e3` `2c1eafc8` `3f03542d` | **SUPERSEDED** | **fmt 12.1.0** FetchContent + **`FMT_INSTALL ON`** (fmt 12 subproject default) + MSVC **`/wd4834`** on `fmt` — matches `origin/v1.x` bundled `FMT_VERSION` **120100** (**5A**). | - -**Full SHA list:** [`v1-triage-complete.md`](v1-triage-complete.md). - -**Validation:** `ctest` Release on Windows — all unit tests passed after these ports. - -### **5A** — Bundled fmt **12.1.0** (aligned with `origin/v1.x`) - -| Change | Notes | -|--------|--------| -| `cmake/fmtlib.cmake` | Fetch **12.1.0** (`URL` + `SHA256`); **`FMT_INSTALL ON`** (fmt 12 defaults install **OFF** as subproject — required for `install(EXPORT spdlogTargets)`); MSVC **`/wd4834`** on target **`fmt`** (C4834 in `locale_ref` vs stock **12.1.0** tarball). | -| `cmake/spdlogConfig.cmake.in` | `find_dependency(fmt 12 CONFIG)` for **`SPDLOG_FMT_EXTERNAL`** consumers. | - -**Validation:** `cmake -DSPDLOG_BUILD_TESTS=ON -DSPDLOG_BUILD_WARNINGS=ON`, `ctest` Release — passed (Windows, MSVC). - -## Integration branch - -- **Remote:** `origin/integration/v2-sync-v1` (pushed; open PR against `v2.x` when ready.) - -## Migration and release notes (PRD **5.4**) - -Downstream-facing guidance (**dependencies**, **CMake**, **v1 vs v2 API differences**, upgrade checklist): **[`tasks/migration-notes-v2x-v1x-integration.md`](migration-notes-v2x-v1x-integration.md)**. - -## Sign-off - -- [ ] Maintainer review of this report and updated strategy. diff --git a/tasks/migration-notes-v2x-v1x-integration.md b/tasks/migration-notes-v2x-v1x-integration.md deleted file mode 100644 index cb3909941b..0000000000 --- a/tasks/migration-notes-v2x-v1x-integration.md +++ /dev/null @@ -1,80 +0,0 @@ -# Migration and release notes: v1.x parity on v2.x (`integration/v2-sync-v1`) - -**Audience:** Downstream developers building or packaging spdlog from the **`integration/v2-sync-v1`** branch (hybrid port of applicable **v1.x** fixes into the **v2.x** layout). -**PRD:** [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md) — API intent **2A**, dependency baseline **5A**, full commit triage **3A**. - -**Status:** This branch is an **integration line** toward **`v2.x`**; it is not a tagged release. Rebase or fast-forward relative to **`origin/v2.x`** may change; pin a commit SHA for reproducible builds. - ---- - -## 1. Dependencies (5A) - -| Item | Requirement / note | -|------|-------------------| -| **{fmt}** | Default build **fetches fmt [12.1.0](https://github.com/fmtlib/fmt/releases/tag/12.1.0)** via CMake (`cmake/fmtlib.cmake`). Same bundled **`FMT_VERSION`** as current **`origin/v1.x`** (120100). | -| **External fmt** | Set **`SPDLOG_FMT_EXTERNAL=ON`** and install **fmt 12.x** (CMake package **`find_package(fmt 12)`** — see `cmake/spdlogConfig.cmake.in`). Older **fmt 11** installs are **not** satisfied by the installed config. | -| **CMake** | **3.23+** (project minimum). | -| **C++** | **C++17** or newer (project default). | - -**MSVC:** The bundled **fmt** target may be built with **`/wd4834`** (workaround for a **C4834** diagnostic in fmt **12.1.0**’s `locale_ref` with the stock tarball). This is scoped to the **fmt** target, not your whole project. - ---- - -## 2. Public API (2A) - -The integration branch **preserves the v2.x public surface**: compiled library layout, **`include/spdlog/`** structure, **`async_sink`**-based async logging, and **no** v1-only headers such as `spdlog/cfg/*.h`, **`mdc.h`**, or the v1 **registry** API. - -**Not ported as v1-shaped APIs** (by design; see [`v1-triage-complete.md`](v1-triage-complete.md)): - -- **Mapped Diagnostic Context (MDC)** — v1 **MDC** commits are triaged **N/A** on this v2 tree. -- **v1 `async_logger` / `thread_pool`** — v2 uses **`async_sink`** and **`mpmc_blocking_q`**; v1 async/thread-pool–specific behavior is **N/A**. -- **`spdlog/cfg`**, **`load_env_levels`**, **registry** helpers that exist only on v1 — **N/A** where v2 uses **`set_global_logger`** / different registration model. - -If you rely on those v1 APIs, stay on **v1.x** or plan an explicit port; this branch does not reintroduce the v1 file tree. - ---- - -## 3. CMake options (high-signal) - -New or particularly relevant options on this branch (non-exhaustive; see top-level **`CMakeLists.txt`**): - -| Option | Purpose | -|--------|---------| -| **`SPDLOG_FMT_EXTERNAL`** | Use system **fmt** instead of FetchContent (**12.x**). | -| **`SPDLOG_SANITIZE_THREAD`** / **`SPDLOG_SANITIZE_ADDRESS`** | Thread / address sanitizer for **tests** (and **spdlog** library when enabled); **mutually exclusive**. CI may pass **`SPDLOG_SANITIZE_THREAD`** on Linux Clang. | -| **`SPDLOG_NO_TZ_OFFSET`** | Platforms without reliable `tm_gmtoff` / offset: **`%z`** placeholder and UTC offset helpers degrade gracefully. | -| **`SPDLOG_WCHAR_CONSOLE`** (Windows) | Optional **UTF-8 → wide** path for **`wincolor_sink`** (**`WriteConsoleW`**). | -| **`SPDLOG_MSVC_UTF8`** | **`/utf-8`** on real MSVC for **fmt** / UTF-8 literals (default **ON**). | -| **`SPDLOG_DEBUG_POSTFIX`** | Cache string for **`DEBUG_POSTFIX`** (may be empty). | - ---- - -## 4. Behavioral and portability fixes (from v1.x ports) - -These are **bug fixes / parity** items you may notice when upgrading from an older **v2.x** snapshot (see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md) and [`commits-ported.txt`](commits-ported.txt)): - -- **Timezones:** **`%z`** with **`pattern_time_type::utc`**, Windows **`utc_minutes_offset`**, POSIX **`TZ`** tests — see **`test_timezone.cpp`** / **`test_pattern_formatter.cpp`**. -- **Sinks / I/O:** **`rotating_file_sink::rotate_now`** mutex; **`basic_file_sink::truncate()`**; **`dup_filter_sink`** ctor / notification level behavior; TCP **timeouts** on **`tcp_sink`**; UDP **`const udp_sink_config&`** ctor. -- **OS:** **`getenv`** via **`std::getenv`** (MSVC / UWP guards), **`utf8_to_wstrbuf`** fixes, **`udp_client_unix`** **`reinterpret_cast`** for **`sockaddr`**. -- **Tests / CI:** **`actions/checkout@v6`**; optional **TSAN** matrix on Linux. - -No separate guarantee of **ABI** stability across pre-release SHAs of this branch (**2A** targets **source**-level v2.x API preservation). - ---- - -## 5. Upgrade checklist - -1. **Bump fmt** to **12.x** if you use **`SPDLOG_FMT_EXTERNAL`** (or drop external and use the default FetchContent pin). -2. **Re-run CMake** in a clean build directory; resolve any **`find_package(spdlog)`** / **`find_package(fmt)`** version errors. -3. **Remove** includes of v1-only headers if you were experimenting with v1 APIs. -4. **Run** your tests plus **`ctest`** for spdlog if you vendor it. -5. **Track** [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md) for the full port list and rationale. - ---- - -## 6. References - -- Product requirements: [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md) -- Full v1-only commit triage: [`v1-triage-complete.md`](v1-triage-complete.md) -- Merge / port report: [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md) -- Landed port SHAs (commentary): [`commits-ported.txt`](commits-ported.txt) diff --git a/tasks/prd-v2x-v1x-feature-parity.md b/tasks/prd-v2x-v1x-feature-parity.md deleted file mode 100644 index 00d21eb537..0000000000 --- a/tasks/prd-v2x-v1x-feature-parity.md +++ /dev/null @@ -1,176 +0,0 @@ -# PRD: Bring v1.x features into the v2.x line - -## Introduction / Overview - -The **v1.x** branch is the current main development line for spdlog and receives ongoing fixes, dependency updates (for example fmt bumps), CI changes, and feature work. The **v2.x** branch contains substantial improvements and API or architectural changes targeted at a future major line, but it has **diverged** from v1.x and no longer includes many commits that landed on v1.x after the branches split. - -**Problem:** Consumers and maintainers cannot treat v2.x as “v1.x plus improvements” because v2.x is missing bug fixes, portability updates, documentation corrections, and dependency alignment that exist on v1.x. - -**Goal:** Update the v2.x line so it **incorporates the relevant changes from v1.x** (up to the current v1.x branch) while **preserving v2.x’s own improvements**. The result should be a coherent v2.x that is not stale relative to v1.x for shared components (core library, sinks, tests, build/CI, docs), subject to explicit decisions on merge strategy and compatibility. - -**Repository context (informational):** As of the latest fetch, **v1.x** and **origin/v2.x** share a common ancestor but have diverged: hundreds of commits are unique to each side. This is a **non-trivial port/merge**, not a fast-forward. - ---- - -## Goals - -1. **Feature and fix parity (shared surface):** v2.x should include behavior, fixes, and updates from v1.x that apply to code paths shared between the two lines (unless explicitly excluded as non-goals). -2. **Preserve v2.x value:** v2.x-specific improvements (API, structure, performance) must remain intact unless deliberately superseded by a v1.x change with team agreement. -3. **Predictable quality:** All agreed automated tests pass on supported platforms; CI workflows are updated and green for the v2.x line where applicable. -4. **Clear documentation:** Release notes or migration notes describe what was merged from v1.x and any intentional differences between v1.x and v2.x. - ---- - -## Decisions recorded (stakeholder input) - -| # | Topic | Decision | -|---|--------|----------| -| 1 | Integration strategy | **1D — Hybrid:** Merge `v1.x` into a v2-based integration branch first, resolve conflicts per **2A**, then use smaller follow-up ports (cherry-picks or PRs) for gaps, risky areas, or anything missed; maintain a full **3A** triage of `v2.x..v1.x` commits until complete. | -| 2 | API / ABI during sync | **2A** — Preserve existing v2.x public API where possible; additive or internal changes unless unavoidable. | -| 3 | Scope of v1.x port | **3A** — Full parity: everything applicable from v1.x since merge-base for shared code (with explicit triage for “superseded” / “N/A”). | -| 4 | Timeline | **4B — High priority (~one release cycle):** Treat as main-track work with milestones (merge + CI green, then triage completion, fmt/docs + release notes) before a tagged v2.x pre-release in that cycle. | -| 5 | fmt and compiler baseline | **5A** — Match current **v1.x** bundled/documented **fmt** (major/minor) and align **compiler warning** handling with v1.x for shared code unless v2.x documents a deliberate, reviewed exception. | - -*Execution detail for **1**, **4**, and **5** is expanded in **Guidance and recommendations** below.* - ---- - -## User Stories - -1. **As a library maintainer**, I want v2.x to include fixes and updates from v1.x so I do not maintain two unrelated histories or re-discover the same bugs on v2.x. -2. **As a downstream developer** evaluating spdlog v2.x, I want assurance that v2.x is based on a current v1.x baseline so I am not choosing between “new API” and “recent bug fixes.” -3. **As a contributor**, I want a documented merge/port process and success criteria so I can land changes without accidental regressions or scope creep. -4. **As a CI/release owner**, I want the v2.x branch to build and test cleanly on the same (or explicitly documented) matrix as we expect for releases. - ---- - -## Functional Requirements - -1. The work must **identify** all v1.x commits not present in v2.x (from the merge-base through current v1.x) and **classify** each as: port into v2.x, already superseded on v2.x, or not applicable (v1-only code paths). -2. The system must **integrate** applicable v1.x changes into v2.x using the **hybrid strategy (1D)** (merge into an integration branch, then follow-ups as needed), resolving conflicts explicitly with recorded rationale where behavior differs between branches. -3. The **build system** (CMake, options, warnings policy) on v2.x must remain consistent with v2.x goals after merging v1.x changes; any intentional deviation from v1.x must be documented. -4. **Third-party dependencies** must follow **5A:** fmt baseline (bundled/minimum) and warning policy aligned with **current v1.x** for the integration result, with any v2.x-only exception documented and reviewed. -5. **Unit and integration tests** relevant to merged changes must pass; new tests from v1.x must be brought over when they cover shared behavior. -6. **CI configuration** (.github workflows or equivalent) must be updated so v2.x is validated appropriately (not necessarily identical to v1.x if v2.x has a different matrix by design). -7. **Documentation** (README, version macros, migration notes) must reflect the new baseline and any breaking or intentional differences between v1.x and v2.x. -8. The team must produce a **short merge report** listing major areas touched (e.g. sinks, formatting, OS-specific code, Qt/UWP, TCP timeouts) and any decisions that rejected a v1.x port. - ---- - -## Non-Goals (Out of Scope) - -1. **Redefining v2.x product vision:** This effort does not replace planning for what v2.x “should be” long-term; it only brings v1.x work forward into the existing v2.x direction unless stakeholders explicitly expand scope. -2. **Guaranteeing binary or source compatibility** with every historical v2.x snapshot (narrowed by **2A**: prioritize preserving the *current* intended v2.x public API, not every experimental pre-release snapshot). -3. **Implementing new features** beyond what is required to port v1.x commits and keep tests/CI healthy (no opportunistic refactors unrelated to the port). -4. **Retiring v1.x** or changing the default branch policy (unless the organization decides separately). - ---- - -## Design Considerations - -- Prefer **minimal behavioral drift** when resolving conflicts: if v1.x fixed a bug in shared logic, the ported v2.x code should exhibit the same fix unless v2.x intentionally changed semantics. -- **User-visible API** on v2.x should follow v2.x conventions; porting may require adapting v1.x patches to v2.x APIs rather than literal cherry-picks. -- **Documentation** should call out any v2.x-only APIs so users are not confused by v1.x docs copied verbatim. - ---- - -## Technical Considerations - -- **Divergence:** Expect a large number of commits unique to each branch; a one-shot merge may produce many conflicts. Alternatives include merging v1.x into v2.x, rebasing v2.x onto v1.x, or systematic cherry-pick/port with a tracking spreadsheet. -- **Merge-base:** Use `git merge-base v1.x v2.x` to anchor analysis; compare ranges `v2.x..v1.x` and `v1.x..v2.x` for commit lists. -- **fmt and formatting:** v1.x has moved through fmt bumps and related warning fixes; v2.x may use different constraints—resolve version and compiler warning policy explicitly. -- **Platform-specific code:** Commits touching Windows, UWP, POSIX `TZ`, TCP, etc. need validation on representative environments. -- **No implementation in this document:** This PRD describes requirements only; the team chooses concrete Git workflow and review steps. - ---- - -## Success Metrics - -1. **CI:** Required pipelines for the v2.x integration pass on the agreed platform/compiler matrix. -2. **Tests:** No new failures in the v2.x test suite attributable to the port; regressions from v1.x fixes are caught by tests brought over or added. -3. **Coverage of v1.x delta:** The merge report shows **high coverage** of v1.x commits (e.g. 100% triaged, with explicit “N/A” or “superseded” for the rest—not silent drops). -4. **Stakeholder sign-off:** At least one maintainer approves the integration strategy summary and release-note accuracy. - ---- - -## Guidance and recommendations (items 1, 4, 5) - -### 1 — Integration strategy (merge, rebase, cherry-pick, hybrid) - -**Context:** Both lines have diverged heavily (hundreds of commits unique to each side). **3A** requires every applicable v1.x change to be accounted for; **2A** means conflict resolution often favors **keeping v2.x’s public headers and intended API**, while still landing v1.x **behavior fixes** in implementations. - -| Approach | What it means | Strengths | Risks / costs | -|----------|----------------|-----------|----------------| -| **A — Merge `v1.x` into `v2.x`** (on a long-lived branch first, e.g. `integration/v2-sync-v1`) | One merge commit brings the full v1.x history into the v2.x line. | Single integration point; git history shows the merge; `git log v2.x..v1.x` becomes empty for content you successfully merged. | Large conflict surface in one step; review can be heavy; easy to hide mistakes without strict review. | -| **B — Rebase `v2.x` onto current `v1.x`** | Replay v2.x commits on top of v1.x tip. | Linear history; mental model “v2 is v1 + deltas.” | Can be **very** painful with hundreds of v2 commits; rewrites published history (force-push) if `v2.x` is shared; same logical conflicts as merge, but spread across many steps. | -| **C — Cherry-pick / topical batches** | Port v1.x commits (or grouped diffs) in waves: CI, bundled deps, core, sinks, etc. | Reviewable chunks; clear attribution; easier to enforce **2A** per file. | Easy to miss ordering dependencies; duplicate conflict resolution; needs a **tracking list** to reach **3A** (100% triaged). | -| **D — Hybrid** | e.g. merge `v1.x` → `v2.x` once, then cherry-picks or small PRs for fixes that were too risky in the big merge, or for follow-up gaps. | Balances speed of merge with controlled cleanup. | Requires discipline to close the “gap list” after the merge. | - -**Recommendation (default):** **D — Hybrid**, implemented as: - -1. **Branch:** From current `v2.x`, create `integration/v2-sync-v1` (name as you prefer). -2. **Merge `v1.x` into that branch** (not necessarily into `v2.x` directly until green). This is usually faster than rebasing hundreds of v2 commits and avoids rewriting remote history. -3. **Resolve conflicts** with explicit rules: **public API** → keep v2.x unless the v1.x change is purely additive and consistent with v2.x; **implementation / tests / CI** → prefer carrying v1.x fixes forward; document any intentional “v2 wins” behavior. -4. **Close the loop for 3A:** After the merge, run `git log` / compare ranges and ensure **every** remaining v1-only commit is marked ported, superseded-on-v2, or N/A—with reasons in the merge report. -5. **Optional:** Use **topical cherry-picks** only where the big merge was wrong or too risky to do in one shot. - -**When to prefer B (rebase):** Small number of v2-only commits, or `v2.x` is not widely shared and maintainers want a linear history on top of `v1.x`. For large divergence, B is usually worse than merge + cleanup. - -**When to prefer C alone:** Legal/process need for commit-by-commit review, or merge conflicts are predicted to be unreviewable as one PR—in that case, still use a **spreadsheet or checklist** keyed by commit SHA so **3A** is not missed. - ---- - -### 4 — Timeline and release expectation - -**Reality check:** Full parity (**3A**) plus API care (**2A**) across a large divergence is **not** reliably a “few days” unless one person is full-time on it and conflicts are mild. - -| Option | Rough meaning | Fits when… | -|--------|----------------|------------| -| **A — Urgent (weeks)** | Hard focus; ship a first integratable branch quickly. | Dedicated owner; acceptable to merge in stages with follow-up PRs; risk tolerance for a few rough edges fixed immediately after. | -| **B — High priority (~one release cycle)** | Main track work with defined milestones before a tagged v2 pre-release. | Team wants **merge + CI green + spot-check tests** as “milestone 1,” then fmt/docs hardening as “milestone 2” in the same cycle. | -| **C — Standard / incremental** | Multiple cycles; possibly merge early, then port gaps in follow-up releases. | Limited bandwidth; **3A** still enforced via triage list over time. | -| **D — No fixed date** | Quality and completeness before any tag. | v2.x not yet promised to downstream; avoids rushing bad merges. | - -**Recommendation:** **B or D** for most teams: **B** if you want a **time-boxed** integration branch and a pre-release tag; **D** if `v2.x` is still experimental and correctness matters more than a calendar. **A** is only realistic with dedicated time and acceptance of follow-up fix PRs. - -**Milestone suggestion (works with B or C):** - -- **M1:** Integration branch exists; merge from `v1.x` applied; **CI green** on agreed matrix; no known crashers in tests. -- **M2:** **3A** triage list 100% complete; merge report published. -- **M3:** **5A** applied (fmt/toolchain alignment with v1.x); release notes + migration notes for v2.x users. - ---- - -### 5 — fmt and compiler baseline after sync - -**Tension:** **3A** pushes you toward **behavioral** alignment with v1.x (including fixes that assume a given **fmt** API and warning set). **2A** pushes you to keep **v2.x’s public surface**—usually compatible with “same fmt major” if headers and `format_string` usage match. - -| Option | Meaning | Fits when… | -|--------|---------|------------| -| **A — Match current v1.x fmt (major/minor) and warnings policy** | v2.x after sync uses the **same default bundled / documented fmt** as v1.x unless v2.x documents an override. | You want the fewest surprises when porting v1.x fixes and tests; simplest story for **3A**. | -| **B — Keep v2.x’s planned fmt/toolchain (e.g. newer than v1.x); backport fixes only** | v2.x leads on dependency version; v1.x commits adapted. | v2.x intentionally targets newer fmt/compiler; you accept extra work rewriting some v1.x patches. | -| **C — New shared baseline for both lines** | Org decision to bump fmt (and maybe compiler floor) everywhere as part of this effort. | You want one fmt story across v1.x and v2.x going forward; **larger scope** (two branches + release coordination). | - -**Recommendation:** Start with **A** for the **integration branch**: match **v1.x’s fmt** and mirror its **warning-suppression / compiler** patterns for shared code, so ported tests and fixes behave the same. After the branch is stable, consider **C** as a **follow-up** coordinated release if you want both lines on a newer fmt without re-litigating the port. - -**Practical “done” criteria for 5 (whichever option you pick):** - -- **Single policy** in CMake/docs: bundled fmt version **or** minimum external fmt version is explicit for v2.x builds. -- **CI matrix** matches the claimed compilers (or documents exceptions). -- **No known fmt-related regressions** compared to v1.x for shared formatting paths (run tests from both lines where applicable). - ---- - -## Open questions - -*None — all listed decisions are recorded above. New questions may be added here if scope or upstream policy changes during implementation.* - ---- - -## Document history - -| Version | Date | Notes | -|---------|------------|--------------------------| -| 1.0 | 2026-04-04 | Initial draft from brief | -| 1.1 | 2026-04-04 | Recorded 2A, 3A; added guidance for 1, 4, 5 | -| 1.2 | 2026-04-04 | Recorded 1D, 4B, 5A; closed open questions | diff --git a/tasks/tasks-v2x-v1x-feature-parity.md b/tasks/tasks-v2x-v1x-feature-parity.md deleted file mode 100644 index ea97e31bad..0000000000 --- a/tasks/tasks-v2x-v1x-feature-parity.md +++ /dev/null @@ -1,86 +0,0 @@ -# Task list: v2.x ↔ v1.x feature parity - -Derived from [`prd-v2x-v1x-feature-parity.md`](prd-v2x-v1x-feature-parity.md). Decisions: **1D** (hybrid merge), **2A** (preserve v2 public API where possible), **3A** (full triage of v1.x delta), **4B** (~one release cycle), **5A** (align fmt / warnings with v1.x). - -## Progress (2026-04-04) - -- **Done:** Integration branch created and pushed; merge-base and v1-only commit list exported; triage template and merge-report draft added; direct `git merge origin/v1.x` was attempted and **aborted** (v2.x file-tree divergence vs v1.x — see [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md)). -- **Ports:** [`commits-ported.txt`](commits-ported.txt). **Full triage (245 v1-only SHAs):** [`v1-triage-complete.md`](v1-triage-complete.md) — **PORTED**, **PENDING**, **SUPERSEDED**, or **N/A** (merge commits). **All unit tests pass** (`ctest` Release, Windows). -- **Latest pass (triage-only, no code):** Pushed as **`aeb67cfe`** on `origin/integration/v2-sync-v1`. Reclassified **15** v1-only commits that do not apply to the current v2 integration branch as written: - - **N/A — v1 `async_logger` / `thread_pool`** (v2 uses `async_sink` + `mpmc_blocking_q`): `fe79bfcc`, `6725584e`, `ec661f98`, `a19c76a4`, `62302019` (thread-pool / async-logger behavior and tests); `16e0d2e7`, `63d18842` (flush promise / condition_variable / callback on the v1 `thread_pool`). - - **N/A — bundled fmt 10.2.1 churn:** `d8e0ad46`, `1e7d7e07` — superseded by the current fmt pin (**5A**). - - **N/A — revert pair:** `3c23c27d` (revert of external-fmt #3312; covered with `7f8060d5` triage). - - **SUPERSEDED — fmt 11.x / `to_string_view` / bundle:** `faa0a7a9`, `85bdab0c` (superseded by **12.1.0** pin); `276ee5f5`, `7f8060d5`, `96a8f625` (v2 has no v1 `common.h` `to_string_view(fmt)` chain; logging uses **`log_with_format_`** / **`fmt::vformat_to`**, same story as **`1685e694`**). - - Docs: [`v1-triage-complete.md`](v1-triage-complete.md), [`commits-ported.txt`](commits-ported.txt) comment block, [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md) subsection **“Triage-only batch (v1 async / fmt delta vs v2)”**. Prior code work: `c3aed4b6` wchar console. -- **Triage snapshot:** **42 PORTED**, **62 SUPERSEDED**, **141 N/A**, **0 PENDING** — [`v1-triage-complete.md`](v1-triage-complete.md) (**3A** complete). -- **5A (fmt):** Bundled **fmt 12.1.0** via `cmake/fmtlib.cmake` (matches `origin/v1.x` `FMT_VERSION` **120100**); **`FMT_INSTALL ON`** for fmt 12 subproject + install export; MSVC **`/wd4834`** on target **`fmt`**; **`find_dependency(fmt 12)`** in `cmake/spdlogConfig.cmake.in`; README notes bundled vs external. Prior: **`9fe79692`** TSAN CMake; MDC / Feature 3379 **N/A**. -- **5.4 (migration / release notes):** [`migration-notes-v2x-v1x-integration.md`](migration-notes-v2x-v1x-integration.md) — fmt **12.x**, CMake options, intentional v1 vs v2 API gaps (**MDC**, **async_logger**, **cfg/registry**), behavioral port summary, upgrade checklist. - -## Relevant Files - -- `CMakeLists.txt` — Top-level CMake options, warnings, install rules (**5A** fmt pin lives in **`cmake/fmtlib.cmake`**). -- `include/spdlog/version.h` (or equivalent version header in repo) — Version macros for v2.x pre-release; confirm path under `include/`. -- `include/spdlog/**/*.h` — Public API; conflict resolution favors **2A** (v2.x surface) while landing v1.x behavior fixes in implementations. -- `src/**/*.cpp` — Implementation files likely touched by merge conflicts and ports. -- `tests/*.cpp`, `tests/CMakeLists.txt`, `tests/main.cpp` — Test sources; bring over v1.x tests that cover shared behavior; run full suite on integration branch. -- `.github/workflows/linux.yml`, `.github/workflows/macos.yml`, `.github/workflows/windows.yml` — CI matrix for v2.x branch after integration; update triggers/branches as needed. -- `README.md` — User-facing build and version notes post-sync. -- `docs/` (if present on branch) — Additional documentation for v2.x vs v1.x. -- **`cmake/fmtlib.cmake`** — FetchContent **fmt** version (**5A**; v2.x does not vendor `include/spdlog/fmt/bundled/` like v1.x). -- [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md) — Merge report (extend as ports land). -- [`migration-notes-v2x-v1x-integration.md`](migration-notes-v2x-v1x-integration.md) — Migration / release notes for downstream users (**5.4**). - -### Notes - -- **Commits:** Prefer **small, topical commits** (code vs. doc-only when practical), **`ctest` Release** before push, then **`git push origin integration/v2-sync-v1`** so the branch and CI stay current. -- Build and test with CMake: configure a build directory, then `cmake --build .` and `ctest` (or your project’s documented test target). Example: `cmake -B build -S . -DSPDLOG_BUILD_TESTS=ON` then `cmake --build build` and `ctest --test-dir build`. -- Conflict resolution rule of thumb: **public headers** → preserve v2.x unless v1.x change is additive and compatible; **`.cpp` / tests / CI** → prefer carrying v1.x fixes forward; document intentional “v2 wins” cases in the merge report. -- Keep a **triage spreadsheet or checklist** (commit SHA → ported | superseded | N/A + reason) until **3A** is 100% complete. - -## Instructions for Completing Tasks - -**IMPORTANT:** As you complete each task, check it off by changing `- [ ]` to `- [x]`. Update after completing each sub-task, not only after finishing a parent task. - -Example: `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing). - -## Tasks - -- [x] 0.0 Create integration branch - - [x] 0.1 Fetch latest `v1.x` and `v2.x` (e.g. `git fetch origin v1.x v2.x`). - - [x] 0.2 Create branch from current `v2.x` (e.g. `git checkout -b integration/v2-sync-v1 origin/v2.x` or team naming convention). - - [x] 0.3 Push integration branch to remote so CI and reviewers can track it (if policy allows). - -- [x] 1.0 Build v1.x commit inventory and triage framework (3A) - - [x] 1.1 Record merge-base: `git merge-base v1.x v2.x` (document SHA). - - [x] 1.2 List commits on v1.x not in v2.x: `git log v2.x..v1.x --oneline` (export to file for tracking). - - [x] 1.3 Create triage sheet with columns: SHA, subject, status (ported / superseded / N/A), notes, reviewer initials. - - [x] 1.4 Define “superseded” and “N/A” criteria with the team (e.g. v1-only path removed on v2.x → N/A). - - [x] 1.5 Optionally group commits by area (fmt, CI, sinks, OS-specific) to plan reviews. - -- [ ] 2.0 Merge `v1.x` into integration branch and resolve conflicts (1D, 2A) - - [ ] 2.1 Merge `v1.x` into the integration branch (`git merge v1.x` or merge `origin/v1.x`); resolve conflicts in working tree. - - [ ] 2.2 For each conflicted file, apply rules: keep **v2.x public API** where required by **2A**; land **v1.x behavior fixes** in implementations and tests. - - [ ] 2.3 Document each non-obvious resolution (short bullet in merge report draft or commit message). - - [ ] 2.4 Build locally (Release and at least one Debug) and fix compile errors before pushing. - - [x] 2.5 Follow-up: cherry-pick or small PRs for anything that could not be merged cleanly or was deferred (hybrid **1D**). *(Ongoing: `09a674b7`, `b656d1ce` — see [`commits-ported.txt`](commits-ported.txt).)* - -- [x] 3.0 Align fmt, CMake, and compiler warnings (5A) - - [x] 3.1 Compare bundled fmt / CMake fmt version pins between merged tree and current `v1.x`; align bundled copy and `CMakeLists.txt` with **v1.x** unless a reviewed exception is documented. *(**12.1.0** FetchContent — same `FMT_VERSION` as `origin/v1.x`.)* - - [x] 3.2 Reconcile `SPDLOG_FMT_EXTERNAL` / header-only options with documented v2.x behavior; update README if defaults change. *(`find_dependency(fmt 12)` + README bullet.)* - - [x] 3.3 Match **v1.x** warning suppressions and compiler flags for shared code (MSVC, GCC, Clang); remove stale suppressions only if v1.x does and tests pass. *(MSVC `/wd4834` on **`fmt`** for fmt **12.1.0** `locale_ref` / stock tarball.)* - - [x] 3.4 Verify `src/bundled_fmtlib_format.cpp` (if used) and bundled headers are consistent with chosen fmt version. *(v2.x: FetchContent only — no in-tree bundled fmt sources.)* - -- [ ] 4.0 Tests and CI validation - - [x] 4.1 Run full test suite locally (`ctest` or project equivalent); fix failures tied to the merge. *(Windows Release: all tests pass.)* - - [x] 4.2 Port any missing **v1.x** tests that cover shared behavior not yet present on the integration branch. *(Partial: `test_timezone.cpp` + pattern tests from `b656d1ce`; more as ports land.)* - - [x] 4.3 Update `.github/workflows/*.yml` so the integration branch (or `v2.x` once merged) runs the agreed matrix; fix workflow-only issues (paths, branches). *(checkout@v6 on linux/macos/windows)* - - [ ] 4.4 Confirm CI green on Linux, macOS, and Windows (or document skipped jobs with reason). - - [ ] 4.5 Spot-check platform-specific areas called out in PRD (e.g. Windows/UWP, POSIX `TZ`, TCP) on representative configs if possible. - -- [ ] 5.0 Documentation, merge report, and release readiness (4B) - - [x] 5.1 Complete **3A** triage: every v1.x commit in range has status **ported**, **superseded**, or **N/A** with reason (no silent gaps). *([`v1-triage-complete.md`](v1-triage-complete.md): **42** / **62** / **141** / **0**; **5A** fmt **12.1.0** triage updates for former fmt-bump rows.)* - - [x] 5.2 Write **merge report**: areas touched, conflict resolutions, rejected or deferred ports with rationale. - - [x] 5.3 Update **README** (build, fmt version, branch notes) and version header for v2.x pre-release. *(fmt **12.1.0** / external **12.x** note in Features.)* - - [x] 5.4 Add **migration / release notes** for downstream users (API preserved per **2A**, dependency changes per **5A**). *([`migration-notes-v2x-v1x-integration.md`](migration-notes-v2x-v1x-integration.md); linked from [`merge-report-v2x-v1x.md`](merge-report-v2x-v1x.md).)* - - [ ] 5.5 Open PR from integration branch to `v2.x` (or maintainer process); obtain **stakeholder sign-off** per PRD success metrics. - - [ ] 5.6 Tag or schedule **v2.x pre-release** per **4B** milestone once CI and review are complete. diff --git a/tasks/triage-template.md b/tasks/triage-template.md deleted file mode 100644 index 13a5a8b731..0000000000 --- a/tasks/triage-template.md +++ /dev/null @@ -1,31 +0,0 @@ -# v1.x → v2.x commit triage (3A) - -Use this with `v1-commit-inventory.txt` (245 commits from `origin/v2.x..origin/v1.x` as of integration start). - -## Column definitions - -| Column | Description | -|--------|-------------| -| **SHA** | First 8+ chars of commit hash | -| **Subject** | One-line subject from `git log` | -| **Status** | `ported` \| `superseded` \| `N/A` | -| **Notes** | File paths, rationale, link to PR | -| **Reviewer** | Initials when reviewed | - -## Status criteria (1.4) - -- **ported** — Behavior or equivalent change exists on the integration branch (via merge, cherry-pick, or manual re-application to v2 layout). -- **superseded** — v2.x already contains a fix or replacement for the same issue; note the v2 commit or API. -- **N/A** — Change does not apply to v2.x (e.g. v1-only file removed in v2, different subsystem, or docs-only for paths that no longer exist). - -## Optional grouping (1.5) - -Tag commits by area for review batches: `fmt`, `ci`, `cmake`, `sinks`, `pattern`, `os`, `tcp/udp`, `windows`, `qt`, `tests`, `docs`, `other`. - -## Triage rows (fill in) - -| SHA | Subject | Status | Notes | Reviewer | -|-----|---------|--------|-------|----------| -| | | | | | - -*(Import from `v1-commit-inventory.txt` or track in a spreadsheet.)* diff --git a/tasks/v1-commit-inventory.txt b/tasks/v1-commit-inventory.txt deleted file mode 100644 index 49177e68b4..0000000000 --- a/tasks/v1-commit-inventory.txt +++ /dev/null @@ -1,245 +0,0 @@ -3c61b051 [ci] Update actions/checkout to latest major relese (#3575) -45b67eee Add constructor for dup_filter_sink with sinks parameter (#3549) -1fbc60a5 docs: fix SPDLOG_LEVEL env example (#3561) -0f7562a0 tests: timezone: Provide DST rules when setting TZ on POSIX systems (#3542) -d5af52d9 Fix format_string propagation (#3543) -1685e694 Fix deprecated copy constructor usage of fmt::format_string (#3541) -c49c7cf9 Allow empty DEBUG_POSTFIX property in CMakeLists (#3530) -fc7e9c87 Update common-inl.h -566b2d14 Fix #3525: Make level name matching case-insensitive (#3535) -6c5d6329 Fix should_log comment (#3534) -472945ba Fix shadow member warning in example file (#3521) -687226d9 The upd_sink and dist_sink files have been modified to address Passed by value warnings. (#3520) -f2a9dec0 Fix function arguments names different warnings (#3519) -309204d5 Rename local variables to avoid shadowing member functions (#3516) -1774e700 Add const qualifier to get_time_ and filter_ member functions (#3515) -d299603e Add missing const qualifiers to reference variables (#3514) -33375433 fix: initialize null_atomic_int::value to zero (#3513) -6b240a89 Replace C-style cast with reinterpret_cast in udp_client (#3509) -79524ddd spdlog version 1.17.0 -b656d1ce Windows utc_minutes_offset(): Fix historical DST accuracy and improve offset calculation speed (~2.5x) (#3508) -2670f47d Fix warning -09a674b7 Fix %z when pattern_type_type is utc - should be +00:00 -32dd298d Docs: fix misleading comment in blocking_queue header (#3504) -0209b12c tests: fix unit tests to not be affected by custom level names (#3492) -d2100d5d Fix: include in tcp_client.h to avoid compilation failures on Unix (#3497) -3f03542d Remove warning 4834 suppression -2c1eafc8 Backport warning fix from fmt head -878ad2e3 Supress MSVC C4834 warning triggeed by fmt 12.1.0 -c5061bb9 Update LICENSE file -ea3e747e Bump fmt to 12.1.0 -b3688ba1 Set IndentPPDirectives to "None" on clang-format -6004e3d1 Fix issue #3483 (#3491) -8806ca65 Fix UWP detection. (#3489) -cdbd64e2 Fix sign conversion warnings in qt_sinks.h (#3487) -88a0e07a Change access scope for ANSI target_file_ from private to protected (#3486) -3f7e5028 fix sign-compare warning (#3479) -dd3ca04a set CMAKE_BUILD_TYPE only in top-level project (#3480) -486b5555 Version 1.16.0 -1bea38ed clang-format -4418909a Bump fmt to 12.0.0 -f1d748e5 Remove the fileapi.h include in os-inl.h (#3444) -3edc8036 Run tests in the order they are declared in the source file. (#3451) -9ecdf5c8 Added timeout for TCP calls such as connect, send, recv (#3432) -737347d2 Update linux.yml -4f2b3d52 Update README.md (#3437) -4397dac5 chore(cmake): add option to override CMAKE_DEBUG_POSTFIX (#3433) -6fd67ce1 Update windows.yml -4619e18a Update windows.yml -a6215527 Fix ringbuffer tests for newline (#3436) -287333ee Remove unnecessary and inconsistent "final" from color sinks (#3430) -ad725d34 Use std::getenv #3414 (#3415) -e655dbb6 Fix issue #3408 -b18a234e Fix coverity ci -5d89b5b9 Update jetbrains logo (#3401) -37ff4664 Add coverity scan to CI and fix warnings (#3400) -677a2d93 Update test_stopwatch.cpp -6fa36017 Version 1.15.3 -c73b8cc4 Update comment -7ca6a4fb Update commemt -070e1c97 Update comment -0d31acae Fmt 11.2.0 (#3399) -943fcbd7 Register replace logger (#3398) -7e022c43 Feature 3379 (#3397) -548b2642 Fix warning C4530 (#3393) -847db337 dup_filter_sink: remove notification_level argument; use last message log level for notification instead (#3390) -bb8694b5 Fix links for #3380 (#3381) -cec28bf8 Fix links to local reference. (#3378) -bd0609d7 Update README.md -1f4959c8 Fix link to wiki. (#3377) -48bcf39a Version 1.15.2 -9c582574 Fix zformatter on Apple and POSIX.1-2024 conforming platform (#3366) -faa0a7a9 Bump fmt to version 11.1.4 -10320184 Fixed issue #3360 (#3361) -3335c380 Update README.md (#3338) -f355b3d5 Fix test_daily_logger -ac432c36 Gabime/v1.15.1 (#3332) -3c23c27d Revert "fix: Compatibility with external fmtlib 11.1.1 (#3312)" (#3331) -ae1de0dc Support custom environment variables for load_env_levels (#3327) -7cbf2a69 Gabime/ansicolor sink improvements (#3323) -57505989 SPDLOG_LEVEL_NAMES, comment use string_view_literals (#3291) -96a7d2a1 Format CMakeLists.txt -d7155530 Added SPDLOG_FWRITE_UNLOCKED option to CMakeLists.txt (#3318) -ad0f31c0 Enabled bin_to_hex utest for stdformat, fixed std::formatter (#3315) -96a8f625 fix: remove unused to_string_view overload in fmt >= 11.1 (#3314) -7f8060d5 fix: Compatibility with external fmtlib 11.1.1 (#3312) -276ee5f5 fix: update to_string_view function for fmt 11.1 (#3301) -24dde318 Adding lock to rotate_now() (#3281) -65e388e8 Adding on demand truncation for basic file sinks (#3280) -1e6250e1 Gabime/fwrite unlocked (#3276) -951c5b99 Allow manual rotation of rotating_file_sink (#3269) -15f53968 Update null_sink to be final (#3267) -43dcb398 Update CMakeLists.txt comment -0efef2af Update CMakeLists.txt comment -018d8aa2 Update CMakeLists.txt -35b0417f Update CMakeLists.txt comment -94526fa8 Update CMakeLists.txt comment -633003f4 Update CMakeLists.txt comment -9edab1b5 pass /utf-8 only when compiler is MSVC (#3260) -1245bf8e add explicit mt:: and std:: to avoid ambiguous call when both std::format_to and mt::format_to are present (#3259) -51a0deca docs: Removed duplicate line in daily_file_sink comment (#3249) -8e561337 Version 1.15.0 -7cee026b Added tsan to ci (#3247) -ebfa9069 CMake option to Enable/disable msvc /utf-8 flag (on by default) -68f6ec7a Merge branch 'v1.x' of https://github.com/gabime/spdlog into v1.x -d343d413 CMake option to Enable/disable msvc /utf-8 flag (on by default) -fe4f9952 Fix utf8_to_wstrbuf tests (#3245) -5673e9e5 utf8_to_wstrbuf now handles invalid utf8 sequences (#3244) -63f08750 Removed if in ci -5fd32e1a Update README.md -35345182 Update README.md (#3240) -3c2e002b ci-win-2019 (#3239) -6192537d Fix win ci -6c720155 Fix win ci -d939255f Fix win ci -ecc38811 Fix win ci -bff1a603 Fix win ci -6f2ead1a refactor win ci -92f9aa32 refactor win ci -64d9b4e2 refactor win ci -3d3f71db Fix ci -3fec1a81 Fix ci -984a9598 Fix ci -7ecfb3bc Fix ci -614c3a68 Fix ci -5dc356dc windows ci -a7eb388f windows ci wip -a5cfbf36 Revert "Better support for FMT_UNICODE in cmake" -d3730937 Better support for FMT_UNICODE in cmake -7a950e02 add /utf-8 flag for msvc -9fe79692 Gabime/tsan (#3237) -96c9a62b Fixed race condition in tests -85bdab0c Update bundled fmt to 11.0.2 (#3236) -63d18842 Gabime/async flush (#3235) -b6da5944 Ensure flush callback gets called in move-assign operator (#3232) -16e0d2e7 Exchange promise for condition_variable when flushing (fixes #3221) (#3228) -ee168957 Improve Cross-Platform Build Instructions in Documentation (#3229) -e593f669 Fix warning - extra ';' for -Wextra-semi (#3198) -2c76e610 Fix #3194 - Use Sep instead of Sept for abbreviated month -bdd1dff3 Update CMakeLists.txt, Fix spelling errors (#3193) -ffd5aa41 Update conan install command in README (#3172) -c1fbafdc Update mdc.h (#3185) -362214a3 fix/issue-3101: fix the issue where mdc ignores SPDLOG_NO_TLS (#3184) -2169a6f6 use std::lock_guard instead of std::unique_lock (#3179) -271f0f3b Add info about max_files in the docstrings of hourly/daily file sinks (#3170) -a3a0c9d6 compilation error gcc 8.5 with [-Werror=suggest-override] (#3158) -5ebfc927 fix: set `/Zc:__cplusplus` and `/MP` to MSVC only (#3139) -885b5473 Fix building with `FMT_ENFORCE_COMPILE_STRING` (#3137) -d276069a make example compatible with fmt 11 (#3130) -eeb22c13 Allow customization of syslog_sink (#3124) -c3aed4b6 Add wide character formatting and output support to wincolor_sink. (#3092) -27cb4c76 Added mdc example to readme -2d4acf8c Added mdc example -3b4fd93b Updated comment about mdc -2122eb21 Update spdlog version to 1.14.1 -22b0f4fc Clang format -37b84769 Revert pr #3023 (std::string_view overloads for logger accessor for c++17) -fa6605dc Fix compile -94a8e87c Fix #3079 -238c9ffa Bump spdlog to version 1.14.0 -3b4c775b Update comment about set_default_logger -3403f278 Don't remove previous defaullt logger from registry in set_default_logger. Fix #3016 -a34e08c7 Added CMakeSettings.json to gitignore -71925ca3 Revmoed definition of deprecated fmt macros -fd61ea93 Merge branch 'v1.x' of https://github.com/gabime/spdlog into v1.x -66ac83e7 Update gitginore to ignore .vs and out/build -dd6c9c6e Update comment -b7e0e2c2 Fix #3073 -a0d2187d README.md has include missing (#3066) -e3f5a4fe Update cmake to define FMT_LIB_EXPORT when building shared lib -1e7d7e07 Updated bundled fmt to 10.2.1 -a2b42620 Update CMakeLists.txt to fix #3029 -8fed530b Update mdc.h -1253a57d Add mdc support for default format -cba66029 Update mdc -4517ce8b Update mdc.h -1f930174 Update mdc.h -f030afe6 Update mdc.h -2969dde4 Revert "Updated bundled fmt to 10.2.1" -d8e0ad46 Updated bundled fmt to 10.2.1 -62302019 Update test_async.cpp -a19c76a4 Fix flush test in test_async.cpp -ec661f98 Update test_async.cpp -c9ce17ab INSTALL.md has been updated to provide current status information. (#3052) -6725584e Make async_logger::flush() synchronous and wait for the flush to complete (#3049) -6766f873 Remove the legacy AnalyzeTemporaryDtors option from .clang-tidy. (#3048) -73e2e02b Fix #3038 (#3044) -d03eb40c Added Mapped Diagnostic Context (MDC) support (#2907) -23587b0d Fixed regisry-inl.h -819eb27c Use find if registry is bigger than 10 in registry::get(std::string_view logger_name) -4052bc06 Use find if registry is bigger than 20 in registry::get(std::string_view logger_name) -8cfd4a7e Fixed bench dev_null -e15c5059 fix ci -42cd77d7 fix ci -c838945e fix ci -0621a7ae fix ci -e0410f43 Update ci.yml -ae525b75 Add missing include (#3026) -a45c9390 Update stopwatch.h (#3034) -5532231b feature: adds string view overloads for logger accessor (#3023) -60faedb0 Update ci.yml -bc4b3295 Update ci.yml -75bfbb7c Update ci.yml -3f0e4007 Update ci.yml -9a445245 Update ci.yml -d387fdf9 support MINGW (#3022) -134f9194 Update registry.h code formatting -fe79bfcc Expose the flusher thread object to user in order to allow setting of thread name and thread affinity when needed (#3009) -47b7e7c7 Fix typos found by codespell (#3011) -696db97f docs: details about how compile time macros work (#2981) -8979f7fb Also use _stat() on Windows to be more UTF8 friendly (#2978) -7c02e204 Bump version to 1.13.0 -2aa8b6c9 Check fd_ is not nullptr in file_helper -7cb90d1a Fix MSVC compile flag for no exceptions (#2974) -1ef8d3ce Fix #2967 -c1569a3d Bump to catch2 v3.5.0 -ba508057 Update example.cpp to fix the vector issue in bin_example (#2963) -ac55e604 Update README.md -ddce4215 fmt/*.h: include tweakme.h to set SPDLOG_FMT_EXTERNAL according to system (#2923) -8b331e2c Fix wrong thread_id (TID) in systemd_sink.h (#2919) -2d5179ba sinks: Make syslog_sink.h's syslog_prio_from_level protected (#2918) -ff205fd2 Updated logo -595a5247 Updated spdlog logo -c5452e05 Updated spdlog logo -0c4fb032 Match SPDLOG_CONSTEXPR_FUNC to FMT_CONSTEXPR (#2901) -508d20f0 Add .git-blame-ignore-revs to ignore clang-format related commits (#2899) -479a5ac3 Fix OS availability check of pthread_threadid_np for iOS (#2897) -91807c2e Update README.md -d4a5fd56 Update README.md -e5865186 Revert "Added a function to add callbacks that are called when a logger is registered (#2883)" -b6eeb736 Added a function to add callbacks that are called when a logger is registered (#2883) -0a53eafe update clang format again -251c856a update clang format again -4b2a8219 reformat code -cafde8cc updated clang format -9d522611 clang format -230e15f4 updated format.sh -7f535d18 updated .clang-format -95c226e9 format -5e88d5fe Never sort includes in clang format -5931a3d6 Fixed windows compile -f4afd81c Update common.h -1a0bfc7a clang format -f24f7fa2 Added missing include mutex -65701f4d Updated format.sh script -9e36a158 Updated clang format to google style diff --git a/tasks/v1-triage-complete.md b/tasks/v1-triage-complete.md deleted file mode 100644 index 2929bf4050..0000000000 --- a/tasks/v1-triage-complete.md +++ /dev/null @@ -1,261 +0,0 @@ -# v1.x-only commits: full triage (PRD 3A) - -Source: `git log --reverse origin/v2.x..origin/v1.x` (245 commits). Integration branch: `integration/v2-sync-v1`. - -**Status values** -- **PORTED** — Change applied on the integration branch (manual port or equivalent). -- **PENDING** — Not yet ported; may require manual merge into v2 file layout, or batch fmt/CI work. -- **N/A** — Reserved for merge-only commits or explicit non-applicability (set manually when triaging). -- **SUPERSEDED** — v2.x already satisfies the intent (different implementation path). - -All v1-only SHAs in range now have a terminal status (**PORTED**, **SUPERSEDED**, or **N/A**). Further work (e.g. **5A** fmt bump, optional MDC on v2) is tracked outside this table. - -**Counts (this revision):** 42 **PORTED**, 62 **SUPERSEDED**, 141 **N/A**, 0 **PENDING**. - -| SHA | Subject | Status | -|-----|---------|--------| -| `9e36a158` | Updated clang format to google style | N/A (formatting / tooling only; no functional port) | -| `65701f4d` | Updated format.sh script | N/A (formatting / tooling only) | -| `f24f7fa2` | Added missing include mutex | SUPERSEDED (`src/sinks/base_sink.cpp` already `#include `) | -| `1a0bfc7a` | clang format | N/A (formatting only) | -| `f4afd81c` | Update common.h | N/A (trivial v1 `common.h` edit; v2 header differs) | -| `5931a3d6` | Fixed windows compile | SUPERSEDED (`src/details/os_windows.cpp` — `windows_include.h` first; v2 has no `os-inl.h`) | -| `5e88d5fe` | Never sort includes in clang format | N/A (formatting / tooling only) | -| `95c226e9` | format | N/A (formatting only) | -| `7f535d18` | updated .clang-format | N/A (formatting only) | -| `230e15f4` | updated format.sh | N/A (formatting only) | -| `9d522611` | clang format | N/A (formatting only) | -| `cafde8cc` | updated clang format | N/A (formatting only) | -| `4b2a8219` | reformat code | N/A (formatting only) | -| `251c856a` | update clang format again | N/A (formatting only) | -| `0a53eafe` | update clang format again | N/A (formatting only) | -| `b6eeb736` | Added a function to add callbacks that are called when a logger is registered (#2883) | N/A (feature reverted in `e5865186`; no lasting v1 delta to port) | -| `e5865186` | Revert "Added a function to add callbacks that are called when a logger is registered (#2883)" | N/A (revert commit; pairs with `b6eeb736`) | -| `d4a5fd56` | Update README.md | N/A (docs-only; README content differs on v2) | -| `91807c2e` | Update README.md | N/A (docs-only) | -| `479a5ac3` | Fix OS availability check of pthread_threadid_np for iOS (#2897) | SUPERSEDED (`src/details/os_unix.cpp` — `MAC_OS_X_VERSION_MAX_ALLOWED` / iOS branch already matches intent) | -| `508d20f0` | Add .git-blame-ignore-revs to ignore clang-format related commits (#2899) | N/A (optional repo hygiene; not required for v2 parity) | -| `0c4fb032` | Match SPDLOG_CONSTEXPR_FUNC to FMT_CONSTEXPR (#2901) | N/A (v2 has no `SPDLOG_CONSTEXPR_FUNC`; different constexpr / fmt story — see **5A**) | -| `c5452e05` | Updated spdlog logo | N/A (asset-only; v2 branding assets differ) | -| `595a5247` | Updated spdlog logo | N/A (asset-only) | -| `ff205fd2` | Updated logo | N/A (asset-only) | -| `2d5179ba` | sinks: Make syslog_sink.h's syslog_prio_from_level protected (#2918) | SUPERSEDED (`syslog_sink.h` — `syslog_prio_from_level` already `protected` / `virtual`) | -| `8b331e2c` | Fix wrong thread_id (TID) in systemd_sink.h (#2919) | SUPERSEDED (`systemd_sink.h` — already logs `msg.thread_id`) | -| `ddce4215` | fmt/*.h: include tweakme.h to set SPDLOG_FMT_EXTERNAL according to system (#2923) | N/A (v2 has no `tweakme.h`; fmt wiring is CMake-driven) | -| `ac55e604` | Update README.md | N/A (docs-only) | -| `ba508057` | Update example.cpp to fix the vector issue in bin_example (#2963) | SUPERSEDED (`example/example.cpp` `binary_example` uses `push_back`; not `vector(80)`) | -| `c1569a3d` | Bump to catch2 v3.5.0 | SUPERSEDED (`tests/CMakeLists.txt` FetchContent `GIT_TAG` … `v3.5.0`) | -| `1ef8d3ce` | Fix #2967 | SUPERSEDED (`LICENSE` fmt URL already `raw.githubusercontent.com/.../LICENSE`) | -| `7cb90d1a` | Fix MSVC compile flag for no exceptions (#2974) | N/A (v2 `CMakeLists.txt` has no `SPDLOG_NO_EXCEPTIONS` / `-fno-exceptions` wiring; add when porting that option) | -| `2aa8b6c9` | Check fd_ is not nullptr in file_helper | SUPERSEDED (`src/details/file_helper.cpp` `write` already guards `fd_ == nullptr`) | -| `7c02e204` | Bump version to 1.13.0 | N/A (v1.x release version bump; v2 has own versioning) | -| `8979f7fb` | Also use _stat() on Windows to be more UTF8 friendly (#2978) | SUPERSEDED (`src/details/os_filesystem.cpp` — `path_exists` uses `std::filesystem::exists`) | -| `696db97f` | docs: details about how compile time macros work (#2981) | N/A (v1 docs; v2 macro story differs) | -| `47b7e7c7` | Fix typos found by codespell (#3011) | SUPERSEDED (`qt_sinks.h` / `test_file_helper.cpp` match; `test_errors.cpp` differs on v2) | -| `fe79bfcc` | Expose the flusher thread object to user in order to allow setting of thread name and thread affinity when needed (#3009) | N/A (v2 uses `async_sink` + `mpmc_blocking_q`; no v1 `thread_pool` flusher thread handle) | -| `134f9194` | Update registry.h code formatting | N/A (v2.x has no `registry.h` / multi-logger registry) | -| `d387fdf9` | support MINGW (#3022) | SUPERSEDED (`CMakeLists.txt` — `CMAKE_CXX_EXTENSIONS` ON for `MINGW` with `CYGWIN`/`MSYS`) | -| `9a445245` | Update ci.yml | N/A (v1 `ci.yml` / legacy CI; v2 uses `.github/workflows`) | -| `3f0e4007` | Update ci.yml | N/A (same) | -| `75bfbb7c` | Update ci.yml | N/A (same) | -| `bc4b3295` | Update ci.yml | N/A (same) | -| `60faedb0` | Update ci.yml | N/A (same) | -| `5532231b` | feature: adds string view overloads for logger accessor (#3023) | N/A (v1 registry/logger accessor API; v2 has no multi-logger registry) | -| `a45c9390` | Update stopwatch.h (#3034) | SUPERSEDED (`include/spdlog/stopwatch.h` already has `elapsed_ms()`) | -| `ae525b75` | Add missing include (#3026) | PORTED (`include/spdlog/details/circular_q.h` — `#include `) | -| `e0410f43` | Update ci.yml | N/A (v1 legacy CI) | -| `0621a7ae` | fix ci | N/A (same) | -| `c838945e` | fix ci | N/A (same) | -| `42cd77d7` | fix ci | N/A (same) | -| `e15c5059` | fix ci | N/A (same) | -| `8cfd4a7e` | Fixed bench dev_null | SUPERSEDED (`bench/latency.cpp` already `#ifdef __linux__`) | -| `4052bc06` | Use find if registry is bigger than 20 in registry::get(std::string_view logger_name) | N/A (v2.x no `registry::get` / `registry-inl.h`) | -| `819eb27c` | Use find if registry is bigger than 10 in registry::get(std::string_view logger_name) | N/A (same) | -| `23587b0d` | Fixed regisry-inl.h | N/A (same) | -| `d03eb40c` | Added Mapped Diagnostic Context (MDC) support (#2907) | N/A (v2 has no `mdc.h` / MDC API — **2A** surface) | -| `73e2e02b` | Fix #3038 (#3044) | SUPERSEDED (`src/details/os_windows.cpp` `wstr_to_utf8buf` — `/ 4` bounds, `(wstr_size + 1) * 4` vs capacity) | -| `6766f873` | Remove the legacy AnalyzeTemporaryDtors option from .clang-tidy. (#3048) | SUPERSEDED (`.clang-tidy` on v2 does not set `AnalyzeTemporaryDtors`) | -| `6725584e` | Make async_logger::flush() synchronous and wait for the flush to complete (#3049) | N/A (v2 has no `async_logger` class; use `async_sink::flush` / `wait_all`) | -| `c9ce17ab` | INSTALL.md has been updated to provide current status information. (#3052) | N/A (no `INSTALL.md` on v2 tree) | -| `ec661f98` | Update test_async.cpp | N/A (v1 `async_logger` / thread-pool tests; v2 `tests/test_async.cpp` targets `async_sink`) | -| `a19c76a4` | Fix flush test in test_async.cpp | N/A (same) | -| `62302019` | Update test_async.cpp | N/A (same) | -| `d8e0ad46` | Updated bundled fmt to 10.2.1 | N/A (superseded by current bundled fmt in `cmake/fmtlib.cmake`; track fmt under **5A**) | -| `2969dde4` | Revert "Updated bundled fmt to 10.2.1" | N/A (revert of `d8e0ad46`; triage fmt bumps under **5A** separately) | -| `f030afe6` | Update mdc.h | N/A (same — no MDC on v2) | -| `1f930174` | Update mdc.h | N/A (same) | -| `4517ce8b` | Update mdc.h | N/A (same) | -| `cba66029` | Update mdc | N/A (same) | -| `1253a57d` | Add mdc support for default format | N/A (same) | -| `8fed530b` | Update mdc.h | N/A (same) | -| `a2b42620` | Update CMakeLists.txt to fix #3029 | SUPERSEDED (v2 `cmake_minimum_required(VERSION 3.23)` — supersedes v1 `3.10...3.21`) | -| `1e7d7e07` | Updated bundled fmt to 10.2.1 | N/A (duplicate fmt bump line; **5A**) | -| `e3f5a4fe` | Update cmake to define FMT_LIB_EXPORT when building shared lib | SUPERSEDED (v2 links `fmt::fmt` from FetchContent / external; fmt target owns `FMT_*` exports — not inlined bundled fmt in `spdlog`) | -| `a0d2187d` | README.md has include missing (#3066) | N/A (docs-only) | -| `b7e0e2c2` | Fix #3073 | SUPERSEDED (v2 `source_loc::line` is unsigned; `empty()` also checks `filename`/`short_filename` — `include/spdlog/source_loc.h`) | -| `dd6c9c6e` | Update comment | N/A (comment-only) | -| `66ac83e7` | Update gitginore to ignore .vs and out/build | SUPERSEDED (`.gitignore` already has `/.vs`, `/out/build`) | -| `fd61ea93` | Merge branch 'v1.x' of https://github.com/gabime/spdlog into v1.x | N/A (merge commit) | -| `71925ca3` | Revmoed definition of deprecated fmt macros | SUPERSEDED (v2 has no v1 `spdlog/fmt/fmt.h` shim with `FMT_DEPRECATED_*`; includes `fmt/base.h` via `common.h`) | -| `a34e08c7` | Added CMakeSettings.json to gitignore | SUPERSEDED (`.gitignore` already has `/CMakeSettings.json`) | -| `3403f278` | Don't remove previous defaullt logger from registry in set_default_logger. Fix #3016 | N/A (v2 uses `set_global_logger` / single global logger, not v1 registry) | -| `3b4c775b` | Update comment about set_default_logger | N/A (v1 registry API; v2 uses `set_global_logger`) | -| `238c9ffa` | Bump spdlog to version 1.14.0 | N/A (v1.x release version bump) | -| `94a8e87c` | Fix #3079 | SUPERSEDED (`create_dir` in `os_filesystem.cpp` uses `std::filesystem::create_directories`; Windows tests in `test_create_dir.cpp` already present) | -| `fa6605dc` | Fix compile | SUPERSEDED (`tests/test_create_dir.cpp` Windows comment already ends `C:\\some-folder` without stray `\`) | -| `37b84769` | Revert pr #3023 (std::string_view overloads for logger accessor for c++17) | N/A (revert of `5532231b`; registry not on v2) | -| `22b0f4fc` | Clang format | N/A (formatting only) | -| `2122eb21` | Update spdlog version to 1.14.1 | N/A (v1.x release version bump) | -| `3b4fd93b` | Updated comment about mdc | N/A (same) | -| `2d4acf8c` | Added mdc example | N/A (same) | -| `27cb4c76` | Added mdc example to readme | N/A (docs; v2 has no MDC yet) | -| `c3aed4b6` | Add wide character formatting and output support to wincolor_sink. (#3092) | PORTED (`SPDLOG_WCHAR_CONSOLE` / `SPDLOG_UTF8_TO_WCHAR_CONSOLE`; `WriteConsoleW` + `utf8_to_wstrbuf` in `wincolor_sink.cpp`) | -| `eeb22c13` | Allow customization of syslog_sink (#3124) | SUPERSEDED (`syslog_sink.h` — `virtual syslog_prio_from_level`, `levels_array` protected) | -| `d276069a` | make example compatible with fmt 11 (#3130) | SUPERSEDED (`example/example.cpp` `fmt::formatter::format` already `const`) | -| `885b5473` | Fix building with `FMT_ENFORCE_COMPILE_STRING` (#3137) | SUPERSEDED (`rotating_file_sink::calc_filename` builds path via `ostringstream`, not `fmt::format` literal — `rotating_file_sink.cpp`) | -| `5ebfc927` | fix: set `/Zc:__cplusplus` and `/MP` to MSVC only (#3139) | SUPERSEDED (`CMakeLists.txt` already uses `CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"` for `/Zc:__cplusplus` and `/MP`) | -| `a3a0c9d6` | compilation error gcc 8.5 with [-Werror=suggest-override] (#3158) | SUPERSEDED (`base_sink.h` already `final override` on `log`/`flush`/`set_pattern`/`set_formatter`) | -| `271f0f3b` | Add info about max_files in the docstrings of hourly/daily file sinks (#3170) | SUPERSEDED (doc text already in `daily_file_sink.h` / `hourly_file_sink.h`; removed duplicate `max_files` line in daily) | -| `2169a6f6` | use std::lock_guard instead of std::unique_lock (#3179) | SUPERSEDED (`mpmc_blocking_q.h` — `overrun_counter`/`size`/`reset_overrun_counter` already use `lock_guard`) | -| `362214a3` | fix/issue-3101: fix the issue where mdc ignores SPDLOG_NO_TLS (#3184) | N/A (same) | -| `c1fbafdc` | Update mdc.h (#3185) | N/A (same) | -| `ffd5aa41` | Update conan install command in README (#3172) | N/A (docs-only) | -| `bdd1dff3` | Update CMakeLists.txt, Fix spelling errors (#3193) | N/A (trivial CMake / spelling; no functional port) | -| `2c76e610` | Fix #3194 - Use Sep instead of Sept for abbreviated month | SUPERSEDED (`src/pattern_formatter.cpp` abbreviated months already use `"Sep"`) | -| `e593f669` | Fix warning - extra ';' for -Wextra-semi (#3198) | SUPERSEDED (v2 `bench` / `example` / `callback_sink` / `msvc_sink` already match; no stray `};` / `override{};`) | -| `ee168957` | Improve Cross-Platform Build Instructions in Documentation (#3229) | N/A (v1 docs) | -| `16e0d2e7` | Exchange promise for condition_variable when flushing (fixes #3221) (#3228) | N/A (v2 has no v1 `thread_pool` / `async_msg` flush promise path) | -| `b6da5944` | Ensure flush callback gets called in move-assign operator (#3232) | N/A (v2 has no v1 `async_msg` / `flush_callback` in `thread_pool.hpp` — different async message path) | -| `63d18842` | Gabime/async flush (#3235) | N/A (follow-on to v1 thread-pool flush; not applicable on v2 `async_sink`) | -| `85bdab0c` | Update bundled fmt to 11.0.2 (#3236) | SUPERSEDED (bundled fmt **12.1.0** in `cmake/fmtlib.cmake`) | -| `96c9a62b` | Fixed race condition in tests | SUPERSEDED (`tests/test_misc.cpp` “clone async” uses `test_sink_mt` / `async_sink`) | -| `9fe79692` | Gabime/tsan (#3237) | PORTED (`SPDLOG_SANITIZE_THREAD` option + mutual exclusion with ADDRESS; `spdlog_enable_*` on `spdlog` lib + tests — matches v1 #3237) | -| `7a950e02` | add /utf-8 flag for msvc | PORTED (`CMakeLists.txt` — `SPDLOG_MSVC_UTF8` + MSVC-only genex; see `9edab1b5`) | -| `d3730937` | Better support for FMT_UNICODE in cmake | N/A (pair with `a5cfbf36` revert; triage **FMT_UNICODE** under **5A**) | -| `a5cfbf36` | Revert "Better support for FMT_UNICODE in cmake" | N/A (revert of `d3730937`) | -| `a7eb388f` | windows ci wip | N/A (v1 Windows CI churn; v2 workflows differ) | -| `5dc356dc` | windows ci | N/A (same) | -| `614c3a68` | Fix ci | N/A (same) | -| `7ecfb3bc` | Fix ci | N/A (same) | -| `984a9598` | Fix ci | N/A (same) | -| `3fec1a81` | Fix ci | N/A (same) | -| `3d3f71db` | Fix ci | N/A (same) | -| `64d9b4e2` | refactor win ci | N/A (same) | -| `92f9aa32` | refactor win ci | N/A (same) | -| `6f2ead1a` | refactor win ci | N/A (same) | -| `bff1a603` | Fix win ci | N/A (same) | -| `ecc38811` | Fix win ci | N/A (same) | -| `d939255f` | Fix win ci | N/A (same) | -| `6c720155` | Fix win ci | N/A (same) | -| `6192537d` | Fix win ci | N/A (same) | -| `3c2e002b` | ci-win-2019 (#3239) | N/A (same) | -| `35345182` | Update README.md (#3240) | N/A (docs-only) | -| `5fd32e1a` | Update README.md | N/A (docs-only) | -| `63f08750` | Removed if in ci | N/A (v1 CI) | -| `5673e9e5` | utf8_to_wstrbuf now handles invalid utf8 sequences (#3244) | SUPERSEDED (`os_windows.cpp` + `test_misc.cpp` Windows UTF tests) | -| `fe4f9952` | Fix utf8_to_wstrbuf tests (#3245) | SUPERSEDED (`test_misc.cpp` uses `std::wstring(buffer.data(), buffer.size())`) | -| `d343d413` | CMake option to Enable/disable msvc /utf-8 flag (on by default) | PORTED (same as `7a950e02` / `9edab1b5`) | -| `68f6ec7a` | Merge branch 'v1.x' of https://github.com/gabime/spdlog into v1.x | N/A (merge commit) | -| `ebfa9069` | CMake option to Enable/disable msvc /utf-8 flag (on by default) | PORTED (duplicate subject; same CMake port) | -| `7cee026b` | Added tsan to ci (#3247) | N/A (v1 CI; TSAN wiring triaged separately if needed) | -| `8e561337` | Version 1.15.0 | N/A (v1.x release version bump) | -| `51a0deca` | docs: Removed duplicate line in daily_file_sink comment (#3249) | SUPERSEDED (duplicate `max_files` line already removed in `daily_file_sink.h` on integration branch) | -| `1245bf8e` | add explicit mt:: and std:: to avoid ambiguous call when both std::format_to and mt::format_to are present (#3259) | PORTED (`README.md` user-defined type snippet uses `fmt::format_to`; `example.cpp` already did) | -| `9edab1b5` | pass /utf-8 only when compiler is MSVC (#3260) | PORTED (`$` genex on `spdlog` when `SPDLOG_MSVC_UTF8`) | -| `633003f4` | Update CMakeLists.txt comment | N/A (comment-only) | -| `94526fa8` | Update CMakeLists.txt comment | N/A (comment-only) | -| `35b0417f` | Update CMakeLists.txt comment | N/A (comment-only) | -| `018d8aa2` | Update CMakeLists.txt | N/A (trivial one-line CMake tweak) | -| `0efef2af` | Update CMakeLists.txt comment | N/A (comment-only) | -| `43dcb398` | Update CMakeLists.txt comment | N/A (comment-only) | -| `15f53968` | Update null_sink to be final (#3267) | SUPERSEDED (`null_sink` already `final` in `null_sink.h`) | -| `951c5b99` | Allow manual rotation of rotating_file_sink (#3269) | SUPERSEDED (`rotating_file_sink::rotate_now`, `tests/test_file_logging.cpp` `rotating_file_logger4`) | -| `1e6250e1` | Gabime/fwrite unlocked (#3276) | SUPERSEDED (`details::os::fwrite_bytes`, `CMakeLists.txt` `HAVE_FWRITE_UNLOCKED`, `file_helper` / sinks) | -| `65e388e8` | Adding on demand truncation for basic file sinks (#3280) | PORTED (`basic_file_sink::truncate`, `tests/test_file_logging.cpp` `basic_file_sink_truncate`) | -| `24dde318` | Adding lock to rotate_now() (#3281) | PORTED (`std::lock_guard` in `rotating_file_sink::rotate_now`) | -| `276ee5f5` | fix: update to_string_view function for fmt 11.1 (#3301) | SUPERSEDED (v2 `common.h` has no `details::to_string_view(fmt)` helpers; `logger` uses `fmt::vformat_to` — c.f. `1685e694`) | -| `7f8060d5` | fix: Compatibility with external fmtlib 11.1.1 (#3312) | SUPERSEDED (v2 + bundled fmt **12.1.0**; external fmt via `SPDLOG_FMT_EXTERNAL` / `find_dependency(fmt 12)`) | -| `96a8f625` | fix: remove unused to_string_view overload in fmt >= 11.1 (#3314) | SUPERSEDED (same as `276ee5f5` — no v1-style overloads in v2 `common.h`) | -| `ad0f31c0` | Enabled bin_to_hex utest for stdformat, fixed std::formatter (#3315) | PORTED (`test_sink.h` / `test_custom_callbacks.cpp` iterator `difference_type` cast; v2 `bin_to_hex` non-`const` `delimiter`; tests always include `test_bin_to_hex.cpp`) | -| `d7155530` | Added SPDLOG_FWRITE_UNLOCKED option to CMakeLists.txt (#3318) | SUPERSEDED (same `CheckSymbolExists` / `SPDLOG_FWRITE_UNLOCKED` wiring as `1e6250e1` on v2) | -| `96a7d2a1` | Format CMakeLists.txt | N/A (formatting only) | -| `57505989` | SPDLOG_LEVEL_NAMES, comment use string_view_literals (#3291) | N/A (v2 has no `tweakme.h` / `SPDLOG_LEVEL_NAMES`; levels in `common.h`) | -| `7cbf2a69` | Gabime/ansicolor sink improvements (#3323) | PORTED (`src/sinks/ansicolor_sink.cpp` — `set_color_mode` holds mutex, `set_color_mode_` does not; fixes double-lock vs v1 pattern; const helpers already present) | -| `ae1de0dc` | Support custom environment variables for load_env_levels (#3327) | N/A (v2 has no `spdlog/cfg/` — `load_env_levels` not present) | -| `3c23c27d` | Revert "fix: Compatibility with external fmtlib 11.1.1 (#3312)" (#3331) | N/A (revert commit; pairs with `7f8060d5` / fmt 11.1.1 churn) | -| `ac432c36` | Gabime/v1.15.1 (#3332) | N/A (v1.x release / tag commit) | -| `f355b3d5` | Fix test_daily_logger | SUPERSEDED (v2 `tests/test_daily_and_rotation_loggers.cpp` — `fmt_lib::format` in custom calculator; no `SPDLOG_BUF_TO_STRING`) | -| `3335c380` | Update README.md (#3338) | N/A (docs-only) | -| `10320184` | Fixed issue #3360 (#3361) | SUPERSEDED (scoped_padder truncate clamp; `%D` field width — already in `pattern_formatter.cpp`) | -| `faa0a7a9` | Bump fmt to version 11.1.4 | SUPERSEDED (`cmake/fmtlib.cmake` — **12.1.0** FetchContent; satisfies **11.1.4** intent) | -| `9c582574` | Fix zformatter on Apple and POSIX.1-2024 conforming platform (#3366) | SUPERSEDED (`src/details/os_unix.cpp` `utc_minutes_offset` — `__APPLE__` / `_POSIX_VERSION` guard matches #3366) | -| `48bcf39a` | Version 1.15.2 | N/A (v1.x release version bump) | -| `1f4959c8` | Fix link to wiki. (#3377) | N/A (docs-only) | -| `bd0609d7` | Update README.md | N/A (docs-only) | -| `cec28bf8` | Fix links to local reference. (#3378) | N/A (docs-only) | -| `bb8694b5` | Fix links for #3380 (#3381) | N/A (docs-only) | -| `847db337` | dup_filter_sink: remove notification_level argument; use last message log level for notification instead (#3390) | PORTED (`dup_filter_sink.h` — `skipped_msg_log_level_` from `msg.log_level`; `tests/test_dup_filter.cpp`) | -| `548b2642` | Fix warning C4530 (#3393) | N/A (v2 `CMakeLists.txt` has no `SPDLOG_NO_EXCEPTIONS` / `/EHs-c-` / `_HAS_EXCEPTIONS=0` block) | -| `7e022c43` | Feature 3379 (#3397) | N/A (v1 bundle: MDC + rotating-file / CMake / tests; v2 has no MDC — non-MDC slices already covered elsewhere) | -| `943fcbd7` | Register replace logger (#3398) | N/A (v1 registry API) | -| `0d31acae` | Fmt 11.2.0 (#3399) | SUPERSEDED (integration uses **fmt 12.1.0** via `cmake/fmtlib.cmake` — **5A**) | -| `070e1c97` | Update comment | N/A (comment-only) | -| `7ca6a4fb` | Update commemt | N/A (comment-only) | -| `c73b8cc4` | Update comment | N/A (comment-only) | -| `6fa36017` | Version 1.15.3 | N/A (v1.x release version bump) | -| `677a2d93` | Update test_stopwatch.cpp | PORTED (`tests/test_stopwatch.cpp` — 500ms waits) | -| `37ff4664` | Add coverity scan to CI and fix warnings (#3400) | N/A (optional third-party CI; not required for v2 parity) | -| `5d89b5b9` | Update jetbrains logo (#3401) | N/A (docs asset; optional for v2) | -| `b18a234e` | Fix coverity ci | N/A (Coverity CI follow-up) | -| `e655dbb6` | Fix issue #3408 | SUPERSEDED (v2 has no `include/spdlog/fmt/fmt.h`; includes `fmt/base.h` via `common.h`) | -| `ad725d34` | Use std::getenv #3414 (#3415) | PORTED (`os_windows.cpp` / `os_unix.cpp` — `std::getenv`; MSVC 4996 suppressed; no v2 `cfg/` `load_levels`) | -| `287333ee` | Remove unnecessary and inconsistent "final" from color sinks (#3430) | SUPERSEDED (v2 `ansicolor_sink`/`wincolor_sink` layout differs; no `final` on same methods as v1 patch) | -| `a6215527` | Fix ringbuffer tests for newline (#3436) | PORTED (`ringbuffer_sink.h` reject `n_items==0`; `test_ringbuffer_sink.cpp` — v2 API uses `drain`, not v1 `last_formatted`) | -| `4619e18a` | Update windows.yml | N/A (v1 workflow history; triage current `.github/workflows` separately) | -| `6fd67ce1` | Update windows.yml | N/A (same) | -| `4397dac5` | chore(cmake): add option to override CMAKE_DEBUG_POSTFIX (#3433) | PORTED (`SPDLOG_DEBUG_POSTFIX` cache; default `-${MAJOR}.${MINOR}d` matches prior v2 hardcode) | -| `4f2b3d52` | Update README.md (#3437) | N/A (docs-only) | -| `737347d2` | Update linux.yml | N/A (v1 workflow history) | -| `9ecdf5c8` | Added timeout for TCP calls such as connect, send, recv (#3432) | PORTED | -| `3edc8036` | Run tests in the order they are declared in the source file. (#3451) | N/A (Catch2 test registration order; optional) | -| `f1d748e5` | Remove the fileapi.h include in os-inl.h (#3444) | PORTED (`src/details/os_windows.cpp` — drop redundant `#include `; `windows_include.h` / `windows.h` sufficient for `FlushFileBuffers`) | -| `4418909a` | Bump fmt to 12.0.0 | SUPERSEDED (same — **12.1.0** bundled) | -| `1bea38ed` | clang-format | N/A (formatting only) | -| `486b5555` | Version 1.16.0 | N/A (v1.x release version bump) | -| `dd3ca04a` | set CMAKE_BUILD_TYPE only in top-level project (#3480) | PORTED | -| `3f7e5028` | fix sign-compare warning (#3479) | PORTED (`os_windows.cpp` `utf8_to_wstrbuf` — `assert` vs `static_cast(target.size())`) | -| `88a0e07a` | Change access scope for ANSI target_file_ from private to protected (#3486) | PORTED (`include/spdlog/sinks/ansicolor_sink.h`) | -| `cdbd64e2` | Fix sign conversion warnings in qt_sinks.h (#3487) | PORTED (`include/spdlog/sinks/qt_sinks.h` — `qsizetype` + `colors_.at(static_cast(msg.log_level))`) | -| `8806ca65` | Fix UWP detection. (#3489) | PORTED (`src/details/os_windows.cpp` `getenv` — `WINAPI_FAMILY` vs `WINAPI_FAMILY_DESKTOP_APP`) | -| `6004e3d1` | Fix issue #3483 (#3491) | PORTED (`SPDLOG_NO_TZ_OFFSET` CMake option; `z_formatter`; `utc_minutes_offset` stubs; tests; v1 `test_stdout_api` extra case N/A) | -| `b3688ba1` | Set IndentPPDirectives to "None" on clang-format | N/A (formatting / tooling only) | -| `ea3e747e` | Bump fmt to 12.1.0 | SUPERSEDED (same — pin matches `origin/v1.x` bundled `FMT_VERSION` **120100**) | -| `c5061bb9` | Update LICENSE file | N/A (license text may differ; reconcile at release if needed) | -| `878ad2e3` | Supress MSVC C4834 warning triggeed by fmt 12.1.0 | SUPERSEDED (`cmake/fmtlib.cmake` — `/wd4834` on **`fmt`** target; v1 pragma/`bundled_fmtlib_format.cpp` N/A on v2 FetchContent layout) | -| `2c1eafc8` | Backport warning fix from fmt head | SUPERSEDED (same — `/wd4834` until upstream 12.1.x includes `ignore_unused` fix in `base.h`) | -| `3f03542d` | Remove warning 4834 suppression | SUPERSEDED (v1 removed pragma after patching bundled headers; v2 uses compiler flag on `fmt`) | -| `d2100d5d` | Fix: include in tcp_client.h to avoid compilation failures on Unix (#3497) | PORTED | -| `0209b12c` | tests: fix unit tests to not be affected by custom level names (#3492) | PORTED (`tests/includes.h` — `#undef` custom level name macros before spdlog includes) | -| `32dd298d` | Docs: fix misleading comment in blocking_queue header (#3504) | PORTED (`include/spdlog/details/mpmc_blocking_q.h` file header; per-method comments already correct) | -| `09a674b7` | Fix %z when pattern_type_type is utc - should be +00:00 | PORTED | -| `2670f47d` | Fix warning | SUPERSEDED (`z_formatter` in `pattern_formatter.cpp`: `SPDLOG_NO_TZ_OFFSET` vs UTC `+00:00` structure already matches v1 fix) | -| `b656d1ce` | Windows utc_minutes_offset(): Fix historical DST accuracy and improve offset calculation speed (~2.5x) (#3508) | PORTED | -| `79524ddd` | spdlog version 1.17.0 | N/A (v1.x release version bump) | -| `6b240a89` | Replace C-style cast with reinterpret_cast in udp_client (#3509) | PORTED (`udp_client_unix.h` `send` — `reinterpret_cast`, `sizeof(sockAddr_)`) | -| `33375433` | fix: initialize null_atomic_int::value to zero (#3513) | PORTED (`null_mutex.h` — `null_atomic::value{}` value-initializes `T`) | -| `d299603e` | Add missing const qualifiers to reference variables (#3514) | N/A (v1 `registry-inl` + MDC `pattern_formatter`; v2 has no registry/MDC there — dup_filter covered by `1774e700`) | -| `1774e700` | Add const qualifier to get_time_ and filter_ member functions (#3515) | PORTED (`dup_filter_sink::filter_` const + `const` duration; `get_time_` already `const` in v2) | -| `309204d5` | Rename local variables to avoid shadowing member functions (#3516) | PORTED (`logger::should_flush` uses `flush_level()`; `daily_file_sink` `new_filename` locals) | -| `f2a9dec0` | Fix function arguments names different warnings (#3519) | PORTED (`spdlog::should_log(level log_level)`; v1 cfg/async renames N/A on v2) | -| `687226d9` | The upd_sink and dist_sink files have been modified to address Passed by value warnings. (#3520) | PORTED (`udp_sink` takes `const udp_sink_config &`; `dist_sink` ctor already `std::move(sinks)`) | -| `472945ba` | Fix shadow member warning in example file (#3521) | PORTED (`example/example.cpp` `my_type` `value_` / ctor param) | -| `6c5d6329` | Fix should_log comment (#3534) | SUPERSEDED (v2 `logger.h` already has “return true if logging is enabled…”) | -| `566b2d14` | Fix #3525: Make level name matching case-insensitive (#3535) | PORTED | -| `fc7e9c87` | Update common-inl.h | SUPERSEDED (v2 has no `common-inl.h`; `src/common.cpp` includes `` for `level_from_str`) | -| `c49c7cf9` | Allow empty DEBUG_POSTFIX property in CMakeLists (#3530) | PORTED (`DEBUG_POSTFIX "${SPDLOG_DEBUG_POSTFIX}"` — empty cache value allowed) | -| `1685e694` | Fix deprecated copy constructor usage of fmt::format_string (#3541) | SUPERSEDED (v2 `logger::log_with_format_` takes `const format_string_t &` and uses `fmt::vformat_to`; no `details::to_string_view(fmt)` path) | -| `d5af52d9` | Fix format_string propagation (#3543) | SUPERSEDED (v2 `logger`/`spdlog` already forward `format_string_t` to `log_with_format_`) | -| `0f7562a0` | tests: timezone: Provide DST rules when setting TZ on POSIX systems (#3542) | PORTED | -| `1fbc60a5` | docs: fix SPDLOG_LEVEL env example (#3561) | N/A (docs-only) | -| `45b67eee` | Add constructor for dup_filter_sink with sinks parameter (#3549) | PORTED | -| `3c61b051` | [ci] Update actions/checkout to latest major relese (#3575) | PORTED | From 5970380a3cf3f9c4a64d62ae1844663ef30682b2 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sun, 5 Apr 2026 10:33:37 +0200 Subject: [PATCH 33/35] PR comment fixes --- CMakeLists.txt | 6 +++--- cmake/fmtlib.cmake | 7 ++++++- include/spdlog/details/tcp_client_unix.h | 7 ++++--- include/spdlog/details/tcp_client_windows.h | 12 +++++++----- include/spdlog/sinks/dup_filter_sink.h | 19 +++++++++++++++++-- src/details/os_unix.cpp | 2 +- tests/test_dup_filter.cpp | 19 +++++++++++++++++++ 7 files changed, 57 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 534f8b76cf..00bed958e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,8 +52,8 @@ option(SPDLOG_BUILD_SHARED "Build shared library" OFF) option(SPDLOG_BUILD_EXAMPLE "Build example" ${SPDLOG_MASTER_PROJECT}) option(SPDLOG_BUILD_TESTS "Build tests" OFF) option(SPDLOG_BUILD_BENCH "Build benchmarks (Requires https://github.com/google/benchmark.git to be installed)" OFF) -option(SPDLOG_SANITIZE_ADDRESS "Enable address sanitizer in tests" OFF) -option(SPDLOG_SANITIZE_THREAD "Enable thread sanitizer in tests" OFF) +option(SPDLOG_SANITIZE_ADDRESS "Enable address sanitizer for the spdlog library and anything that links it" OFF) +option(SPDLOG_SANITIZE_THREAD "Enable thread sanitizer for the spdlog library and anything that links it" OFF) if (SPDLOG_SANITIZE_ADDRESS AND SPDLOG_SANITIZE_THREAD) message(FATAL_ERROR "SPDLOG_SANITIZE_ADDRESS and SPDLOG_SANITIZE_THREAD are mutually exclusive") endif () @@ -108,7 +108,7 @@ message(STATUS "spdlog fmt external: " ${SPDLOG_FMT_EXTERNAL}) # Find {fmt} library # --------------------------------------------------------------------------------------- if (SPDLOG_FMT_EXTERNAL) - find_package(fmt REQUIRED) + find_package(fmt 12 REQUIRED CONFIG) message(STATUS "Using external fmt lib version: ${fmt_VERSION}") else () include(cmake/fmtlib.cmake) diff --git a/cmake/fmtlib.cmake b/cmake/fmtlib.cmake index 9395739c2b..f663a0aa41 100644 --- a/cmake/fmtlib.cmake +++ b/cmake/fmtlib.cmake @@ -12,7 +12,12 @@ if(NOT fmt_POPULATED) set(FMT_OS OFF CACHE BOOL "Disable FMT_OS" FORCE) # fmt 12+ defaults FMT_INSTALL to OFF when built as a subproject; spdlog's # install(EXPORT) requires fmt to participate in an export set (CMake 3.23+). - set(FMT_INSTALL ON CACHE BOOL "Generate the install target." FORCE) + # Only enable fmt's install rules when spdlog installs + if(SPDLOG_INSTALL) + set(FMT_INSTALL ON CACHE BOOL "Generate the install target." FORCE) + else() + set(FMT_INSTALL OFF CACHE BOOL "Generate the install target." FORCE) + endif() FetchContent_MakeAvailable(fmt) set_target_properties(fmt PROPERTIES FOLDER "third-party") # fmt 12.1.0: MSVC C4834 on locale_ref ctor (discarded [[nodiscard]] from isalpha); fixed on fmt master after 12.1.0. diff --git a/include/spdlog/details/tcp_client_unix.h b/include/spdlog/details/tcp_client_unix.h index 937a20da1c..a3a8f51c53 100644 --- a/include/spdlog/details/tcp_client_unix.h +++ b/include/spdlog/details/tcp_client_unix.h @@ -113,9 +113,10 @@ class tcp_client_unix { hints.ai_flags = AI_NUMERICSERV; // port passed as as numeric value hints.ai_protocol = 0; + const int validated_timeout_ms = timeout_ms > 0 ? timeout_ms : 0; struct timeval tv; - tv.tv_sec = timeout_ms / 1000; - tv.tv_usec = (timeout_ms % 1000) * 1000; + tv.tv_sec = validated_timeout_ms / 1000; + tv.tv_usec = (validated_timeout_ms % 1000) * 1000; auto port_str = std::to_string(port); struct addrinfo *addrinfo_result; @@ -153,7 +154,7 @@ class tcp_client_unix { throw_spdlog_ex("::connect failed", last_errno); } - if (timeout_ms > 0) { + if (validated_timeout_ms > 0) { ::setsockopt(socket_, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)); ::setsockopt(socket_, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv)); } diff --git a/include/spdlog/details/tcp_client_windows.h b/include/spdlog/details/tcp_client_windows.h index 9a8850712e..79a79f5426 100644 --- a/include/spdlog/details/tcp_client_windows.h +++ b/include/spdlog/details/tcp_client_windows.h @@ -96,7 +96,8 @@ class tcp_client_unix { FD_ZERO(&wfds); FD_SET(sockfd, &wfds); - rv = ::select(0, nullptr, &wfds, nullptr, const_cast(&tv)); + timeval tv_copy = tv; + rv = ::select(0, nullptr, &wfds, nullptr, &tv_copy); mode = 0UL; if (::ioctlsocket(sockfd, FIONBIO, &mode) == SOCKET_ERROR) { @@ -138,9 +139,10 @@ class tcp_client_unix { hints.ai_flags = AI_NUMERICSERV; // port passed as as numeric value hints.ai_protocol = 0; + const int validated_timeout_ms = timeout_ms > 0 ? timeout_ms : 0; timeval tv; - tv.tv_sec = timeout_ms / 1000; - tv.tv_usec = (timeout_ms % 1000) * 1000; + tv.tv_sec = validated_timeout_ms / 1000; + tv.tv_usec = (validated_timeout_ms % 1000) * 1000; auto port_str = std::to_string(port); struct addrinfo *addrinfo_result; @@ -169,8 +171,8 @@ class tcp_client_unix { if (socket_ == INVALID_SOCKET) { throw_winsock_error_("connect failed", last_error); } - if (timeout_ms > 0) { - DWORD timeout_dword = static_cast(timeout_ms); + if (validated_timeout_ms > 0) { + DWORD timeout_dword = static_cast(validated_timeout_ms); ::setsockopt(socket_, SOL_SOCKET, SO_RCVTIMEO, (const char *)&timeout_dword, sizeof(timeout_dword)); ::setsockopt(socket_, SOL_SOCKET, SO_SNDTIMEO, (const char *)&timeout_dword, sizeof(timeout_dword)); } diff --git a/include/spdlog/sinks/dup_filter_sink.h b/include/spdlog/sinks/dup_filter_sink.h index c63413010c..70f8ecb121 100644 --- a/include/spdlog/sinks/dup_filter_sink.h +++ b/include/spdlog/sinks/dup_filter_sink.h @@ -45,6 +45,14 @@ class dup_filter_sink final : public dist_sink { explicit dup_filter_sink(std::chrono::duration max_skip_duration) : max_skip_duration_{max_skip_duration} {} + // Optional: force the "Skipped N duplicate..." line to a fixed level. + template + explicit dup_filter_sink(std::chrono::duration max_skip_duration, + level notification_level) + : max_skip_duration_{max_skip_duration}, + use_fixed_notification_summary_level_{true}, + fixed_notification_summary_level_{notification_level} {} + template explicit dup_filter_sink(std::chrono::duration max_skip_duration, std::vector> sinks) @@ -57,12 +65,16 @@ class dup_filter_sink final : public dist_sink { std::string last_msg_payload_; size_t skip_counter_ = 0; level skipped_msg_log_level_{level::off}; + bool use_fixed_notification_summary_level_{false}; + level fixed_notification_summary_level_{level::info}; void sink_it_(const details::log_msg &msg) override { bool filtered = filter_(msg); if (!filtered) { skip_counter_ += 1; - skipped_msg_log_level_ = msg.log_level; + if (!use_fixed_notification_summary_level_) { + skipped_msg_log_level_ = msg.log_level; + } return; } @@ -71,7 +83,10 @@ class dup_filter_sink final : public dist_sink { char buf[64]; auto msg_size = ::snprintf(buf, sizeof(buf), "Skipped %u duplicate messages..", static_cast(skip_counter_)); if (msg_size > 0 && static_cast(msg_size) < sizeof(buf)) { - details::log_msg skipped_msg{msg.source, msg.logger_name, skipped_msg_log_level_, + const level summary_level = use_fixed_notification_summary_level_ + ? fixed_notification_summary_level_ + : skipped_msg_log_level_; + details::log_msg skipped_msg{msg.source, msg.logger_name, summary_level, string_view_t{buf, static_cast(msg_size)}}; dist_sink::sink_it_(skipped_msg); } diff --git a/src/details/os_unix.cpp b/src/details/os_unix.cpp index e1dc1c3aee..db73e0b261 100644 --- a/src/details/os_unix.cpp +++ b/src/details/os_unix.cpp @@ -127,7 +127,7 @@ size_t filesize(FILE *f) { return 0; // will not be reached. } -// Return utc offset in minutes or throw spdlog_ex on failure +// Return utc offset in minutes (0 on failure to compute offset) int utc_minutes_offset(const std::tm &tm) { #if defined(SPDLOG_NO_TZ_OFFSET) (void)tm; diff --git a/tests/test_dup_filter.cpp b/tests/test_dup_filter.cpp index 0a248c3315..172fabc9c4 100644 --- a/tests/test_dup_filter.cpp +++ b/tests/test_dup_filter.cpp @@ -99,3 +99,22 @@ TEST_CASE("dup_filter_skipped_notification_uses_last_duplicate_level", "[dup_fil REQUIRE(test_sink->lines()[1] == "W"); REQUIRE(test_sink->lines()[2] == "I"); } + +TEST_CASE("dup_filter_skipped_notification_fixed_level", "[dup_filter_sink]") { + using spdlog::sinks::dup_filter_sink_st; + using spdlog::sinks::test_sink_mt; + + dup_filter_sink_st dup_sink{std::chrono::seconds{5}, spdlog::level::info}; + auto test_sink = std::make_shared(); + test_sink->set_pattern("%L"); + dup_sink.add_sink(test_sink); + + dup_sink.log(spdlog::details::log_msg{"test", spdlog::level::warn, "same"}); + dup_sink.log(spdlog::details::log_msg{"test", spdlog::level::warn, "same"}); + dup_sink.log(spdlog::details::log_msg{"test", spdlog::level::info, "diff"}); + + REQUIRE(test_sink->lines().size() == 3); + REQUIRE(test_sink->lines()[0] == "W"); + REQUIRE(test_sink->lines()[1] == "I"); + REQUIRE(test_sink->lines()[2] == "I"); +} From 67611ee99328c235836bc7e05fa66ebd05a36a2c Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Sun, 5 Apr 2026 10:40:49 +0200 Subject: [PATCH 34/35] Fix small random issues --- CMakeLists.txt | 2 ++ cmake/spdlogCPack.cmake | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 00bed958e4..1dd1855b5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -122,6 +122,8 @@ find_package(Threads REQUIRED) # --------------------------------------------------------------------------------------- set(SPDLOG_HEADERS "include/spdlog/common.h" + "include/spdlog/file_event_handlers.h" + "include/spdlog/filename_t.h" "include/spdlog/formatter.h" "include/spdlog/fwd.h" "include/spdlog/logger.h" diff --git a/cmake/spdlogCPack.cmake b/cmake/spdlogCPack.cmake index d05ea14b85..f21b840cf5 100644 --- a/cmake/spdlogCPack.cmake +++ b/cmake/spdlogCPack.cmake @@ -22,7 +22,7 @@ set(CPACK_DEBIAN_PACKAGE_SECTION "libs") set(CPACK_RPM_PACKAGE_URL ${CPACK_PROJECT_URL}) set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${CPACK_PROJECT_URL}) set(CPACK_RPM_PACKAGE_DESCRIPTION "Fast C++ logging library.") -set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "FastC++ logging library.") +set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Fast C++ logging library.") if(CPACK_PACKAGE_NAME) set(CPACK_RPM_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}") From ee4ad024eb57cc5fe204ca61245b6ceabc7148f4 Mon Sep 17 00:00:00 2001 From: Jan Moravec Date: Wed, 8 Apr 2026 13:44:33 +0200 Subject: [PATCH 35/35] Fix PR comments - un-remove the comment and allow any fmt library version --- CMakeLists.txt | 2 +- cmake/spdlogConfig.cmake.in | 2 +- include/spdlog/details/tcp_client_windows.h | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1dd1855b5b..c3e81f66b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,7 +108,7 @@ message(STATUS "spdlog fmt external: " ${SPDLOG_FMT_EXTERNAL}) # Find {fmt} library # --------------------------------------------------------------------------------------- if (SPDLOG_FMT_EXTERNAL) - find_package(fmt 12 REQUIRED CONFIG) + find_package(fmt REQUIRED CONFIG) message(STATUS "Using external fmt lib version: ${fmt_VERSION}") else () include(cmake/fmtlib.cmake) diff --git a/cmake/spdlogConfig.cmake.in b/cmake/spdlogConfig.cmake.in index 8e41b2309f..47866bb49f 100644 --- a/cmake/spdlogConfig.cmake.in +++ b/cmake/spdlogConfig.cmake.in @@ -7,7 +7,7 @@ include(CMakeFindDependencyMacro) find_package(Threads REQUIRED) -find_dependency(fmt 12 CONFIG) +find_dependency(fmt CONFIG) set(config_targets_file @config_targets_file@) include("${CMAKE_CURRENT_LIST_DIR}/${config_targets_file}") diff --git a/include/spdlog/details/tcp_client_windows.h b/include/spdlog/details/tcp_client_windows.h index 79a79f5426..135b8c063e 100644 --- a/include/spdlog/details/tcp_client_windows.h +++ b/include/spdlog/details/tcp_client_windows.h @@ -153,6 +153,8 @@ class tcp_client_unix { throw_winsock_error_("getaddrinfo failed", last_error); } + // Try each address until we successfully connect(2). + for (auto *rp = addrinfo_result; rp != nullptr; rp = rp->ai_next) { socket_ = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); if (socket_ == INVALID_SOCKET) {