10 #ifndef logger_types_git_state_hpp
11 #define logger_types_git_state_hpp
13 #include "generated/git_state_generated.h"
39 const std::string & sha1,
44 auto _sha1 =
builder.CreateString(sha1);
48 auto gs = CreateGit_state_fb(
builder, _repoName, _sha1, _modified);
60 return VerifyGit_state_fbBuffer(verifier);
68 static_cast<void>(len);
70 auto rgs = GetGit_state_fb(msgBuffer);
73 if( rgs->repo()) str = rgs->repo()->c_str();
77 if( rgs->sha1()) str += rgs->sha1()->c_str();
79 if(rgs->modified() > 0) str+=
" MODIFIED";
85 static std::string
repoName(
void * msgBuffer )
87 auto rgs = GetGit_state_fb(msgBuffer);
89 if(rgs->repo())
return std::string(rgs->repo()->c_str());
96 auto rgs = GetGit_state_fb(msgBuffer);
98 if(rgs->modified() > 0)
return true;
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 &repoName, const std::string &sha1, const bool modified)
Construct from components.
Log entry recording the build-time git state.
static bool verify(flatlogs::bufferPtrT &logBuff, flatlogs::msgLenT len)
static std::string repoName(void *msgBuffer)
Access the repo name field.
static std::string msgString(void *msgBuffer, flatlogs::msgLenT len)
Get the message formatte for human consumption.
static const flatlogs::logPrioT defaultLevel
The default level.
static bool modified(void *msgBuffer)
Access the modified field.
static const flatlogs::eventCodeT eventCode
The event code.