-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove fmt in favor of std::format, upgrade spdlog to current version #67
Conversation
3e400d5
to
61569fd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all the work here. Good to be on c++20. A lot of nice cleanup here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file contains most formatters for std::format
- These are basically the ones from loghelpers
before. I tried to reduce the amount of copy/paste so most formatters forward to other formatters for the sake of readibility.
There is not formatters for wrapped strings because those were not doing anything more than the standard formatters.
The formatter for USVFS own UnicodeString is in a separate file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most stuff in this file has moved to the formatters.h
file above. The new functions are to avoid bringing ush
into formatters.h
- There are only two overloads because most string-based converters forward to the LPCWSTR
overload.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes here are mostly to change the message formatting when logging parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pure formatting and replacing typedef
with using
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This updates the shm_sink
for spdlog
- I moved the sink to the usvfs
namespace because it took me some times to see that it was not a spdlog
built-in sink.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unused function. Use spdlog built-in null sink. Updates for new spdlog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
u8string -> string
test namespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
u8string -> string
test namespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NtWriteFile takes a char*
, not a const char*
, so C++20 is not happy here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
u8string -> string
Some details:
spdlog
does NOT includespdlog
anymore which is why#include
are nowspdlog/spdlog.h
rather than simplyspdlog.h
.std::ostream& operator<<
operators have been converted specializations ofstd::formatter
- almost everything can be found in theformatters.h
header:PCUNICODE_STRING
.std::format
does not natively support pointers other thanvoid*
andconst void*
.Wrap<NTSTATUS>
andWrap<DWORD>
.Wrap<STR>
(STR
being any kind of string) as this was not doing anything different than the standard formatters. The only use cases forWrap
are nowNTSTATUS
andDWORD
.usvfs::UnicodeString
.fmt::MemoryWriter
usingstd::format_to
.toHex
andSeverityShort
functions were simply removed since these are not used anywhere and annoying to convert.shmsink
.path::u8string()
to simplypath::string()
because in C++20 both are different, and it is very complicated to mix both (and support foru8string
is very poor).