mcrl2::log::file_output

Include file:

#include "mcrl2/utilities/logger.h
class mcrl2::log::file_output

File output class.

Provides facilities to output to a file. By default output is sent to stderr.

Protected static member functions

static std::map<std::string, FILE *> &hint_to_stream()

Map hints to streams This allows messages with different hints to be written to different output streams.

Protected member functions

FILE *get_stream(const std::string &hint)

Gets a stream handle for hint.

Parameters:

  • hint Hint for which to provide a stream handle.

Public member functions

file_output()
virtual void output(const log_level_t level, const std::string &hint, const time_t timestamp, const std::string &msg, const bool print_time_information)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Output message to stream.

Parameters:

  • level The log level on which to output the message

  • timestamp The timestamp to use for the message

  • msg The message to be printed

  • hint The hint of the stream to which we print.

  • print_time_information A boolean that if true indicates that time usage information must be printed. If false this information is suppressed.

Note

This uses fprintf (and not e.g. <<) because fprintf is guaranteed to be atomic.

virtual ~file_output()

Public static member functions

static void set_stream(FILE *stream, const std::string &hint = logger::default_hint())

Set stream handle for a hint.

Parameters:

  • stream A file handle

  • hint The hint for which to set the handle to stream.