10 #ifndef CPROVER_UTIL_MESSAGE_H
11 #define CPROVER_UTIL_MESSAGE_H
33 virtual void print(
unsigned level,
const std::string &message)=0;
43 const std::string &message,
46 virtual void flush(
unsigned) = 0;
65 virtual std::string
command(
unsigned)
const
83 void print(
unsigned level,
const std::string &message)
override
98 const std::string &message,
101 print(level, message);
116 void print(
unsigned level,
const std::string &message)
override
121 out << message <<
'\n';
174 const std::string &user_input,
187 "message handler should be set before calling get_message_handler");
219 unsigned _message_level,
243 if(this->tellp() > 0)
256 if(this->tellp() > 0)
268 static_cast<std::ostream &
>(*this) << x;
302 m.str(std::string());
428 const std::function<
void(mstreamt &)> &output_generator)
const;
void set_verbosity(unsigned _verbosity)
virtual void print(unsigned level, const std::string &message)=0
virtual void print(unsigned level, const jsont &json)=0
std::size_t get_message_count(unsigned level) const
virtual ~message_handlert()
std::vector< std::size_t > message_count
unsigned get_verbosity() const
virtual std::string command(unsigned) const
Create an ECMA-48 SGR (Select Graphic Rendition) command.
virtual void flush(unsigned)=0
virtual void print(unsigned level, const xmlt &xml)=0
commandt(unsigned _command)
mstreamt(const mstreamt &other, messaget &_message)
mstreamt & operator<<(const xmlt &data)
mstreamt(unsigned _message_level, messaget &_message)
mstreamt & operator<<(const structured_datat &data)
mstreamt(const mstreamt &other)=delete
source_locationt source_location
mstreamt & operator=(const mstreamt &other)=delete
void assign_from(const mstreamt &other)
Class that provides messages with a built-in verbosity 'level'.
static const commandt yellow
render text with yellow foreground color
friend mstreamt & operator<<(mstreamt &m, const commandt &c)
feed a command into an mstreamt
static const commandt bright_magenta
render text with bright magenta 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.
message_handlert * message_handler
mstreamt & statistics() const
static const commandt magenta
render text with magenta foreground color
mstreamt & warning() const
static const commandt reset
return to default formatting, as defined by the terminal
mstreamt & status() const
static const commandt green
render text with green foreground color
static const commandt faint
render text with faint font
static const commandt bold
render text with bold font
static const commandt bright_red
render text with bright red foreground color
messaget & operator=(const messaget &other)
static const commandt underline
render underlined text
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...
static const commandt bright_cyan
render text with bright cyan foreground color
static const commandt bright_yellow
render text with bright yellow foreground color
mstreamt & progress() const
mstreamt & get_mstream(unsigned message_level) const
mstreamt & result() const
message_handlert & get_message_handler()
virtual void set_message_handler(message_handlert &_message_handler)
messaget(const messaget &other)
static const commandt bright_blue
render text with bright blue foreground color
static const commandt italic
render italic text
static const commandt red
render text with red foreground color
messaget(message_handlert &_message_handler)
friend mstreamt & operator<<(mstreamt &m, eomt)
static commandt command(unsigned c)
Create an ECMA-48 SGR (Select Graphic Rendition) command.
static const commandt cyan
render text with cyan foreground color
static const commandt bright_green
render text with bright green foreground color
static const commandt blue
render text with blue foreground color
void print(unsigned level, const std::string &message) override
void print(unsigned, const jsont &) override
void print(unsigned level, const std::string &message, const source_locationt &) override
void print(unsigned, const xmlt &) override
void flush(unsigned) override
void print(unsigned, const xmlt &) override
void print(unsigned level, const std::string &message) override
stream_message_handlert(std::ostream &_out)
void print(unsigned, const jsont &) override
void flush(unsigned) override
A way of representing nested key/value data.
static void json(json_objectT &result, const irep_idt &property_id, const property_infot &property_info)
xmlt xml(const irep_idt &property_id, const property_infot &property_info)