|
|
|
@ -105,34 +105,35 @@ void FileLog::save_log(PT::WTextStream * buffer)
|
|
|
|
|
if( buffer->empty() )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
synchro_lock();
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
if( synchro_lock() )
|
|
|
|
|
{
|
|
|
|
|
if( log_stdout )
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
PT::WideToUTF8(*buffer, std::cout);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( !log_file.empty() )
|
|
|
|
|
{
|
|
|
|
|
if( !log_file_open || !file )
|
|
|
|
|
if( log_stdout )
|
|
|
|
|
{
|
|
|
|
|
file.close();
|
|
|
|
|
file.clear();
|
|
|
|
|
|
|
|
|
|
open_file();
|
|
|
|
|
PT::WideToUTF8(*buffer, std::cout);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( file )
|
|
|
|
|
if( !log_file.empty() )
|
|
|
|
|
{
|
|
|
|
|
PT::WideToUTF8(*buffer, file);
|
|
|
|
|
file.flush();
|
|
|
|
|
if( !log_file_open || !file )
|
|
|
|
|
{
|
|
|
|
|
file.close();
|
|
|
|
|
file.clear();
|
|
|
|
|
|
|
|
|
|
open_file();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( file )
|
|
|
|
|
{
|
|
|
|
|
PT::WideToUTF8(*buffer, file);
|
|
|
|
|
file.flush();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch(...)
|
|
|
|
|
{
|
|
|
|
|
catch(...)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
synchro_unlock();
|
|
|
|
|