F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
ConsoleTextLoggerImplCommon.cpp
Go to the documentation of this file.
2 #include <FpConfig.hpp>
3 #include <Fw/Types/Assert.hpp>
4 #include <Fw/Logger/Logger.hpp>
5 
6 namespace Svc {
7 
10  }
11 
13 
14  void ConsoleTextLoggerImpl::TextLogger_handler(NATIVE_INT_TYPE portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity& severity, Fw::TextLogString &text) {
15  const char *severityString = "UNKNOWN";
16  switch (severity.e) {
18  severityString = "FATAL";
19  break;
21  severityString = "WARNING_HI";
22  break;
24  severityString = "WARNING_LO";
25  break;
27  severityString = "COMMAND";
28  break;
30  severityString = "ACTIVITY_HI";
31  break;
33  severityString = "ACTIVITY_LO";
34  break;
36  severityString = "DIAGNOSTIC";
37  break;
38  default:
39  severityString = "SEVERITY ERROR";
40  break;
41  }
42  Fw::Logger::log("EVENT: (%" PRI_FwEventIdType ") (%" PRI_FwTimeBaseStoreType ":%" PRIu32 ",%" PRIu32 ") %s: %s\n",
43  id, static_cast<FwTimeBaseStoreType>(timeTag.getTimeBase()), timeTag.getSeconds(), timeTag.getUSeconds(),
44  reinterpret_cast<PlatformPointerCastType>(severityString), reinterpret_cast<PlatformPointerCastType>(text.toChar()));
45  }
46 }
Definition: Time.hpp:9
#define PRI_FwEventIdType
Definition: FpConfig.h:104
Auto-generated base for PassiveTextLogger component.
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:55
#define PRI_FwTimeBaseStoreType
Definition: FpConfig.h:80
static void log(const char *format,...)
log a formated string with supplied arguments
Definition: Logger.cpp:21
TimeBase getTimeBase() const
Definition: Time.cpp:143
const char * toChar() const
T e
The raw enum value.
Software diagnostic events.
ConsoleTextLoggerImpl(const char *compName)
Less important informational events.
An activity related to commanding.
A less serious but recoverable event.
U32 getSeconds() const
Definition: Time.cpp:135
A serious but recoverable event.
Enum representing event severity.
U32 FwEventIdType
Definition: FpConfig.h:103
C++-compatible configuration header for fprime configuration.
Important informational events.
U32 getUSeconds() const
Definition: Time.cpp:139
A fatal non-recoverable event.
uint8_t PlatformPointerCastType