Go to the documentation of this file.
27 const std::string &program,
30 : message_handler(_message_handler),
32 always_flush(always_flush),
43 out <<
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
50 program_xml.
name=
"program";
51 program_xml.
data=program;
69 const std::string &program)
72 cmdline.isset(
"xml-ui") || cmdline.isset(
"xml-interface")
74 : cmdline.isset(
"json-ui") || cmdline.isset(
"json-interface")
78 cmdline.isset(
"flush"),
79 cmdline.isset(
"timestamp") ? cmdline.get_value(
"timestamp") ==
"monotonic"
81 : cmdline.get_value(
"timestamp") ==
"wall"
89 util_make_unique<console_message_handlert>(
always_flush);
128 return "STATUS-MESSAGE";
133 const std::string &message)
141 std::stringstream ss;
142 const std::string timestamp =
time->stamp();
143 ss << timestamp << (timestamp.empty() ?
"" :
" ") << message;
155 print(level, message, location);
173 INVARIANT(
false,
"Cannot print xml data on PLAIN UI");
180 INVARIANT(
false,
"Cannot print xml data on JSON UI");
195 INVARIANT(
false,
"Cannot print json data on PLAIN UI");
198 INVARIANT(
false,
"Cannot print json data on XML UI");
211 const std::string &message,
222 level, message, location);
228 std::string tmp_message(message);
230 if(!tmp_message.empty() && *tmp_message.rbegin()==
'\n')
231 tmp_message.resize(tmp_message.size()-1);
235 ui_msg(type, tmp_message, location);
243 const std::string &type,
244 const std::string &msg,
263 const std::string &type,
264 const std::string &msg1,
268 result.
name=
"message";
276 const std::string timestamp =
time->stamp();
277 if(!timestamp.empty())
285 const std::string &type,
286 const std::string &msg1,
294 result[
"sourceLocation"] =
json(location);
298 const std::string timestamp =
time->stamp();
299 if(!timestamp.empty())
std::string to_pretty(const structured_datat &data)
Convert the structured_data into plain text.
jsont to_json(const structured_datat &data)
Convert the structured_datat into an json object.
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 to_xml(const structured_datat &data)
Convert the structured_datat into an xml object.
virtual void print(unsigned level, const std::string &message)=0
virtual uit get_ui() const
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)
xmlt xml(const irep_idt &property_id, const property_infot &property_info)
std::unique_ptr< const timestampert > time
static void json(json_objectT &result, const irep_idt &property_id, const property_infot &property_info)
Provides methods for streaming JSON arrays.
A way of representing nested key/value data.
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 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.
void print(unsigned level, const structured_datat &data) override
message_handlert * message_handler
xmlt & new_element(const std::string &key)