Commit ff6e74ba authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Create log file before the first write and not only with HPP_DEBUG

parent 1c7fbb38
......@@ -204,11 +204,7 @@ namespace hpp
JournalOutput::JournalOutput (std::string filename)
: filename (filename),
lastFunction (),
#ifdef HPP_DEBUG
stream (makeLogFile (*this).c_str ())
#else
stream ()
#endif
{}
JournalOutput::~JournalOutput ()
......@@ -235,6 +231,8 @@ namespace hpp
char const* function,
const std::string& data)
{
if (!stream.is_open ()) stream.open (makeLogFile (*this).c_str ());
if (lastFunction != function)
{
if (!lastFunction.empty ())
......@@ -259,6 +257,7 @@ namespace hpp
char const* function,
const std::stringstream& data)
{
if (!stream.is_open ()) stream.open (makeLogFile (*this).c_str ());
if (lastFunction != function)
{
if (!lastFunction.empty ())
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment