Commit 62695cb7 authored by Vitaly Lipatov's avatar Vitaly Lipatov

DebugStream: use std::string for logFile

parent b9172d42
...@@ -112,7 +112,7 @@ public: ...@@ -112,7 +112,7 @@ public:
} }
/// Sets the debugstreams' logfile to f. /// Sets the debugstreams' logfile to f.
void logFile(char const * f); void logFile(const std::string f);
inline std::string getLogFile(){ return fname; } inline std::string getLogFile(){ return fname; }
......
...@@ -220,7 +220,7 @@ const DebugStream& DebugStream::operator=( const DebugStream& r ) ...@@ -220,7 +220,7 @@ const DebugStream& DebugStream::operator=( const DebugStream& r )
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/// Sets the debugstreams' logfile to f. /// Sets the debugstreams' logfile to f.
void DebugStream::logFile(char const * f) void DebugStream::logFile(const std::string f)
{ {
fname = f; fname = f;
if (internal) { if (internal) {
...@@ -228,7 +228,7 @@ void DebugStream::logFile(char const * f) ...@@ -228,7 +228,7 @@ void DebugStream::logFile(char const * f)
} else { } else {
internal = new debugstream_internal; internal = new debugstream_internal;
} }
internal->fbuf.open(f, ios::out|ios::app); internal->fbuf.open(f.c_str(), ios::out|ios::app);
delete rdbuf(new teebuf(cerr.rdbuf(), delete rdbuf(new teebuf(cerr.rdbuf(),
&internal->fbuf)); &internal->fbuf));
} }
......
Markdown is supported
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