Skip to content

Support unbundled version of fmt in spdlog#4

Open
pfmephisto wants to merge 4 commits into
michalber:mainfrom
pfmephisto:main
Open

Support unbundled version of fmt in spdlog#4
pfmephisto wants to merge 4 commits into
michalber:mainfrom
pfmephisto:main

Conversation

@pfmephisto
Copy link
Copy Markdown

This change includes spdlog/fmt/chrono.h instead of spdlog/fmt/bundled/chrono.h, which will include the correct version of fmt depending on if it was bundled with spdlog or not.

Furthermore, the fmt::memory_buffer now seems to need to be used with the fmt::appender and can not be passed directly to format_to.

Lastly, the variable space_for_bar is cast to an int instead of an unsigned int, as otherwise, the following size check would always return true. In cases where the width is not sufficient, it would then try to fill a progress bar with a width close to max unsigned int due to an integer underflow.

@pfmephisto
Copy link
Copy Markdown
Author

The custom logger should also be dropped when LoggerProgress is destroyed, as there will be collisions should multiple LoggerProgress instances be created.

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