API
user_log.hpp
Go to the documentation of this file.
1 /** \file user_log.hpp
2  * \brief The MagAO-X logger user_log log type.
3  * \author Jared R. Males (jaredmales@gmail.com)
4  *
5  * \ingroup logger_types_files
6  *
7  * History:
8  * - 2018-08-18 created by JRM
9  */
10 #ifndef logger_types_user_log_hpp
11 #define logger_types_user_log_hpp
12 
13 #include "string_log.hpp"
14 
15 namespace MagAOX
16 {
17 namespace logger
18 {
19 
20 ///User entered log, a string-type log.
21 /** \ingroup logger_types
22  */
23 struct user_log : public string_log
24 {
25  ///The event code
26  static const flatlogs::eventCodeT eventCode = eventCodes::USER_LOG;
27 
28  ///The default level
30 
31  ///Get the message formatte for human consumption.
32  static std::string msgString( void * msgBuffer, /**< [in] Buffer containing the flatbuffer serialized message.*/
33  flatlogs::msgLenT len /**< [in] [unused] length of msgBuffer.*/
34  )
35  {
36  std::string msg;
37  msg = string_log::msgString(msgBuffer, len);
38 
39  std::string nmsg = "USER: ";
40  return nmsg + msg;
41  }
42 };
43 
44 
45 } //namespace logger
46 } //namespace MagAOX
47 
48 #endif //logger_types_user_log_hpp
uint16_t eventCodeT
The type of an event code (16-bit unsigned int).
Definition: logDefs.hpp:40
msgLen2T msgLenT
The type used to refer to the message length, regardless of length.
Definition: logDefs.hpp:69
int8_t logPrioT
The type of the log priority code.
Definition: logDefs.hpp:21
std::stringstream msg
Definition: dm.hpp:24
constexpr static logPrioT LOG_INFO
Informational. The info log level is the lowest level recorded during normal operations.
Definition: logPriority.hpp:49
The MagAO-X logger string_log log type.
Base class for logs consisting of a string message.
Definition: string_log.hpp:30
static std::string msgString(void *msgBuffer, flatlogs::msgLenT len)
Get the message formatted for human consumption.
Definition: string_log.hpp:60
User entered log, a string-type log.
Definition: user_log.hpp:24
static std::string msgString(void *msgBuffer, flatlogs::msgLenT len)
Get the message formatte for human consumption.
Definition: user_log.hpp:32
static const flatlogs::eventCodeT eventCode
The event code.
Definition: user_log.hpp:26
static const flatlogs::logPrioT defaultLevel
The default level.
Definition: user_log.hpp:29