Go to the documentation of this file.
10 #ifndef CPROVER_UTIL_MESSAGE_H
11 #define CPROVER_UTIL_MESSAGE_H
34 virtual void print(
unsigned level,
const std::string &message)=0;
44 const std::string &message,
47 virtual void flush(
unsigned) = 0;
66 virtual std::string
command(
unsigned)
const
84 void print(
unsigned level,
const std::string &message)
override
99 const std::string &message,
102 print(level, message);
117 void print(
unsigned level,
const std::string &message)
override
122 out << message <<
'\n';
175 const std::string &user_input,
188 "message handler should be set before calling get_message_handler");
227 unsigned _message_level,
251 if(this->tellp() > 0)
264 if(this->tellp() > 0)
276 static_cast<std::ostream &
>(*this) << x;
310 m.str(std::string());
436 const std::function<
void(mstreamt &)> &output_generator)
const;
443 #endif // CPROVER_UTIL_MESSAGE_H
Class that provides messages with a built-in verbosity 'level'.
virtual std::string command(unsigned) const
Create an ECMA-48 SGR (Select Graphic Rendition) command.
void print(unsigned level, const std::string &message) override
messaget & operator=(const messaget &other)
static const commandt reset
return to default formatting, as defined by the terminal
void print(unsigned, const xmlt &) override
mstreamt & status() const
void print(unsigned level, const std::string &message) override
unsigned get_verbosity() const
commandt(unsigned _command)
stream_message_handlert(std::ostream &_out)
static const commandt bright_red
render text with bright red foreground color
void print(unsigned, const jsont &) override
static const commandt italic
render italic text
void flush(unsigned) override
mstreamt & operator=(const mstreamt &other)=delete
mstreamt & operator<<(const xmlt &data)
virtual void print(unsigned level, const std::string &message)=0
mstreamt(const mstreamt &other, messaget &_message)
static const commandt bright_magenta
render text with bright magenta foreground color
messaget(message_handlert &_message_handler)
static const commandt bright_yellow
render text with bright yellow foreground color
messaget(const messaget &other)
static const commandt green
render text with green foreground color
mstreamt & result() const
static const commandt faint
render text with faint font
static const commandt bold
render text with bold font
mstreamt & operator<<(const structured_datat &data)
static const commandt yellow
render text with yellow foreground color
xmlt xml(const irep_idt &property_id, const property_infot &property_info)
source_locationt source_location
static commandt command(unsigned c)
Create an ECMA-48 SGR (Select Graphic Rendition) command.
static void json(json_objectT &result, const irep_idt &property_id, const property_infot &property_info)
virtual void set_message_handler(message_handlert &_message_handler)
void print(unsigned, const xmlt &) override
friend mstreamt & operator<<(mstreamt &m, const commandt &c)
feed a command into an mstreamt
void assign_from(const mstreamt &other)
void flush(unsigned) override
void print(unsigned, const jsont &) override
#define SINCE(year, month, day, msg)
A way of representing nested key/value data.
mstreamt(unsigned _message_level, messaget &_message)
void print(unsigned level, const std::string &message, const source_locationt &) override
void set_verbosity(unsigned _verbosity)
std::vector< std::size_t > message_count
message_handlert & get_message_handler()
message_handlert * message_handler
static const commandt red
render text with red foreground color
void conditional_output(mstreamt &mstream, const std::function< void(mstreamt &)> &output_generator) const
Generate output to message_stream using output_generator if the configured verbosity is at least as h...
mstreamt & get_mstream(unsigned message_level) const
virtual void flush(unsigned)=0
static const commandt underline
render underlined text
static const commandt cyan
render text with cyan foreground color
mstreamt & progress() const
static const commandt bright_green
render text with bright green foreground color
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.
friend mstreamt & operator<<(mstreamt &m, eomt)
virtual ~message_handlert()
mstreamt & warning() const
static const commandt magenta
render text with magenta foreground color
static const commandt bright_cyan
render text with bright cyan foreground color
static const commandt bright_blue
render text with bright blue foreground color
static const commandt blue
render text with blue foreground color
std::size_t get_message_count(unsigned level) const
mstreamt & statistics() const