58 va_start(argp, format);
59 vsnprintf(buffer,
sizeof(buffer), format, argp);
74 PetscErrorCode ierr = PetscFPrintf(
m_impl->
com, PETSC_STDOUT,
"%s", buffer);
82 va_start(argp, format);
83 vsnprintf(buffer,
sizeof(buffer), format, argp);
90 PetscErrorCode ierr = PetscFPrintf(
m_impl->
com, stderr, buffer);
112 result->get_threshold());
114 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)