What would the ideal logging library look like?
When designing software, it’s good to remember that you don’t have to design something completely new if common solutions already meet your needs exactly. A new design that’s different just for the sake of being different is just going to confuse people. A new design that’s different because the existing designs don’t quite work and the differences solve a real need is good. So before we begin dreaming up new logging designs, let’s first look at common ideas and see if we really need something new.
To be completely thorough, we should also try to use what C++ already provides. Maybe that is enough and we don’t need a library. Let’s say we have the following code that tries to calculate the result of starting with 1 and doubling the value three times. The correct answer should be 8, but this code has a bug:
#include <iostream>
int main ()
{
int...