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 <Fw/Logger/Logger.hpp>
3 #include <Fw/Types/Assert.hpp>
5 
6 namespace Svc {
7 
9 
11 
12 void ConsoleTextLoggerImpl::TextLogger_handler(FwIndexType portNum,
13  FwEventIdType id,
14  Fw::Time& timeTag,
15  const Fw::LogSeverity& severity,
16  Fw::TextLogString& text) {
17  const char* severityString = nullptr;
18  switch (severity.e) {
20  severityString = "FATAL";
21  break;
23  severityString = "WARNING_HI";
24  break;
26  severityString = "WARNING_LO";
27  break;
29  severityString = "COMMAND";
30  break;
32  severityString = "ACTIVITY_HI";
33  break;
35  severityString = "ACTIVITY_LO";
36  break;
38  severityString = "DIAGNOSTIC";
39  break;
40  default:
41  severityString = "SEVERITY ERROR";
42  break;
43  }
44  Fw::Logger::log("EVENT: (%" PRI_FwEventIdType ") (%" PRI_FwTimeBaseStoreType ":%" PRIu32 ",%" PRIu32 ") %s: %s\n",
45  id, static_cast<FwTimeBaseStoreType>(timeTag.getTimeBase()), timeTag.getSeconds(),
46  timeTag.getUSeconds(), severityString, text.toChar());
47 }
48 } // namespace Svc
Auto-generated base for PassiveTextLogger component.
static void log(const char *format,...)
log a formated string with supplied arguments
Definition: Logger.cpp:21
TimeBase getTimeBase() const
Definition: Time.cpp:94
const char * toChar() const
T e
The raw enum value.
Software diagnostic events.
#define PRI_FwEventIdType
FwIdType FwEventIdType
The type of an event identifier.
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:86
A serious but recoverable event.
Enum representing event severity.
#define PRI_FwTimeBaseStoreType
Important informational events.
U32 getUSeconds() const
Definition: Time.cpp:90
PlatformIndexType FwIndexType
A fatal non-recoverable event.
RateGroupDivider component implementation.