mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2026-01-31 23:00:53 +03:00
Rolling Update 2020-11-21
This commit is contained in:
@@ -75,6 +75,21 @@ void ClassLogFile::WriteToFile(std::string info, bool _time)
|
||||
WriteToDedicatedFile(logpath, info, _time);
|
||||
}
|
||||
|
||||
std::string ClassLogFile::GetCurrentFileName()
|
||||
{
|
||||
time_t rawtime;
|
||||
struct tm* timeinfo;
|
||||
char buffer[30];
|
||||
|
||||
time(&rawtime);
|
||||
timeinfo = localtime(&rawtime);
|
||||
|
||||
strftime(buffer, 30, logfile.c_str(), timeinfo);
|
||||
std::string logpath = logroot + "/" + buffer;
|
||||
|
||||
return logpath;
|
||||
}
|
||||
|
||||
void ClassLogFile::RemoveOld()
|
||||
{
|
||||
if (retentionInDays == 0) {
|
||||
|
||||
@@ -18,6 +18,8 @@ public:
|
||||
void WriteToFile(std::string info, bool _time = true);
|
||||
void WriteToDedicatedFile(std::string _fn, std::string info, bool _time = true);
|
||||
void RemoveOld();
|
||||
|
||||
std::string GetCurrentFileName();
|
||||
};
|
||||
|
||||
extern ClassLogFile LogFile;
|
||||
Reference in New Issue
Block a user