为了提高我们的日志记录,我刚刚找到了spdlog。我们的日志记录是非常基本的,所以我只是复制“多接收器”示例几乎逐字记录到文件和控制台。
然而,即使是在完全遵循这个示例时,我也得到:
错误d:\tfs\development\bladed\main\external\spdlog\spdlog-1.x\include\spdlog\fmt\bundled\core.h C2338不知道如何格式化该类型,如果它提供了一个应该使用的operator<<,则包括fmt/oStree.h
来自核心。h:
// A formatter for objects of type T.
template <typename T, typename Char = char, typename Enable = void>
struct formatter {
static_assert(no_formatter_error<T>::value,
"don't know how to format the type, include fmt/ostream.h if it provides "
"an operator<< that should be used");
我以为这真的很容易解决,但我看不见.
基本Win32使用
发布于 2018-11-22 14:54:34
有了@PaulMcKenzie指出了正确的方向,我似乎试图记录spdlog默认无法处理的字符串类型(std::wstring)。
Visual的Intellisense似乎被模板搞糊涂了,它似乎对我发送的spdlog::warn a std::wstring感到满意。
解决方案:要么只使用std::string,要么如果您想使用wstring,您(可能)需要为它们定义一个custome格式化程序。
https://stackoverflow.com/questions/53432887
复制相似问题