Browse Source

close previous file first upon repon

pull/509/merge
orignal 8 years ago
parent
commit
5a2c4919c6
  1. 7
      Log.cpp

7
Log.cpp

@ -130,10 +130,13 @@ namespace log { @@ -130,10 +130,13 @@ namespace log {
Process();
}
void Log::SendTo (const std::string& path) {
void Log::SendTo (const std::string& path)
{
if (m_LogStream) m_LogStream = nullptr; // close previous
auto flags = std::ofstream::out | std::ofstream::app;
auto os = std::make_shared<std::ofstream> (path, flags);
if (os->is_open ()) {
if (os->is_open ())
{
m_Logfile = path;
m_Destination = eLogFile;
m_LogStream = os;

Loading…
Cancel
Save