Skip to content

docs: why logforge exists next to spdlog, and where the boundary is - #1

Merged
leiddev merged 3 commits into
masterfrom
docs/spdlog-boundary
Nov 10, 2026
Merged

leiddev merged 3 commits into
masterfrom
docs/spdlog-boundary

Conversation

@leiddev

@leiddev leiddev commented Nov 10, 2026

Copy link
Copy Markdown
Owner

The README explained what the library does but not why it exists next to spdlog. This PR answers the four questions a reader arrives with, and corrects the comments and one example that had outlived their milestone. Documentation only: no API, behaviour or build change. Version 1.4.1.

What the README now says

  • Why not spdlog directly -- what you get against what you give up, and when to keep spdlog as it is.
  • Where spdlog is allowed to appear -- headers, CMake targets, process state and package config, layer by layer. This one documents a fact nobody had written down: a package built with the backend runs find_dependency(spdlog) even for a core-only consumer.
  • What the spdlog backend uses -- the API surface, and what it leaves alone, so "write another backend" becomes an estimate.
  • Replacing the backend -- the checklist, the behaviour to reproduce, and the part a swap does not fix: dependencies that log through spdlog's global logger.

Other changes

  • First README bullet named log(level, text, size), which is not the interface, and said the core "includes nothing".
  • docs/LOGGING.md: the backend contract gains two rules a backend author could break in silence -- log() runs concurrently, enabled() must agree with log().
  • spdlog_backend.hpp no longer promises a public surface without an spdlog type; it says what the forward declaration buys.
  • examples/backend_configuration.cpp uses install_as_default().
  • Two CMakeLists.txt comments from milestones 0.4 and 1.0 removed.
  • CHANGELOG and release-notes/v1.4.1.md.

Verification

  • MSVC 19.44 (VS 2022), Windows 10: Debug and Release, 11/11 tests each.
  • GCC 9.3.0 (Kylin V10), CMake 3.16.3: Debug, Release and -DLOGFORGE_WERROR=ON, 11/11 tests each.
  • CI runs the rest: clang, ASan+UBSan, and the installed-package consumer.

Deferred to a separate change, noted in the project's stash: making a package built with the backend usable from a consumer that has no spdlog installed.

🤖 Generated with BaoCode

leiddev and others added 3 commits November 10, 2026 15:38
The README described what the library does but never answered the question a
reader arrives with: why not call spdlog directly. The answer was spread over a
bullet list, the target table and comments in a header.

- README: "Why not spdlog directly" puts what you get against what you give
  up, and says when spdlog is the better choice. "Where spdlog is allowed to
  appear" splits the boundary into headers, CMake targets, process state and
  package config -- including the one that was not documented at all: a package
  built with the backend runs find_dependency(spdlog) even for a core-only
  consumer. "What the spdlog backend uses" lists the API surface, and what it
  does not use, so a replacement backend is a known amount of work. "Replacing
  the backend" is the checklist, plus the part a swap does not fix: libraries
  that log through spdlog's global logger.
- The first bullet named log(level, text, size), which is not the interface,
  and "includes nothing", which read as "no standard headers". Both now say
  what the code says. The Status line moves to 1.4.1.
- LOGGING.md: the backend contract gains the two rules a backend author can
  otherwise violate silently -- log() is called concurrently, and enabled()
  must agree with what log() writes. The install_as_default() paragraph says
  why the destructor clears logforge's default but not spdlog's, and
  Config::level says the two level filters are set to the same value.

Co-Authored-By: BaoCode <noreply@baocode.dev>
…milestone

Four places still described a version of this library that no longer exists.

- spdlog_backend.hpp promised a public surface free of a specific spdlog
  version, and the two native* functions name spdlog::logger in their
  signatures. The comment now says what the forward declaration actually buys:
  no spdlog or fmt header in a consumer's translation unit, and no version in
  the ABI.
- backend_configuration.cpp installed its backend with set_default() and
  cleared it by hand, which is what install_as_default() and the destructor
  have done since 1.4.0. The example now shows the recommended path.
- CMakeLists.txt still announced the backend as "added in a later milestone",
  and told readers the backend joins the export in one.

Co-Authored-By: BaoCode <noreply@baocode.dev>
Documentation only: no API, behaviour or build change. The README now answers
why the library exists next to spdlog and where the boundary is, the backend
contract states the two rules a backend author could break in silence, and the
comments and example that still described earlier milestones are corrected.

Co-Authored-By: BaoCode <noreply@baocode.dev>
@leiddev
leiddev merged commit 2b3b9a3 into master Nov 10, 2026
10 checks passed
@leiddev
leiddev deleted the docs/spdlog-boundary branch November 10, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant