Changed std::cout uses to a log file