API

An application to dump MagAo-X binary logs to the terminal. More...

#include <logdump.hpp>

Inheritance diagram for logdump:
Inheritance graph
Collaboration diagram for logdump:
Collaboration graph

Public Member Functions

virtual void setupConfig ()
 
virtual void loadConfig ()
 
virtual int execute ()
 
virtual int gettimes (std::vector< std::string > &logs)
 

Protected Member Functions

void printLogBuff (const logPrioT &lvl, const eventCodeT &ec, const msgLenT &len, bufferPtrT &logBuff)
 
void printLogJson (const msgLenT &len, bufferPtrT &logBuff)
 

Protected Attributes

std::string m_dir
 
std::string m_ext
 
std::string m_file
 
bool m_time {false}
 
bool m_jsonMode {false}
 
unsigned long m_pauseTime {250}
 
int m_fileCheckInterval {20}
 When following, pause time to check for new data. msec. Default is 250 msec. More...
 
std::vector< std::string > m_prefixes
 When following, number of loops to wait before checking for a new file. Default is 4. More...
 
size_t m_nfiles {0}
 
bool m_follow {false}
 Number of files to dump. Default is 0, unless following then the default is 1. More...
 
logPrioT m_level {logPrio::LOG_DEFAULT}
 
std::vector< eventCodeTm_codes
 

Detailed Description

An application to dump MagAo-X binary logs to the terminal.

Todo:

document this

add config for colors, both on/off and options to change.

Definition at line 39 of file logdump.hpp.

Member Function Documentation

◆ execute()

int logdump::execute ( void  )
virtual
Todo:
if follow is set, then should nfiles default to 1 unless explicitly set?
Todo:
check for errors on all reads . . .
Todo:
what do we do if nrd not equal to expected size?

Definition at line 160 of file logdump.hpp.

◆ gettimes()

int logdump::gettimes ( std::vector< std::string > &  logs)
virtual
Todo:
check for errors on all reads . . .

Definition at line 425 of file logdump.hpp.

◆ loadConfig()

void logdump::loadConfig ( )
virtual
Todo:
need to check for lack of "." and error or fix

Definition at line 101 of file logdump.hpp.

◆ printLogBuff()

void logdump::printLogBuff ( const logPrioT lvl,
const eventCodeT ec,
const msgLenT len,
bufferPtrT logBuff 
)
inlineprotected

Definition at line 352 of file logdump.hpp.

◆ printLogJson()

void logdump::printLogJson ( const msgLenT len,
bufferPtrT logBuff 
)
inlineprotected

Definition at line 414 of file logdump.hpp.

◆ setupConfig()

void logdump::setupConfig ( )
virtual

Definition at line 83 of file logdump.hpp.

Member Data Documentation

◆ m_codes

std::vector<eventCodeT> logdump::m_codes
protected

Definition at line 61 of file logdump.hpp.

◆ m_dir

std::string logdump::m_dir
protected

Definition at line 43 of file logdump.hpp.

◆ m_ext

std::string logdump::m_ext
protected

Definition at line 44 of file logdump.hpp.

◆ m_file

std::string logdump::m_file
protected

Definition at line 45 of file logdump.hpp.

◆ m_fileCheckInterval

int logdump::m_fileCheckInterval {20}
protected

When following, pause time to check for new data. msec. Default is 250 msec.

Definition at line 51 of file logdump.hpp.

◆ m_follow

bool logdump::m_follow {false}
protected

Number of files to dump. Default is 0, unless following then the default is 1.

Definition at line 57 of file logdump.hpp.

◆ m_jsonMode

bool logdump::m_jsonMode {false}
protected

Definition at line 48 of file logdump.hpp.

◆ m_level

logPrioT logdump::m_level {logPrio::LOG_DEFAULT}
protected

Definition at line 59 of file logdump.hpp.

◆ m_nfiles

size_t logdump::m_nfiles {0}
protected

Definition at line 55 of file logdump.hpp.

◆ m_pauseTime

unsigned long logdump::m_pauseTime {250}
protected

Definition at line 50 of file logdump.hpp.

◆ m_prefixes

std::vector<std::string> logdump::m_prefixes
protected

When following, number of loops to wait before checking for a new file. Default is 4.

Definition at line 53 of file logdump.hpp.

◆ m_time

bool logdump::m_time {false}
protected

Definition at line 47 of file logdump.hpp.


The documentation for this class was generated from the following file: