MagAO-X
Operations Applications Utilities Source
logStdFormat.hpp
Go to the documentation of this file.
1 #ifndef logger_logStdFormat_hpp
2 #define logger_logStdFormat_hpp
3 #include <flatlogs/flatlogs.hpp>
4 #include "logTypes.hpp"
5 namespace MagAOX
6 {
7 namespace logger
8 {
9 inline
11 {
13  ec = flatlogs::logHeader::eventCode(buffer);
14  switch(ec)
15  {
16  case 0:
17  return flatlogs::stdFormat<git_state>(buffer);
18  case 10:
19  return flatlogs::stdFormat<text_log>(buffer);
20  case 11:
21  return flatlogs::stdFormat<user_log>(buffer);
22  case 20:
23  return flatlogs::stdFormat<state_change>(buffer);
24  case 50:
25  return flatlogs::stdFormat<software_log>(buffer);
26  case 140:
27  return flatlogs::stdFormat<indidriver_start>(buffer);
28  case 141:
29  return flatlogs::stdFormat<indidriver_stop>(buffer);
30  case 1001:
31  return flatlogs::stdFormat<loop_closed>(buffer);
32  case 1002:
33  return flatlogs::stdFormat<loop_paused>(buffer);
34  case 1003:
35  return flatlogs::stdFormat<loop_open>(buffer);
36  case 12001:
37  return flatlogs::stdFormat<pdu_outlet_state>(buffer);
38  case 12100:
39  return flatlogs::stdFormat<fxngen_params>(buffer);
40  default:
41  std::cerr << "Unknown log type: " << ec << "\n";
42  }
43 }
44 }
45 }
46 #endif
static int eventCode(bufferPtrT &logBuffer, const eventCodeT &ec)
Set the event code of a log entry.
Definition: logHeader.hpp:307
void logStdFormat(flatlogs::bufferPtrT &buffer)
std::shared_ptr< char > bufferPtrT
The log entry buffer smart pointer.
Definition: logHeader.hpp:57
Flatlogs single include file.
uint16_t eventCodeT
The type of an event code (16-bit unsigned int).
Definition: logDefs.hpp:38