46 mInitTime(time(nullptr)),
73void LogFile::Set(
unsigned level,
const std::string& rDirectory,
const std::string& rFileName)
78 <<
" should have been less than or equal to "
113 *
this <<
"\nChaste: " << simulationType <<
" simulation, on " << ctime(&
mInitTime) <<
"\n";
118 double fsecs = difftime(time(
nullptr),
mInitTime);
119 long total_secs =
static_cast<long>(floor(fsecs+0.5));
120 int total_mins = total_secs/60;
122 int secs = total_secs%60;
123 int mins = total_mins%60;
124 int hrs = total_mins/60;
126 *
this << pre <<
"Elapsed time is: " << hrs <<
"h " << mins <<
"m " << secs <<
"s\n";
136 assert(precision > 0);
#define EXCEPTION(message)
void SetPrecision(unsigned precision)
static LogFile * mpInstance
void Set(unsigned level, const std::string &rDirectory, const std::string &rFileName="log.txt")
static LogFile * Instance()
void WriteElapsedTime(std::string pre="")
void WriteHeader(std::string simulationType="")
static const unsigned mMaxLoggingLevel
static unsigned MaxLoggingLevel()
out_stream OpenOutputFile(const std::string &rFileName, std::ios_base::openmode mode=std::ios::out|std::ios::trunc) const