Skip to content

Conversation

@etremel
Copy link
Contributor

@etremel etremel commented Feb 6, 2025

The latest version of spdlog (1.15) depends on a newer version of fmt (11.1) that no longer has a default format behavior for enum types. To maintain compatibility with spdlog 1.15, all enum types must have a formatter specialization, or logger calls with enum values must wrap the enum values in fmt::underlying() to re-enable the old behavior of printing the integer value of the enum.

This change is backward-compatible with spdlog 1.12, so there's no need to increase our minimum required version.

The latest version of spdlog (1.15) bundles a newer version of fmtlib,
which removes its default formatting behavior for enum types. Enum
values must now either have a formatter specialization declared or be
wrapped in a call to fmt::underlying() to print them as integers. (The
previous behavior was to automatically print enum values as integers).
This enum will need a formatter overload if we ever want to print out
its value in a logging statement. The main Cascade branch doesn't
currently do that, but the cascade_chain branch does (to debug member
selection policies in the SignatureStore subgroup), so I know it will be
needed. It seems better to fix it in the main branch and then inherit
the changes in cascade_chain than to fix it in cascade_chain and later
backport the changes to the main branch.
This is unrelated to the logger changes in this branch, but it needs to
be fixed to get the "build check" to pass on GitHub. GitHub recently
updated their build servers to a later version of Ubuntu, which does not
have a "python3.10" package - it has one named "python3.12" instead. The
better way to ensure the latest python is installed in these build
scripts is to install the "python3" package, which always points to the
current Python 3 package in Ubuntu.
Apparently, GitHub's Ubuntu image used to include this package by
default, but now it doesn't so we need to install it from apt. Again,
this is unrelated to my spdlog changes, but needs to be committed to
test if the changes will build on GitHub.
@etremel etremel merged commit b6879c9 into master Apr 1, 2025
1 check passed
@etremel etremel deleted the spdlog_15_update branch April 22, 2025 14:09
timLouie01 pushed a commit to timLouie01/cascade that referenced this pull request Jun 8, 2025
…update

Update log usage to be compatible with spdlog 1.15

(Didn't notice earlier that "approved" wasn't the same as "merged")
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.

3 participants