I have to log down what my application does into a json file. Is expected that the application goes on for weeks and so I want to write the json file incrementally.
For the moment I'm writing the json manually, but there is some log-reader application that is using Jsoncpp lib and should be nice to write the log down with Jsoncpp lib too.
But in the manual and in some examples I haven't found anything similar.. It is always something like:
Json::Value root;
// fill the json
ofstream mFile;
mFile.open(filename.c_str(), ios::trunc);
mFile << json_string;
mFile.close();
That is not what I want because it unnecessary fills the memory. I want to do it incrementally.. Some advice?