![]() |
Panoptes 1.0.0
Endpoint Detection and Response
|
#include <Windows.h>#include <sstream>#include <iostream>#include <mutex>#include "service_constants.h"Go to the source code of this file.
Functions | |
| bool | EnsureDirectoryExists (const std::wstring &path) |
| DWORD | NewestLogFileNumber (const std::wstring &folder, const std::wstring &base, const std::wstring &ext) |
| The number of the newest log file in a folder: 0 for base.ext (or when there is none), N for baseN.ext. Other names, such as base.old.ext or baseX.ext, are ignored. | |
| void | WriteToLogFile (const std::string &message) |
| Appends a line to the event log: LOG_FOLDER\pano.log, continuing in pano1.log, pano2.log, ... once a file reaches MAX_FILE_SIZE. On the first write it continues in the newest file already on disk, so a restart neither appends to a full file nor reuses old ones. | |
| bool EnsureDirectoryExists | ( | const std::wstring & | path | ) |
Definition at line 7 of file pano_log.cpp.
References EnsureDirectoryExists().
Referenced by EnsureDirectoryExists(), and WriteToLogFile().
| DWORD NewestLogFileNumber | ( | const std::wstring & | folder, |
| const std::wstring & | base, | ||
| const std::wstring & | ext ) |
The number of the newest log file in a folder: 0 for base.ext (or when there is none), N for baseN.ext. Other names, such as base.old.ext or baseX.ext, are ignored.
| folder | The folder, ending in a backslash |
| base | The file name before the number, e.g. L"pano" |
| ext | The extension including the dot, e.g. L".log" |
Definition at line 33 of file pano_log.cpp.
Referenced by LogFolder::Newest(), TEST_F(), and WriteToLogFile().
| void WriteToLogFile | ( | const std::string & | message | ) |
Appends a line to the event log: LOG_FOLDER\pano.log, continuing in pano1.log, pano2.log, ... once a file reaches MAX_FILE_SIZE. On the first write it continues in the newest file already on disk, so a restart neither appends to a full file nor reuses old ones.
| message | The line, including its newline |
Definition at line 72 of file pano_log.cpp.
References BASE_FILENAME, EnsureDirectoryExists(), FILE_EXTENSION, LOG_FOLDER, MAX_FILE_SIZE, and NewestLogFileNumber().
Referenced by RecordEvent().