Go to the documentation of this file.
10 #ifndef CPROVER_UTIL_MESSAGE_H
11 #define CPROVER_UTIL_MESSAGE_H
33 virtual void print(
unsigned level,
const std::string &
message)=0;
44 virtual void flush(
unsigned) = 0;
63 virtual std::string
command(
unsigned)
const
172 const std::string &user_input,
185 "message handler should be set before calling get_message_handler");
224 unsigned _message_level,
248 if(this->tellp() > 0)
262 static_cast<std::ostream &
>(*this) << x;
296 m.str(std::string());
422 const std::function<
void(mstreamt &)> &output_generator)
const;
429 #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
virtual void print(unsigned level, const xmlt &xml)=0
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
static const char * message(const static_verifier_resultt::statust &status)
Makes a status message string from a status.
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
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)
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
virtual void print(unsigned level, const jsont &json)=0
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
mstreamt(const mstreamt &other)=delete
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