odygrd / quill

Asynchronous Low Latency C++ Logging Library
MIT License
1.49k stars 152 forks source link

JSON logging feature request #391

Closed diehard2 closed 6 months ago

diehard2 commented 8 months ago

I'm looking to write json logs to a logging platform, and this looks really promising. I've figured out how to create the custom handler (I think), but right now I have to generate the json on the hot path.

The biggest issue I'm having is the reliance on fmt for every entrypoint into the logger. Ideally I would like to do

std::map<std::string, std::string> mymap{{"boo", "berry"}}; LOG_CRITICAL(worker_logger, my_json_formatter(), {"foo", "bar"}, mymap, etc);

where I can provide the formatter that gets called on the background thread. Any help would be very appreciated.

diehard2 commented 6 months ago

never mind, I figured out an easier way to do this (fmt printer on a custom class)