33 const std::string &program,
37 always_flush(always_flush),
48 out <<
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" 55 program_xml.
name=
"program";
56 program_xml.
data=program;
79 const std::string &program)
81 cmdline.isset(
"xml-ui") ?
uit::XML_UI : cmdline.isset(
"json-ui")
85 cmdline.isset(
"flush"),
86 cmdline.isset(
"timestamp")
87 ? cmdline.get_value(
"timestamp") ==
"monotonic" 89 : cmdline.get_value(
"timestamp") ==
"wall" 124 return "STATUS-MESSAGE";
129 const std::string &message)
138 std::stringstream ss;
139 const std::string timestamp =
time->stamp();
140 ss << timestamp << (timestamp.empty() ?
"" :
" ") << message;
141 console_message_handler.
print(level, ss.str());
143 console_message_handler.
flush(level);
152 print(level, message, -1, 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,
220 level, message, sequence_number, location);
226 std::string tmp_message(message);
228 if(!tmp_message.empty() && *tmp_message.rbegin()==
'\n')
229 tmp_message.resize(tmp_message.size()-1);
233 std::string sequence_number_str=
236 ui_msg(type, tmp_message, sequence_number_str, location);
244 const std::string &type,
245 const std::string &msg1,
246 const std::string &msg2,
265 const std::string &type,
266 const std::string &msg1,
267 const std::string &msg2,
271 result.
name=
"message";
279 const std::string timestamp =
time->stamp();
280 if(!timestamp.empty())
288 const std::string &type,
289 const std::string &msg1,
290 const std::string &msg2,
298 result[
"sourceLocation"] =
json(location);
302 const std::string timestamp =
time->stamp();
303 if(!timestamp.empty())
314 console_message_handler.
flush(level);
const char * level_string(unsigned level)
xmlt xml(const source_locationt &location)
#define INVARIANT(CONDITION, REASON)
ui_message_handlert()
Default constructor; implementation is in .cpp file.
virtual void json_ui_msg(const std::string &type, const std::string &msg1, const std::string &msg2, const source_locationt &location)
virtual void print(unsigned level, const std::string &message) override
Timestamp class hierarchy.
virtual void flush(unsigned level) override
void set_attribute(const std::string &attribute, unsigned value)
Provides methods for streaming JSON arrays.
virtual void xml_ui_msg(const std::string &type, const std::string &msg1, const std::string &msg2, const source_locationt &location)
clockt
Derived types of timestampert.
virtual void ui_msg(const std::string &type, const std::string &msg1, const std::string &msg2, const source_locationt &location)
xmlt & new_element(const std::string &name)
const irep_idt & get_file() const
std::unique_ptr< json_stream_arrayt > json_stream
virtual ~ui_message_handlert()
std::string to_string(const string_constraintt &expr)
Used for debug printing.
virtual void print(unsigned level, const std::string &message) override
std::unique_ptr< const timestampert > time
virtual void flush(unsigned level) override
json_objectt json(const source_locationt &location)
virtual void print(unsigned level, const std::string &message)=0