API
 
Loading...
Searching...
No Matches
text_log.hpp
Go to the documentation of this file.
1/** \file text_log.hpp
2 * \brief The MagAO-X logger text_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_text_log_hpp
11#define logger_types_text_log_hpp
12
13#include "string_log.hpp"
14
15namespace MagAOX
16{
17namespace logger
18{
19
20///A simple text log, a string-type log.
21/** \ingroup logger_types
22 */
23struct text_log : public string_log
24{
25 ///The event code
27
28 ///The default level
30
31 /// Get the logMetaDetail for a member by name
32 /**
33 * \returns the a logMetaDetail filled in with the appropriate details
34 * \returns an empty logMetaDetail if member not recognized
35 */
36 static logMetaDetail getAccessor( const std::string &member /**< [in] the name of the member */ )
37 {
38 if( member == "message" )
39 {
40 return logMetaDetail( { "TEXT",
41 "log message",
44 reinterpret_cast<void *>( &message ),
45 false } );
46 }
47 else
48 {
49 std::cerr << "No member " << member << " in text_log\n";
50 return logMetaDetail();
51 }
52 }
53};
54
55
56
57} //namespace logger
58} //namespace MagAOX
59
60#endif //logger_types_text_log_hpp
uint16_t eventCodeT
The type of an event code (16-bit unsigned int).
Definition logDefs.hpp:40
int8_t logPrioT
The type of the log priority code.
Definition logDefs.hpp:21
static constexpr flatlogs::eventCodeT TEXT_LOG
Definition logCodes.hpp:11
Definition dm.hpp:28
static constexpr logPrioT LOG_INFO
Informational. The info log level is the lowest level recorded during normal operations.
The MagAO-X logger string_log log type.
Base class for logs consisting of a string message.
static std::string message(void *msgBuffer)
Access the message field.
A simple text log, a string-type log.
Definition text_log.hpp:24
static const flatlogs::eventCodeT eventCode
The event code.
Definition text_log.hpp:26
static logMetaDetail getAccessor(const std::string &member)
Get the logMetaDetail for a member by name.
Definition text_log.hpp:36
static const flatlogs::logPrioT defaultLevel
The default level.
Definition text_log.hpp:29