1 #ifndef MESSAGEFACILITY_EXTENSIONS_QT_MF_MSG_H
2 #define MESSAGEFACILITY_EXTENSIONS_QT_MF_MSG_H
7 #include <QtCore/QString>
8 #include <QtGui/QColor>
17 #include "messagefacility/Utilities/ELseverityLevel.h"
48 qt_mf_msg(
const std::string& hostname,
const std::string& category,
const std::string& application, pid_t pid, timeval
time);
66 QString
const&
text(
bool mode)
const {
return mode ? shortText_ : text_; }
71 QColor
const&
color()
const {
return color_; }
76 sev_code_t
sev()
const {
return sev_; }
81 QString
const&
host()
const {
return host_; }
86 QString
const&
cat()
const {
return cat_; }
91 QString
const&
app()
const {
return app_; }
96 timeval
time()
const {
return time_; }
101 size_t seq()
const {
return seq_; }
119 void setMessage(
const std::string& prefix,
int iteration,
const std::string& msg);
124 void setHostAddr(std::string
const& hostaddr) { hostaddr_ = QString(hostaddr.c_str()).toHtmlEscaped(); }
129 void setFileName(std::string
const& file) { file_ = QString(file.c_str()).toHtmlEscaped(); }
134 void setLineNumber(std::string
const& line) { line_ = QString(line.c_str()).toHtmlEscaped(); }
139 void setModule(std::string
const& module) { module_ = QString(module.c_str()).toHtmlEscaped(); }
144 void setEventID(std::string
const& eventID) { eventID_ = QString(eventID.c_str()).toHtmlEscaped(); }
162 static size_t sequence;
165 QString application_;
179 typedef std::shared_ptr<qt_mf_msg> msg_ptr_t;
184 typedef std::list<msg_ptr_t> msgs_t;
189 typedef std::map<QString, msgs_t> msgs_map_t;
QString const & app() const
Get the application of the message
void updateText()
Parse fields and create HTML string representing message
timeval time() const
Get the message timestamp
size_t seq() const
Get the sequence number of the message
Qt wrapper around MessageFacility message
void setModule(std::string const &module)
Set the module name
sev_code_t sev() const
Get the severity of the message
void setSeverityLevel(sev_code_t sev)
Set the severity code of the message (Viewer levels)
QString const & host() const
Get the host from which the message came
void setMessage(const std::string &prefix, int iteration, const std::string &msg)
Set the message
void setEventID(std::string const &eventID)
Set the Event ID of the message
void setHostAddr(std::string const &hostaddr)
Set the hostaddr field
void setFileName(std::string const &file)
Set the file name field
qt_mf_msg()
Default message constructor.
void setSeverity(mf::ELseverityLevel sev)
Set the Severity of the message (MF levels)
void setLineNumber(std::string const &line)
Set the line number field
QString const & text(bool mode) const
Get the text of the message
QString const & cat() const
Get the category of the message
QColor const & color() const
Get the severity-based color of the message