- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
class Log
{
ReverseStruct<std::list<std::string> > _logList;
semafor semafor;
Log()
{
std::list<std::string> right , left;
std::shared_ptr<std::list<std::string> > ptrRight=std::shared_ptr<std::list<std::string> >(*right);
std::shared_ptr<std::list<std::string> > ptrLeft=std::shared_ptr<std::list<std::string> >(*left);
_logList=TReverseStruct<std::list<std::string> >(ptrRight,ptrLeft);
}
void writeMessage(std::string message, Level level ){_logList.getWriteStorage.push_back( currentTime+level+messge); semafor.signal();}
void body()
{
try
{
semafor.wait();
_logList.revers();
for (std::list<std::string>::iterator i =_logList.getReadStorage->begin(); i != _logList.getReadStorage->end(); ++i)
{
fixedBufferString<7000, '\0'> stringLog;
stringLog.append(*i);
FileDevice flashInternal(FLASHINTERNAL);
const DriveErrors::E WriteResult = flashInternal.writeFile("log.iso", (byte*)stringLog.content(), stringLog.length());
}
}
catch()
{}
}
}