Map of log entries by application name, mapping both to files and to loaded buffers. More...
#include <logMap.hpp>
Public Types | |
typedef std::map< std::string, std::set< logFileName, compLogFileName > > | appToFileMapT |
The app-name to file-name map type, for sorting the input files by application. More... | |
typedef std::map< std::string, logInMemory > | appToBufferMapT |
The app-name to buffer map type, for looking up the currently loaded logs for a given app. More... | |
Public Member Functions | |
int | loadAppToFileMap (const std::string &dir, const std::string &ext) |
Get log file names in a directory and distribute them into the map by app-name. More... | |
int | getPriorLog (char *&logBefore, const std::string &appName, const flatlogs::eventCodeT &ev, const flatlogs::timespecX &ts, char *hint=0) |
Get the log for an event code which is the first prior to the supplied time. More... | |
int | getNextLog (char *&logAfter, char *logCurrent, const std::string &appName) |
Get the next log with the same event code which is after the supplied time. More... | |
int | getNearestLogs (flatlogs::bufferPtrT &logBefore, flatlogs::bufferPtrT &logAfter, const std::string &appName) |
int | loadFiles (const std::string &appName, const flatlogs::timespecX &startTime) |
Public Attributes | |
appToFileMapT | m_appToFileMap |
appToBufferMapT | m_appToBufferMap |
Map of log entries by application name, mapping both to files and to loaded buffers.
Definition at line 43 of file logMap.hpp.
typedef std::map< std::string, logInMemory> MagAOX::logger::logMap::appToBufferMapT |
The app-name to buffer map type, for looking up the currently loaded logs for a given app.
Definition at line 49 of file logMap.hpp.
typedef std::map< std::string, std::set<logFileName, compLogFileName> > MagAOX::logger::logMap::appToFileMapT |
The app-name to file-name map type, for sorting the input files by application.
Definition at line 46 of file logMap.hpp.
int MagAOX::logger::logMap::getNearestLogs | ( | flatlogs::bufferPtrT & | logBefore, |
flatlogs::bufferPtrT & | logAfter, | ||
const std::string & | appName | ||
) |
int MagAOX::logger::logMap::getNextLog | ( | char *& | logAfter, |
char * | logCurrent, | ||
const std::string & | appName | ||
) |
Get the next log with the same event code which is after the supplied time.
[out] | logAfter | pointer to the first byte of the prior log entry |
[in] | logCurrent | The log to start from |
[in] | appName | the name of the app specifying which log to search |
Definition at line 252 of file logMap.cpp.
Referenced by MagAOX::logger::getLogContVal(), and MagAOX::logger::getLogStateVal().
int MagAOX::logger::logMap::getPriorLog | ( | char *& | logBefore, |
const std::string & | appName, | ||
const flatlogs::eventCodeT & | ev, | ||
const flatlogs::timespecX & | ts, | ||
char * | hint = 0 |
||
) |
Get the log for an event code which is the first prior to the supplied time.
[out] | logBefore | pointer to the first byte of the prior log entry |
[in] | appName | the name of the app specifying which log to search |
[in] | ev | the event code to search for |
[in] | ts | the timestamp to be prior to |
[in] | hint | [optional] a hint specifying where to start searching. If null search starts at beginning. |
Definition at line 135 of file logMap.cpp.
Referenced by MagAOX::logger::getLogContVal(), and MagAOX::logger::getLogStateVal().
int MagAOX::logger::logMap::loadAppToFileMap | ( | const std::string & | dir, |
const std::string & | ext | ||
) |
Get log file names in a directory and distribute them into the map by app-name.
[in] | dir | the directory to search for files |
[in] | ext | the extension to search for |
Definition at line 117 of file logMap.cpp.
int MagAOX::logger::logMap::loadFiles | ( | const std::string & | appName, |
const flatlogs::timespecX & | startTime | ||
) |
appName | MagAO-X app name for which to load files |
Definition at line 300 of file logMap.cpp.
appToBufferMapT MagAOX::logger::logMap::m_appToBufferMap |
Definition at line 53 of file logMap.hpp.
appToFileMapT MagAOX::logger::logMap::m_appToFileMap |
Definition at line 51 of file logMap.hpp.