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") || cmdline.isset(
"xml-interface")
72 : cmdline.isset(
"json-ui") || cmdline.isset(
"json-interface")
76 cmdline.isset(
"flush"),
77 cmdline.isset(
"timestamp") ? cmdline.get_value(
"timestamp") ==
"monotonic"
79 : cmdline.get_value(
"timestamp") ==
"wall"
87 util_make_unique<console_message_handlert>(
always_flush);
126 return "STATUS-MESSAGE";
139 std::stringstream ss;
140 const std::string timestamp =
time->stamp();
141 ss << timestamp << (timestamp.empty() ?
"" :
" ") <<
message;
171 INVARIANT(
false,
"Cannot print xml data on PLAIN UI");
178 INVARIANT(
false,
"Cannot print xml data on JSON UI");
193 INVARIANT(
false,
"Cannot print json data on PLAIN UI");
196 INVARIANT(
false,
"Cannot print json data on XML UI");
226 std::string tmp_message(
message);
228 if(!tmp_message.empty() && *tmp_message.rbegin()==
'\n')
229 tmp_message.resize(tmp_message.size()-1);
233 ui_msg(type, tmp_message, location);
241 const std::string &type,
242 const std::string &msg,
261 const std::string &type,
262 const std::string &msg1,
266 result.
name=
"message";
274 const std::string timestamp =
time->stamp();
275 if(!timestamp.empty())
283 const std::string &type,
284 const std::string &msg1,
292 result[
"sourceLocation"] =
json(location);
296 const std::string timestamp =
time->stamp();
297 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
static const char * message(const static_verifier_resultt::statust &status)
Makes a status message string from a status.
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)