10 #ifndef CPROVER_UTIL_MESSAGE_H 11 #define CPROVER_UTIL_MESSAGE_H 32 virtual void print(
unsigned level,
const std::string &message)=0;
52 const std::string &message,
56 virtual void flush(
unsigned level)
84 virtual void print(
unsigned level,
const std::string &message)
91 const std::string &message,
95 print(level, message);
106 virtual void print(
unsigned level,
const std::string &message)
111 out << message <<
'\n';
144 const std::string &user_input,
157 "message handler should be set before calling get_message_handler");
194 unsigned _message_level,
218 if(this->tellp() > 0)
229 if(this->tellp() > 0)
241 static_cast<std::ostream &
>(*this) << x;
254 if(this->tellp() > 0)
284 m.str(std::string());
292 static_cast<std::ostream &
>(m) << std::endl;
339 const std::function<
void(mstreamt &)> &output_generator)
const;
346 #endif // CPROVER_UTIL_MESSAGE_H
mstreamt & progress() const
stream_message_handlert(std::ostream &_out)
static unsigned eval_verbosity(const std::string &user_input, const message_levelt default_verbosity, message_handlert &dest)
Parse a (user-)provided string as a verbosity level and set it as the verbosity of dest...
mstreamt & operator<<(const xmlt &data)
static mstreamt & eom(mstreamt &m)
xmlt xml(const source_locationt &location)
virtual void print(unsigned level, const std::string &message)
#define INVARIANT(CONDITION, REASON)
unsigned get_verbosity() const
mstreamt & warning() const
messaget(const messaget &other)
source_locationt source_location
mstreamt & get_mstream(unsigned message_level) const
virtual void print(unsigned level, const std::string &message, int sequence_number, const source_locationt &location)
Provides methods for streaming JSON arrays.
messaget & operator=(const messaget &other)
static mstreamt & endl(mstreamt &m)
virtual void set_message_handler(message_handlert &_message_handler)
virtual void print(unsigned level, const xmlt &xml)
virtual void print(unsigned level, const std::string &message)
virtual void flush(unsigned level)
mstreamt & operator=(const mstreamt &other)=delete
virtual void print(unsigned level, const jsont &json)
messaget(message_handlert &_message_handler)
message_handlert & get_message_handler()
mstreamt & result() const
mstreamt & status() const
std::vector< unsigned > message_count
void conditional_output(mstreamt &mstream, const std::function< void(mstreamt &)> &output_generator) const
Generate output to mstream using output_generator if the configured verbosity is at least as high as ...
mstreamt(unsigned _message_level, messaget &_message)
virtual json_stream_arrayt & get_json_stream()
Return the underlying JSON stream.
void assign_from(const mstreamt &other)
void set_verbosity(unsigned _verbosity)
virtual ~message_handlert()
virtual void flush(unsigned level)
json_stream_arrayt & json_stream()
Returns a reference to the top-level JSON array stream.
message_handlert * message_handler
mstreamt(const mstreamt &other, messaget &_message)
mstreamt & statistics() const
json_objectt json(const source_locationt &location)
virtual void print(unsigned level, const std::string &message)=0
unsigned get_message_count(unsigned level) const