11#ifndef logger_types_user_log_hpp
12#define logger_types_user_log_hpp
61 static_cast<void>(len);
65 std::string msg =
"[USER] ";
69 msg += fbs->email()->c_str();
79 msg += fbs->message()->c_str();
86 static std::string
email(
void * msgBuffer )
89 if(fbs->email() !=
nullptr)
91 return std::string(fbs->email()->c_str());
97 static std::string
message(
void * msgBuffer )
100 if(fbs->message() !=
nullptr)
102 return std::string(fbs->message()->c_str());
118 std::cerr <<
"No member " << member <<
" in user_log\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 USER_LOG
inline ::flatbuffers::Offset< User_log_fb > CreateUser_log_fb(::flatbuffers::FlatBufferBuilder &_fbb, ::flatbuffers::Offset<::flatbuffers::String > email=0, ::flatbuffers::Offset<::flatbuffers::String > message=0)
bool VerifyUser_log_fbBuffer(::flatbuffers::Verifier &verifier)
const MagAOX::logger::User_log_fb * GetUser_log_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.
messageT(const std::string &email, const std::string &message)
static std::string msgString(void *msgBuffer, flatlogs::msgLenT len)
Get the message formatte for human consumption.
static const flatlogs::eventCodeT eventCode
The event code.
static bool verify(flatlogs::bufferPtrT &logBuff, flatlogs::msgLenT len)
static const flatlogs::logPrioT defaultLevel
The default level.
static std::string email(void *msgBuffer)
Get the user email from a user_log.
static std::string message(void *msgBuffer)
Get the message from a user_log.
static logMetaDetail getAccessor(const std::string &member)
Get the logMetaDetail for a member by name.