When writing a high performance C++ program, sometimes it become crucial to log what is happening while program execution is in progress. There are several logging libraries like glog (from Google) and log(from Boost), but using those for a simple program can be counter productive as it unneccesarily increases the executable size and takes more time to setup.
I use the below 5 lines code snippet to log in C++ program. Variadic templates are being used to create such a minimilistic logging system.
template <typename T>
void log_it(T t) {
cout << t << endl;