10#ifndef logger_types_observer_hpp
11#define logger_types_observer_hpp
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);
71 static_cast<void>(len);
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();
113 static_cast<void>(member);
115 std::cerr <<
"meta data doesn't make sense for state_change.\n";
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.
static constexpr flatlogs::eventCodeT OBSERVER
inline ::flatbuffers::Offset< Observer_fb > CreateObserver_fb(::flatbuffers::FlatBufferBuilder &_fbb, ::flatbuffers::Offset<::flatbuffers::String > fullName=0, ::flatbuffers::Offset<::flatbuffers::String > pfoa=0, ::flatbuffers::Offset<::flatbuffers::String > email=0, ::flatbuffers::Offset<::flatbuffers::String > institution=0)
bool VerifyObserver_fbBuffer(::flatbuffers::Verifier &verifier)
const MagAOX::logger::Observer_fb * GetObserver_fb(const void *buf)
static constexpr 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 logMetaDetail getAccessor(const std::string &member)
Get an empty logMetaDetail because meta data doesn't make sense for this log.
static std::string msgString(void *msgBuffer, flatlogs::msgLenT len)
Get the message formatte for human consumption.