53 const char *severityString =
"UNKNOWN";
56 severityString =
"FATAL";
59 severityString =
"WARNING_HI";
62 severityString =
"WARNING_LO";
65 severityString =
"COMMAND";
68 severityString =
"ACTIVITY_HI";
71 severityString =
"ACTIVITY_LO";
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.%06" 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,
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
Enum representing event severity.
@ 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)
void init()
Object initializer.
NATIVE_UINT_TYPE length() const
Get length of string.
const char * toChar() const
TimeBase getTimeBase() const
Auto-generated base for ActiveTextLogger component.
void TextQueue_internalInterfaceInvoke(const Fw::InternalInterfaceString &text)
Internal interface base-class function for TextQueue.
ActiveTextLogger(const char *compName)
Component constructor.
virtual ~ActiveTextLogger()
Component destructor.
bool set_log_file(const char *fileName, const U32 maxSize, const U32 maxBackups=10)
Set log file and max size.
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.