4 * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson.
15 DebugLog::DebugLog(std::string _logFileName)
16 : logFileName(_logFileName),
24 logFile = new std::ofstream();
25 logFile->open(logFileName.c_str(), ios::out);
27 if(logFile->is_open())
29 std::cout << "Logging debug info to file: " << logFileName << std::endl;
33 std::cerr << "Could not open log file.\n";
44 void DebugLog::logMsg(std::string msg)
46 if(logFile->is_open())
48 (*logFile) << msg << "\n";
52 void DebugLog::logScore(float x)
67 void DebugLog::printScoreInfo()
71 averageScore = sumSoFar / static_cast<float>(numScores);
73 outs << "SCORE INFO--------------------------------------------------->"
74 << " The score was calculated " << numScores << " times. The average = "
75 << averageScore << "\n" << "The max score=" << maxScore << " The min score="