HermesCommon  3.0
Hermes::Mixins::Loggable Class Reference

Class the output of which is loggable, i.e. that uses functionality of info(), warn() Contains the class Static with the following usage: Anywhere in your program you can write Hermes::Mixins::Loggable::Static::info("whatever you want to output"). More...

#include <mixins.h>

+ Inheritance diagram for Hermes::Mixins::Loggable:

Classes

class  Static
 For static logging. More...
 

Public Member Functions

 Loggable (bool verbose_output=false, callbackFn verbose_callback=NULL, bool add_newline=true)
 
void set_file_output_only (bool onOff)
 
void set_timestamps (bool onOff)
 Sets the addition of a time stamp on each line in the log file. By default it is on.
 
void set_erase_on_beginning (bool onOff)
 Sets the logFile being always erased before logging.
 
void set_logFile_name (const char *filename)
 
void set_logFile_name (std::string filename)
 
void info (const char *msg,...) const
 
void info_if (bool cond, const char *msg,...) const
 
void warn (const char *msg,...) const
 
void warn_if (bool cond, const char *msg,...) const
 
void error (const char *msg,...) const
 
void error_if (bool cond, const char *msg,...) const
 
virtual void set_verbose_output (bool to_set)
 
bool get_verbose_output () const
 Returns the current value of verbose_output;.
 
virtual void set_verbose_callback (callbackFn callback)
 
callbackFn get_verbose_callback () const
 Returns the current value of verbose_callback;.
 

Static Public Member Functions

static void set_static_logFile_name (const char *filename)
 
static void set_static_logFile_name (std::string filename)
 

Public Attributes

char * logFileName
 Logfile name.
 

Static Public Attributes

static char * staticLogFileName = nullptr
 

Protected Member Functions

void hermes_fwrite (const void *ptr, size_t size, size_t nitems, FILE *stream) const
 
void hermes_fread (void *ptr, size_t size, size_t nitems, FILE *stream) const
 

Detailed Description

Class the output of which is loggable, i.e. that uses functionality of info(), warn() Contains the class Static with the following usage: Anywhere in your program you can write Hermes::Mixins::Loggable::Static::info("whatever you want to output").

Definition at line 62 of file mixins.h.

Member Function Documentation

void Hermes::Mixins::Loggable::set_verbose_callback ( callbackFn  callback)
virtual

Provides a callback for logging.

Parameters
[in]callbackFunction to be called for the messaging when verbose_output is set to yes.
Todo:
Use this in solvers etc.

Definition at line 557 of file mixins.cpp.

void Hermes::Mixins::Loggable::set_verbose_output ( bool  to_set)
virtual

Sets the attribute verbose_output to the paramater option passed.

Todo:
Use this in solvers etc.

Reimplemented in Hermes::Solvers::MatrixSolver< Scalar >.

Definition at line 552 of file mixins.cpp.

Referenced by Hermes::Solvers::MatrixSolver< Scalar >::set_verbose_output().


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