Simple log function in C++