mCRL2
Loading...
Searching...
No Matches
mcrl2::log::file_output Class Reference

File output class. More...

#include <logger.h>

Inheritance diagram for mcrl2::log::file_output:
mcrl2::log::output_policy

Public Member Functions

 file_output ()
 
virtual ~file_output ()
 
virtual void output (const log_level_t level, const time_t timestamp, const std::string &msg, const bool print_time_information) override
 
- Public Member Functions inherited from mcrl2::log::output_policy
 output_policy ()
 Constructor.
 
virtual ~output_policy ()
 Destructor.
 
virtual void output (const log_level_t level, const time_t timestamp, const std::string &msg, const bool print_time_information)=0
 Output message.
 

Static Public Member Functions

static void set_stream (FILE *stream)
 

Static Protected Member Functions

static std::atomic< FILE * > & get_stream ()
 Obtain the underlying stream used to print to a file.
 

Detailed Description

File output class.

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

Definition at line 317 of file logger.h.

Constructor & Destructor Documentation

◆ file_output()

mcrl2::log::file_output::file_output ( )
inline

Definition at line 328 of file logger.h.

◆ ~file_output()

virtual mcrl2::log::file_output::~file_output ( )
inlinevirtual

Definition at line 331 of file logger.h.

Member Function Documentation

◆ get_stream()

static std::atomic< FILE * > & mcrl2::log::file_output::get_stream ( )
inlinestaticprotected

Obtain the underlying stream used to print to a file.

Definition at line 321 of file logger.h.

◆ output()

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

Output message to stream.

Parameters
[in]levelThe log level on which to output the message
[in]timestampThe timestamp to use for the message
[in]msgThe message to be printed
[in]print_time_informationA 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.

Implements mcrl2::log::output_policy.

Definition at line 350 of file logger.h.

◆ set_stream()

static void mcrl2::log::file_output::set_stream ( FILE *  stream)
inlinestatic
Parameters
[in]streamA file handle

Definition at line 336 of file logger.h.


The documentation for this class was generated from the following file: