I want to create an app in c++ that leverages a great logging library such as spdlog.
I do not want the app to automatically create daily logs or overwrite log files. This creates gunk files that I always have to delete afterwards. I do, however, use a simple SQLite local db file (for more purposes than just logging) which I would like to store log messages to be retrieved if desired (arguments provided to print them or output to a text file or simply DB Browser).
So far, it looks like the concept of ringbuffer_sink_mt does this by storing in memory. However, it looks like it requires a limit on log messages.
If my application is an extensive run with every detailed log messages, I do not want to only read the last x number of messages due to the ringbuffer limit.
Example: ringbuffer_sink is created with size 10. Then 200 log messages were written. I lose 190 log messages that were perhaps necessary to read in order to debug (both the application programming in event of an error and what my application did).
Is there a a method to due this that is built into spdlog library?
The only workaround I can think of is creating log text files then post-processing those text files. This would work but seems a bit redundant (it accesses fileIO multiple times, to write text file, to read text file, then to INSERT to sqlite3 db where I ultimately truly desire to have it; perhaps delete text file as well).
I can see how a super long ringbuffer_sink is taxing on memory (vs just piping/appending messages to a text file), but if my application needs it, I would like to make that determination and see how I can break it up as I develop it.
Create daily_sink and create limited ringbuffer_sink_mt.