25 #include "pism/util/Logger.hh"
26 #include "pism/util/pism_options.hh"
27 #include "pism/util/error_handling.hh"
57 va_start(argp, format);
58 vsnprintf(buffer,
sizeof(buffer), format, argp);
73 PetscErrorCode ierr = PetscFPrintf(
m_impl->
com, PETSC_STDOUT,
"%s", buffer);
81 va_start(argp, format);
82 vsnprintf(buffer,
sizeof(buffer), format, argp);
89 PetscErrorCode ierr = PetscFPrintf(
m_impl->
com, stderr,
"%s", buffer);
111 result->get_threshold());
113 result->set_threshold(verbosity);
void disable() const
Silence the logger.
void void set_threshold(int level)
Set verbosity threshold.
void message(int threshold, const char format[],...) const __attribute__((format(printf
Print a message to the log.
virtual void error_impl(const char buffer[]) const
Logger(MPI_Comm com, int threshold)
std::shared_ptr< Logger > Ptr
virtual void message_impl(const char buffer[]) const
Do the hard work. Override this in a derived class to customize.
void error(const char format[],...) const __attribute__((format(printf
Print an error message to the log.
int get_threshold() const
Get verbosity threshold.
void enable() const
(Re-)enable the logger.
virtual void error_impl(const char buffer[]) const
virtual void message_impl(const char buffer[]) const
Do the hard work. Override this in a derived class to customize.
StringLogger(MPI_Comm com, int threshold)
#define PISM_CHK(errcode, name)
Logger::Ptr logger_from_options(MPI_Comm com)