18 ActiveTextLoggerComponentBase(name),
31 ActiveTextLoggerComponentBase::init(queueDepth,instance);
38 void ActiveTextLoggerComponentImpl::TextLogger_handler(
NATIVE_INT_TYPE portNum,
41 const Fw::LogSeverity& severity,
47 if (Fw::LogSeverity::DIAGNOSTIC == severity.e) {
53 const char *severityString =
"UNKNOWN";
55 case Fw::LogSeverity::FATAL:
56 severityString =
"FATAL";
58 case Fw::LogSeverity::WARNING_HI:
59 severityString =
"WARNING_HI";
61 case Fw::LogSeverity::WARNING_LO:
62 severityString =
"WARNING_LO";
64 case Fw::LogSeverity::COMMAND:
65 severityString =
"COMMAND";
67 case Fw::LogSeverity::ACTIVITY_HI:
68 severityString =
"ACTIVITY_HI";
70 case Fw::LogSeverity::ACTIVITY_LO:
71 severityString =
"ACTIVITY_LO";
73 case Fw::LogSeverity::DIAGNOSTIC:
74 severityString =
"DIAGNOSTIC";
77 severityString =
"SEVERITY ERROR";
91 if (localtime_r(&t, &tm) ==
nullptr) {
95 (void) snprintf(textStr,
97 "EVENT: (%" PRI_FwEventIdType ") (%04d-%02d-%02dT%02d:%02d:%02d.%03" PRIu32
") %s: %s\n",
98 id, tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour,
100 severityString,text.
toChar());
104 (void) snprintf(textStr,
113 this->TextQueue_internalInterfaceInvoke(intText);
139 return this->m_log_file.
set_log_file(fileName, maxSize, maxBackups);
PlatformIntType NATIVE_INT_TYPE
@ TB_WORKSTATION_TIME
Time as reported on workstation where software is running. For testing.
#define PRI_FwEventIdType
#define PRI_FwTimeBaseStoreType
#define FW_INTERNAL_INTERFACE_STRING_MAX_SIZE
Max size of interface string parameter type.
const char * toChar() const
gets char buffer
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)
NATIVE_UINT_TYPE length() const
Get length of string.
const char * toChar() const
TimeBase getTimeBase() const
virtual ~ActiveTextLoggerComponentImpl()
Component destructor.
ActiveTextLoggerComponentImpl(const char *compName)
Component constructor.
bool set_log_file(const char *fileName, const U32 maxSize, const U32 maxBackups=10)
Set log file and max size.
void init(NATIVE_INT_TYPE queueDepth, NATIVE_INT_TYPE instance=0)
Component initialization routine.
bool set_log_file(const char *fileName, const U32 maxSize, const U32 maxBackups=10)
Set log file and max size.
bool write_to_log(const char *const buf, const U32 size)
Write the passed buf to the log if possible.