API
MagAOX::logger::logMap Struct Reference

Map of log entries by application name, mapping both to files and to loaded buffers. More...

#include <logMap.hpp>

Collaboration diagram for MagAOX::logger::logMap:
Collaboration graph

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, logInMemoryappToBufferMapT
 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
 

Detailed Description

Map of log entries by application name, mapping both to files and to loaded buffers.

Definition at line 43 of file logMap.hpp.

Member Typedef Documentation

◆ appToBufferMapT

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.

◆ appToFileMapT

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.

Member Function Documentation

◆ getNearestLogs()

int MagAOX::logger::logMap::getNearestLogs ( flatlogs::bufferPtrT logBefore,
flatlogs::bufferPtrT logAfter,
const std::string &  appName 
)

◆ getNextLog()

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.

Parameters
[out]logAfterpointer to the first byte of the prior log entry
[in]logCurrentThe log to start from
[in]appNamethe 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().

◆ getPriorLog()

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.

Parameters
[out]logBeforepointer to the first byte of the prior log entry
[in]appNamethe name of the app specifying which log to search
[in]evthe event code to search for
[in]tsthe 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().

◆ loadAppToFileMap()

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.

Parameters
[in]dirthe directory to search for files
[in]extthe extension to search for

Definition at line 117 of file logMap.cpp.

◆ loadFiles()

int MagAOX::logger::logMap::loadFiles ( const std::string &  appName,
const flatlogs::timespecX startTime 
)
Parameters
appNameMagAO-X app name for which to load files

Definition at line 300 of file logMap.cpp.

Member Data Documentation

◆ m_appToBufferMap

appToBufferMapT MagAOX::logger::logMap::m_appToBufferMap

Definition at line 53 of file logMap.hpp.

◆ m_appToFileMap

appToFileMapT MagAOX::logger::logMap::m_appToFileMap

Definition at line 51 of file logMap.hpp.


The documentation for this struct was generated from the following files: