18 static void make_iso_time(time_t time,
char* buffer,
int len,
bool format_with_T)
22 tm_struct = localtime(&time);
27 strftime(buffer, len,
"%Y-%m-%dT%H:%M:%S", tm_struct);
31 strftime(buffer, len,
"%Y-%m-%d %H:%M:%S", tm_struct);
36 strncpy(buffer,
"<UNKNOWN>", len);
43 DAEstatus_message(
int severity,
int errtype,
int facility,
const std::string& text);
44 std::ostream&
print(std::ostream&
str,
bool format_with_T =
false,
bool add_cr =
false)
const;
53 static bool compareEQ(
int left_sev,
int right_sev);
54 static bool compareLE(
int left_sev,
int right_sev);
55 static bool compareGE(
int left_sev,
int right_sev);
56 static bool compare(
int left_sev,
int right_sev,
int direction);
75 std::string
timeStr(
bool format_with_T)
const
77 char time_buffer[128];
82 std::string
str()
const
116 return sm.
print(str);
153 int add(
int facility,
int severity,
int errtype,
const std::string& text);
154 int addVa(
int facility,
int severity,
int errtype,
const char* format, ... );
156 int addInfo(
int facility,
const std::string& text);
157 int addInfoVa(
int facility,
const char* format, ... );
158 int addWarning(
int facility,
const std::string& text);
159 int addWarningVa(
int facility,
const char* format, ... );
160 int addDebug(
int facility,
const std::string& text);
161 int addDebugVa(
int facility,
const char* format, ... );
164 int clear(
int severity,
int direction,
bool reset_overall_severity =
true);
166 int report(
int severity,
int direction,
bool reset_overall_severity =
true,
bool remove_messages =
true);
167 int report(std::ostream& str,
int severity,
int direction,
bool reset_overall_severity =
true,
bool remove_messages =
true);
168 int report(
DAEreport_func_t* report_func,
void* report_arg,
int severity,
int direction,
bool reset_overall_severity =
true,
bool remove_messages =
true);
169 int reportAll(
bool reset_overall_severity =
true,
bool remove_messages =
true) {
return report(
SEV_OK,
SEV_ALL, reset_overall_severity, remove_messages); }
170 int reportAll(std::ostream& str,
bool reset_overall_severity =
true,
bool remove_messages =
true) {
return report(str,
SEV_OK,
SEV_ALL, reset_overall_severity, remove_messages); }
176 std::ostream&
print(std::ostream& str);
194 std::ostream* pStr = (std::ostream*)arg;
195 (*pStr) << mess <<
'\n';
201 int addVaMain(
int facility,
int severity,
int errtype,
const char* format, va_list ap);
213 #define STATUS_CHECK_HR(a, status) \
216 status.addVa(FAC_DAE, SEV_ERROR, ERRTYPE_OUTOFMEM, \
217 "%s %d %s failed error 0x%.8x", __FILE__, __LINE__ , #a , hr); \
bool check(int severity, int direction) const
bool check(int severity, int direction) const
int addVa(int facility, int severity, int errtype, const char *format,...)
bool operator<=(int severity) const
static void make_iso_time(time_t time, char *buffer, int len, bool format_with_T)
int clearAll(bool reset_overall_severity=true)
int report(int severity, int direction, bool reset_overall_severity=true, bool remove_messages=true)
static bool compareEQ(int left_sev, int right_sev)
int DAEreport_func_t(const DAEstatus_message &mess, void *arg)
DAEstatus(const DAEstatus &)
int add(DAEstatus &dstatus, bool clear)
int resetSeverityToAtMost(int severity)
int addDebug(int facility, const std::string &text)
std::list< DAEstatus_message > status_list_t
static bool compareLE(int left_sev, int right_sev)
int setReportFunction(DAEreport_func_t *report_func, void *arg)
bool checkEQ(int severity) const
DAEreport_func_t * m_report_func
int resetSeverityToAtLeast(int severity)
int setReportCopyFunction(DAEreport_func_t *report_func, void *arg)
int reportAll(std::ostream &str, bool reset_overall_severity=true, bool remove_messages=true)
bool operator==(int severity) const
int reportAll(bool reset_overall_severity=true, bool remove_messages=true)
void * m_report_copy_func_arg
int reportAll(DAEreport_func_t *report_func, void *report_arg, bool reset_overall_severity=true, bool remove_messages=true)
int clear(int severity, int direction, bool reset_overall_severity=true)
std::ostream & print(std::ostream &str, bool format_with_T=false, bool add_cr=false) const
bool operator!=(int severity) const
int addVaMain(int facility, int severity, int errtype, const char *format, va_list ap)
int addDebugVa(int facility, const char *format,...)
int addWarning(int facility, const std::string &text)
bool operator<=(int severity) const
int resetSeverityToAtLeast(int severity)
status_list_t m_status_list
int addWarningVa(int facility, const char *format,...)
int recalculateSeverity()
bool operator>=(int severity) const
void reportImmediately(bool value)
bool operator==(int severity) const
std::ostream & print(std::ostream &str)
static bool compareGE(int left_sev, int right_sev)
static bool compare(int left_sev, int right_sev, int direction)
CRITICAL_SECTION m_critical
int addInfo(int facility, const std::string &text)
static int ostreamReportFunction(const DAEstatus_message &mess, void *arg)
int resetSeverityToAtMost(int severity)
bool operator>=(int severity) const
bool m_report_immediately
bool checkLE(int severity) const
std::string timeStr(bool format_with_T) const
void operator=(const DAEstatus &)
int addInfoVa(int facility, const char *format,...)
DAEreport_func_t * m_report_copy_func
std::ostream & operator<<(std::ostream &os, const DAEEventHeader::DAETime &t)
bool checkGE(int severity) const
bool operator!=(int severity) const