mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 16:34:13 +00:00
close previous file first upon repon
This commit is contained in:
parent
09a80ed654
commit
5a2c4919c6
7
Log.cpp
7
Log.cpp
@ -130,10 +130,13 @@ namespace log {
|
|||||||
Process();
|
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 flags = std::ofstream::out | std::ofstream::app;
|
||||||
auto os = std::make_shared<std::ofstream> (path, flags);
|
auto os = std::make_shared<std::ofstream> (path, flags);
|
||||||
if (os->is_open ()) {
|
if (os->is_open ())
|
||||||
|
{
|
||||||
m_Logfile = path;
|
m_Logfile = path;
|
||||||
m_Destination = eLogFile;
|
m_Destination = eLogFile;
|
||||||
m_LogStream = os;
|
m_LogStream = os;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user