12 #ifndef flatlogs_logStdFormat_hpp
13 #define flatlogs_logStdFormat_hpp
15 #include "flatbuffers/flatbuffers.h"
16 #include "flatbuffers/minireflect.h"
29 template<
typename logT,
typename iosT>
32 const std::string & eventCodeName,
33 const uint8_t * binarySchema,
34 const unsigned int binarySchemaLength
47 ios <<
"\"ec\": \"" << eventCodeName <<
"\", ";
59 template<
typename logT,
typename iosT>
81 template<
typename logT,
typename iosT>
83 const std::string & appName,
96 if(appName.size() > 15)
98 outApp.resize(17,
' ');
100 for(
int n=15; n >= 0; --n)
102 if( 15-n + 1 > appName.size())
break;
103 outApp[n] = appName[appName.size()-1 - (15-n)];
110 outApp += std::string( 15-appName.size(),
' ');
124 template<
typename logT,
typename iosT>
uint16_t eventCodeT
The type of an event code (16-bit unsigned int).
msgLen2T msgLenT
The type used to refer to the message length, regardless of length.
int8_t logPrioT
The type of the log priority code.
std::string priorityString(logPrioT &prio)
Get the string representation of a log priority.
static void * messageBuffer(bufferPtrT &logBuffer)
Get the message buffer address.
std::shared_ptr< char > bufferPtrT
The log entry buffer smart pointer.
static int extractBasicLog(logPrioT &lvl, eventCodeT &ec, timespecX &ts, msgLenT &len, bufferPtrT &logBuffer)
Extract the basic details of a log entry.
The MagAO-X logger log priority levels.
A fixed-width timespec structure.
std::string secondStrX()
Get a date-time string with just the second for timespecX.
std::string ISO8601DateTimeStrX()
Get a date-time string in ISO 8601 format for timespecX.