Go to the documentation of this file.
25 const std::string &program,
28 : message_handler(_message_handler),
30 always_flush(always_flush),
41 out <<
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
48 program_xml.
name=
"program";
49 program_xml.
data=program;
67 const std::string &program)
70 cmdline.isset(
"xml-ui") ?
uit::XML_UI : cmdline.isset(
"json-ui")
74 cmdline.isset(
"flush"),
75 cmdline.isset(
"timestamp")
76 ? cmdline.get_value(
"timestamp") ==
"monotonic"
78 : cmdline.get_value(
"timestamp") ==
"wall"
86 util_make_unique<console_message_handlert>(
always_flush);
125 return "STATUS-MESSAGE";
130 const std::string &message)
138 std::stringstream ss;
139 const std::string timestamp =
time->stamp();
140 ss << timestamp << (timestamp.empty() ?
"" :
" ") << message;
152 print(level, message, location);
170 INVARIANT(
false,
"Cannot print xml data on PLAIN UI");
177 INVARIANT(
false,
"Cannot print xml data on JSON UI");
192 INVARIANT(
false,
"Cannot print json data on PLAIN UI");
195 INVARIANT(
false,
"Cannot print json data on XML UI");
208 const std::string &message,
219 level, message, location);
225 std::string tmp_message(message);
227 if(!tmp_message.empty() && *tmp_message.rbegin()==
'\n')
228 tmp_message.resize(tmp_message.size()-1);
232 ui_msg(type, tmp_message, location);
240 const std::string &type,
241 const std::string &msg,
260 const std::string &type,
261 const std::string &msg1,
265 result.
name=
"message";
273 const std::string timestamp =
time->stamp();
274 if(!timestamp.empty())
282 const std::string &type,
283 const std::string &msg1,
291 result[
"sourceLocation"] =
json(location);
295 const std::string timestamp =
time->stamp();
296 if(!timestamp.empty())
json_objectt json(const source_locationt &location)
virtual void ui_msg(const std::string &type, const std::string &msg, const source_locationt &location)
clockt
Derived types of timestampert.
virtual ~ui_message_handlert()
xmlt xml(const source_locationt &location)
virtual void print(unsigned level, const std::string &message)=0
std::unique_ptr< json_stream_arrayt > json_stream
virtual void json_ui_msg(const std::string &type, const std::string &msg, const source_locationt &location)
std::unique_ptr< const timestampert > time
Provides methods for streaming JSON arrays.
std::unique_ptr< console_message_handlert > console_message_handler
void set_attribute(const std::string &attribute, unsigned value)
const char * level_string(unsigned level)
virtual void xml_ui_msg(const std::string &type, const std::string &msg, const source_locationt &location)
virtual void print(unsigned level, const std::string &message) override
virtual void flush(unsigned level) override
const irep_idt & get_file() const
virtual void flush(unsigned)=0
ui_message_handlert(const class cmdlinet &, const std::string &program)
Timestamp class hierarchy.
message_handlert * message_handler
xmlt & new_element(const std::string &key)