F´ Flight Software - C/C++ Documentation  devel
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 
14  }
15 
17 
18  void ConsoleTextLoggerImpl::TextLogger_handler(NATIVE_INT_TYPE portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity& severity, Fw::TextLogString &text) {
19  const char *severityString = "UNKNOWN";
20  switch (severity.e) {
22  severityString = "FATAL";
23  break;
25  severityString = "WARNING_HI";
26  break;
28  severityString = "WARNING_LO";
29  break;
31  severityString = "COMMAND";
32  break;
34  severityString = "ACTIVITY_HI";
35  break;
37  severityString = "ACTIVITY_LO";
38  break;
40  severityString = "DIAGNOSTIC";
41  break;
42  default:
43  severityString = "SEVERITY ERROR";
44  break;
45  }
46  Fw::Logger::logMsg("EVENT: (%" PRI_FwEventIdType ") (%" PRI_FwTimeBaseStoreType ":%" PRIu32 ",%" PRIu32 ") %s: %s\n",
47  id, static_cast<FwTimeBaseStoreType>(timeTag.getTimeBase()), timeTag.getSeconds(), timeTag.getUSeconds(),
48  reinterpret_cast<PlatformPointerCastType>(severityString), reinterpret_cast<PlatformPointerCastType>(text.toChar()));
49  }
50 }
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:51
uint8_t PlatformPointerCastType
U32 FwEventIdType
Definition: FpConfig.h:86
U16 FwTimeBaseStoreType
Definition: FpConfig.h:66
#define PRI_FwEventIdType
Definition: FpConfig.h:87
#define PRI_FwTimeBaseStoreType
Definition: FpConfig.h:67
C++-compatible configuration header for fprime configuration.
Enum representing event severity.
T e
The raw enum value.
@ WARNING_HI
A serious but recoverable event.
@ ACTIVITY_HI
Important informational events.
@ FATAL
A fatal non-recoverable event.
@ WARNING_LO
A less serious but recoverable event.
@ DIAGNOSTIC
Software diagnostic events.
@ ACTIVITY_LO
Less important informational events.
@ COMMAND
An activity related to commanding.
static void logMsg(const char *fmt, POINTER_CAST a0=0, POINTER_CAST a1=0, POINTER_CAST a2=0, POINTER_CAST a3=0, POINTER_CAST a4=0, POINTER_CAST a5=0, POINTER_CAST a6=0, POINTER_CAST a7=0, POINTER_CAST a8=0, POINTER_CAST a9=0)
Definition: Logger.cpp:18
void init()
Object initializer.
Definition: ObjBase.cpp:27
const char * toChar() const
Definition: Time.hpp:9
U32 getUSeconds() const
Definition: Time.cpp:139
TimeBase getTimeBase() const
Definition: Time.cpp:143
U32 getSeconds() const
Definition: Time.cpp:135
ConsoleTextLoggerImpl(const char *compName)
Auto-generated base for PassiveTextLogger component.