10#ifndef logger_types_git_state_hpp
11#define logger_types_git_state_hpp
39 const std::string &
sha1,
68 static_cast<void>(len);
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 )
89 if(rgs->repo())
return std::string(rgs->repo()->c_str());
94 static std::string
sha1(
void * msgBuffer )
98 if(rgs->sha1())
return std::string(rgs->sha1()->c_str());
107 if(rgs->modified() > 0)
return true;
123 std::cerr <<
"No member " << member <<
" in git_state\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 GIT_STATE
inline ::flatbuffers::Offset< Git_state_fb > CreateGit_state_fb(::flatbuffers::FlatBufferBuilder &_fbb, ::flatbuffers::Offset<::flatbuffers::String > repo=0, ::flatbuffers::Offset<::flatbuffers::String > sha1=0, uint8_t modified=0)
const MagAOX::logger::Git_state_fb * GetGit_state_fb(const void *buf)
bool VerifyGit_state_fbBuffer(::flatbuffers::Verifier &verifier)
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 &repoName, const std::string &sha1, const bool modified)
Construct from components.
Log entry recording the build-time git state.
static std::string sha1(void *msgBuffer)
Access the sha1 field.
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 logMetaDetail getAccessor(const std::string &member)
Get the logMetaDetail for a member by name.
static bool modified(void *msgBuffer)
Access the modified field.
static const flatlogs::eventCodeT eventCode
The event code.