PISM, A Parallel Ice Sheet Model
Classes | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
pism::Logger Class Reference

A basic logging class. More...

#include <Logger.hh>

+ Inheritance diagram for pism::Logger:

Classes

struct  Impl
 

Public Types

typedef std::shared_ptr< LoggerPtr
 
typedef std::shared_ptr< const LoggerConstPtr
 

Public Member Functions

 Logger (MPI_Comm com, int threshold)
 
virtual ~Logger ()
 
void message (int threshold, const char format[],...) const __attribute__((format(printf
 Print a message to the log. More...
 
void void message (int threshold, const std::string &text) const
 
void error (const char format[],...) const __attribute__((format(printf
 Print an error message to the log. More...
 
void void set_threshold (int level)
 Set verbosity threshold. More...
 
int get_threshold () const
 Get verbosity threshold. More...
 
void disable () const
 Silence the logger. More...
 
void enable () const
 (Re-)enable the logger. More...
 

Protected Member Functions

virtual void message_impl (const char buffer[]) const
 Do the hard work. Override this in a derived class to customize. More...
 
virtual void error_impl (const char buffer[]) const
 

Private Member Functions

 Logger (const Logger &)
 
Loggeroperator= (const Logger &)
 

Private Attributes

Implm_impl
 

Detailed Description

A basic logging class.

The default implementation (message_impl()) just prints to stdout on rank 0 of the communicator.

This class was created to make it possible to silence PISM's output when it is used as a library and make it possible to separate outputs from different PISM (IceModel, etc) instances running side by side.

Definition at line 40 of file Logger.hh.


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