FileLogger::FileLogger (const File& file, const String& welcomeMessage, const int64 maxInitialFileSizeBytes) : logFile (file) { if (maxInitialFileSizeBytes >= 0) trimFileSize (maxInitialFileSizeBytes); if (! file.exists()) file.create(); // (to create the parent directories) String welcome; welcome << newLine << "**********************************************************" << newLine << welcomeMessage << newLine << "Log started: " << Time::getCurrentTime().toString (true, true) << newLine; FileLogger::logMessage (welcome); }
FileLogger::FileLogger (const File& logFile_, const String& welcomeMessage, const int maxInitialFileSizeBytes) : logFile (logFile_) { if (maxInitialFileSizeBytes >= 0) trimFileSize (maxInitialFileSizeBytes); if (! logFile_.exists()) { // do this so that the parent directories get created.. logFile_.create(); } String welcome; welcome << newLine << "**********************************************************" << newLine << welcomeMessage << newLine << "Log started: " << Time::getCurrentTime().toString (true, true) << newLine; FileLogger::logMessage (welcome); }