Changed static logger to be initalized and closed explicitly, destructor did not quite do the trick

This commit is contained in:
Kristian Flikka 2013-04-04 15:09:38 +02:00
parent 0d5ce81809
commit e6d9007dfb
3 changed files with 7 additions and 2 deletions

View File

@ -67,7 +67,11 @@ namespace Opm {
m_logStream.open(m_logFile.c_str(), std::ios::app);
}
Logger::~Logger() {
void Logger::closeLogger() {
m_logStream.close();
}
Logger::~Logger() {
}
} // namespace Opm

View File

@ -32,6 +32,7 @@ namespace Opm {
static const int ERROR;
static void initLogger();
static void closeLogger();
static void setLogLevel(int logLevel);
static void setPath(const std::string& path);
static void debug(const std::string& message);

View File

@ -27,11 +27,11 @@ namespace Opm {
RawDeckPtr Parser::parse(const std::string &path) {
Logger::initLogger();
Logger::setLogLevel(Logger::DEBUG);
Logger::info("Starting parsing of file: " + path);
RawDeckPtr rawDeck(new RawDeck(RawParserKWsConstPtr(new RawParserKWs())));
rawDeck->readDataIntoDeck(path);
Logger::info("Done parsing of file: " + path);
Logger::closeLogger();
return rawDeck;
}