10 #ifndef logger_types_observer_hpp
11 #define logger_types_observer_hpp
13 #include "generated/observer_generated.h"
42 const std::string & pfoa,
43 const std::string & email,
44 const std::string & institution
47 auto _fullName =
builder.CreateString(fullName);
48 auto _pfoa =
builder.CreateString(pfoa);
49 auto _email =
builder.CreateString(email);
50 auto _institution =
builder.CreateString(institution);
52 auto fp = CreateObserver_fb(
builder, _fullName, _pfoa, _email, _institution);
63 return VerifyObserver_fbBuffer(verifier);
71 static_cast<void>(len);
73 auto fbs = GetObserver_fb(msgBuffer);
75 std::string
msg =
"Observer Loaded: ";
79 msg += fbs->fullName()->c_str();
80 if(!fbs->pfoa())
msg +=
", ";
87 msg += fbs->pfoa()->c_str();
93 msg += fbs->email()->c_str();
94 if(fbs->institution())
msg +=
", ";
98 if(fbs->institution())
100 msg += fbs->institution()->c_str();
The MagAO-X logger flatbuffer log base type.
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.
static void * messageBuffer(bufferPtrT &logBuffer)
Get the message buffer address.
std::shared_ptr< char > bufferPtrT
The log entry buffer smart pointer.
constexpr static logPrioT LOG_INFO
Informational. The info log level is the lowest level recorded during normal operations.
Message type for resolving log messages with a f.b. builder.
flatbuffers::FlatBufferBuilder builder
Base class for logs consisting of a flatbuffer message.
The type of the input message.
messageT(const std::string &fullName, const std::string &pfoa, const std::string &email, const std::string &institution)
Construct from components.
Log entry recording the observer.
static timespec lastRecord
The time of the last time this log was recorded. Used by the telemetry system.
static bool verify(flatlogs::bufferPtrT &logBuff, flatlogs::msgLenT len)
static const flatlogs::logPrioT defaultLevel
The default level.
static const flatlogs::eventCodeT eventCode
The event code.
static std::string msgString(void *msgBuffer, flatlogs::msgLenT len)
Get the message formatte for human consumption.