-
Notifications
You must be signed in to change notification settings - Fork 131
-
Hello, Thanks again for the hard work. In https://github.com/odygrd/quill/blob/master/examples/advanced/user_quill_codec.h for the |
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment · 6 replies
-
can you try if this works ? I don't have a separate fmt version installed to try it at the moment template <>
struct fmtquill::formatter<User> : public fmt::formatter<User>
{
}; |
Beta Was this translation helpful? Give feedback.
All reactions
-
This might also work but i haven't tested it. If you have time give it a try namespace fmtquill
{
template <typename T>
using formatter = fmt::formatter<T>;
} |
Beta Was this translation helpful? Give feedback.
All reactions
-
I am using your example
|
Beta Was this translation helpful? Give feedback.
All reactions
-
For me #460 (comment) doesn't work for #include "quill/Backend.h"
#include "quill/Frontend.h"
#include "quill/LogMacros.h"
#include "quill/Logger.h"
#include "quill/sinks/ConsoleSink.h"
#include <string>
#include <utility>
#include <filesystem>
#include <fmt/std.h>
#include <fmt/format.h>
template <>
struct fmtquill::formatter<std::filesystem::path> : public fmt::formatter<std::filesystem::path>
{
};
int main() {
// Start the backend thread
quill::BackendOptions backend_options;
quill::Backend::start(backend_options);
// Frontend
auto console_sink = quill::Frontend::create_or_get_sink<quill::ConsoleSink>("sink_id_1");
quill::Logger *logger = quill::Frontend::create_or_get_logger("root", std::move(console_sink));
// Change the LogLevel to print everything
logger->set_log_level(quill::LogLevel::TraceL3);
std::filesystem::path p = "hello";
LOG_TRACE_L3(logger, "{}", p);
} |
Beta Was this translation helpful? Give feedback.
All reactions
-
For filesystem it is already supported please include the following file without defining any formatter on your side https://github.com/odygrd/quill/blob/master/quill/include/quill/std/FilesystemPath.h If you have any issues let me know You can use any files from the std folder, you just need to manually include them based on your needs |
Beta Was this translation helpful? Give feedback.
All reactions
-
I didn't know that. Thanks! |
Beta Was this translation helpful? Give feedback.
can you try if this works ? I don't have a separate fmt version installed to try it at the moment