Visual Computing Library  devel
Loading...
Searching...
No Matches
vcl::NullLogger Class Reference

The NullLogger class is used as default type in all the library functions that take as input a logger type. More...

#include <vclib/base/logger/null_logger.h>

Inheritance diagram for vcl::NullLogger:

Public Member Functions

void disableIndentation () override final
 
void disablePrintMessageDuringProgress () override final
 
void disablePrintPercentage () override final
 
void disablePrintTimer () override final
 
void enableIndentation () override final
 
void enablePrintMessageDuringProgress () override final
 
void enablePrintPercentage () override final
 
void enablePrintTimer () override final
 
void endProgress () override final
 Allows to easily manage progresses with the logger, along with the startProgress and progress member functions.
 
void endTask (const std::string &) override final
 
void log (const std::string &) const override final
 Prints a message to the logger, with level LogLevel::PROGRESS and without modifying the current percentage.
 
void log (const std::string &, LogLevel) const override final
 Prints a message to the logger, with the given level and without modifying the current percentage.
 
void log (uint, const std::string &) override final
 Prints a message to the logger, with the level LogLevel::PROGRESS and with the given percentage.
 
void log (uint, const std::string &, LogLevel) override final
 Prints a message to the logger, with the given level and with the given percentage.
 
double percentage () const override final
 
void progress (uint) override final
 Allows to easily manage progresses with the logger, along with the startProgress and endProgress member functions.
 
void reset () override final
 
void setMaxLineWidth (uint) override final
 
void setPercentage (uint) override final
 
void setPrintLevel (LogLevel) override final
 Sets the maximum print level of the logger.
 
void startNewTask (double, double, const std::string &) override final
 
void startProgress (const std::string &, uint, uint=0, uint=0, uint=0) override final
 Allows to easily manage progresses with the logger, along with the progress and endProgress member functions.
 
void startTimer () override final
 
void stopTimer () override final
 
double time () const override final
 Returns the time passed since the last call to startTimer member function, or the time passed between the call to startTimer and the call to stopTimer member functions. The time is expressed in seconds.
 

Additional Inherited Members

- Public Types inherited from vcl::AbstractLogger
enum  LogLevel {
  ERROR_LOG = 0 , WARNING_LOG , MESSAGE_LOG , PROGRESS_LOG ,
  DEBUG_LOG
}
 

Detailed Description

The NullLogger class is used as default type in all the library functions that take as input a logger type.

This class satisfies the LoggerConcept, and just does nothing in all its member functions.

Member Function Documentation

◆ disableIndentation()

void vcl::NullLogger::disableIndentation ( )
inlinefinaloverridevirtual

Implements vcl::AbstractLogger.

◆ disablePrintMessageDuringProgress()

void vcl::NullLogger::disablePrintMessageDuringProgress ( )
inlinefinaloverridevirtual

Implements vcl::AbstractLogger.

◆ disablePrintPercentage()

void vcl::NullLogger::disablePrintPercentage ( )
inlinefinaloverridevirtual

Implements vcl::AbstractLogger.

◆ disablePrintTimer()

void vcl::NullLogger::disablePrintTimer ( )
inlinefinaloverridevirtual

Implements vcl::AbstractLogger.

◆ enableIndentation()

void vcl::NullLogger::enableIndentation ( )
inlinefinaloverridevirtual

Implements vcl::AbstractLogger.

◆ enablePrintMessageDuringProgress()

void vcl::NullLogger::enablePrintMessageDuringProgress ( )
inlinefinaloverridevirtual

Implements vcl::AbstractLogger.

◆ enablePrintPercentage()

void vcl::NullLogger::enablePrintPercentage ( )
inlinefinaloverridevirtual

Implements vcl::AbstractLogger.

◆ enablePrintTimer()

void vcl::NullLogger::enablePrintTimer ( )
inlinefinaloverridevirtual

Implements vcl::AbstractLogger.

◆ endProgress()

void vcl::NullLogger::endProgress ( )
inlinefinaloverridevirtual

Allows to easily manage progresses with the logger, along with the startProgress and progress member functions.

This logger functionality should be used when processing a loop having a fixed size, with regular prints of the progress.

This member function ends the current progress.

The typical usage is the following:

uint s = vec.size();
log.startProgress("Computing...", s);
for (uint i = 0; i < vec.size(); ++i) {
// make computations
log.progress(i); // will print only every 10% of progress
}
log.endProgress();
A class representing a box in N-dimensional space.
Definition box.h:46
PointT size() const
Computes the size of the box.
Definition box.h:267
void log(const std::string &) const override final
Prints a message to the logger, with level LogLevel::PROGRESS and without modifying the current perce...
Definition null_logger.h:82

Implements vcl::AbstractLogger.

◆ endTask()

void vcl::NullLogger::endTask ( const std::string &  )
inlinefinaloverridevirtual

Implements vcl::AbstractLogger.

◆ log() [1/4]

void vcl::NullLogger::log ( const std::string &  msg) const
inlinefinaloverridevirtual

Prints a message to the logger, with level LogLevel::PROGRESS and without modifying the current percentage.

Parameters
[in]msgThe message to print.

Implements vcl::AbstractLogger.

◆ log() [2/4]

void vcl::NullLogger::log ( const std::string &  msg,
LogLevel  lvl 
) const
inlinefinaloverridevirtual

Prints a message to the logger, with the given level and without modifying the current percentage.

Parameters
[in]msgThe message to print.
[in]lvlThe level of the message.

Implements vcl::AbstractLogger.

◆ log() [3/4]

void vcl::NullLogger::log ( uint  perc,
const std::string &  msg 
)
inlinefinaloverridevirtual

Prints a message to the logger, with the level LogLevel::PROGRESS and with the given percentage.

Parameters
[in]percThe percentage of the progress.
[in]msgThe message to print.

Implements vcl::AbstractLogger.

◆ log() [4/4]

void vcl::NullLogger::log ( uint  perc,
const std::string &  msg,
LogLevel  lvl 
)
inlinefinaloverridevirtual

Prints a message to the logger, with the given level and with the given percentage.

Parameters
[in]percThe percentage of the progress.
[in]msgThe message to print.
[in]lvlThe level of the message.

Implements vcl::AbstractLogger.

◆ percentage()

double vcl::NullLogger::percentage ( ) const
inlinefinaloverridevirtual

Implements vcl::AbstractLogger.

◆ progress()

void vcl::NullLogger::progress ( uint  n)
inlinefinaloverridevirtual

Allows to easily manage progresses with the logger, along with the startProgress and endProgress member functions.

This logger functionality should be used when processing a loop having a fixed size, with regular prints of the progress.

This member functions increments the current progress. Only if the current percentage reaches a new step percentage (set in the startProgress member function), a message will be printed by the logger.

The typical usage is the following:

uint s = vec.size();
log.startProgress("Computing...", s);
for (uint i = 0; i < vec.size(); ++i) {
// make computations
log.progress(i); // will print only every 10% of progress
}
log.endProgress();
Parameters
[in]niteration number of the current progress. It must be less than the progressSize argument of the startProgress member function.

Implements vcl::AbstractLogger.

◆ reset()

void vcl::NullLogger::reset ( )
inlinefinaloverridevirtual

Implements vcl::AbstractLogger.

◆ setMaxLineWidth()

void vcl::NullLogger::setMaxLineWidth ( uint  )
inlinefinaloverridevirtual

Implements vcl::AbstractLogger.

◆ setPercentage()

void vcl::NullLogger::setPercentage ( uint  )
inlinefinaloverridevirtual

Implements vcl::AbstractLogger.

◆ setPrintLevel()

void vcl::NullLogger::setPrintLevel ( LogLevel  level)
inlinefinaloverridevirtual

Sets the maximum print level of the logger.

Only messages with a level less or equal to the given level will be printed. For example, if the level is set to LogLevel::MESSAGE, only messages with level LogLevel::ERROR, LogLevel::WARNING and LogLevel::MESSAGE will be printed.

Note
The default level is LogLevel::PROGRESS.
Parameters
[in]levelThe maximum print level of the logger.

Implements vcl::AbstractLogger.

◆ startNewTask()

void vcl::NullLogger::startNewTask ( double  ,
double  ,
const std::string &   
)
inlinefinaloverridevirtual

Implements vcl::AbstractLogger.

◆ startProgress()

void vcl::NullLogger::startProgress ( const std::string &  msg,
uint  progressSize,
uint  percPrintProgress = 0,
uint  startPerc = 0,
uint  endPerc = 0 
)
inlinefinaloverridevirtual

Allows to easily manage progresses with the logger, along with the progress and endProgress member functions.

This logger functionality should be used when processing a loop having a fixed size, with regular prints of the progress.

This member function starts a new progress. With the default arguments, will print a message from 0% to 100%, every 10%.

The typical usage is the following:

log.startProgress("Computing...", vec.size());
for (uint i = 0; i < vec.size(); ++i) {
// make computations
log.progress(i); // will print only every 10% of progress
}
log.endProgress();
Parameters
[in]msgthe message that will be printed during the progress
[in]progressSizethe number of iterations made during the progress
[in]percPrintProgressinterval of percentage on which print a progress message, default 10%
[in]startPercstart percentage of the progress, default 0%
[in]endPercend percentage of the progress, default 100%

Implements vcl::AbstractLogger.

◆ startTimer()

void vcl::NullLogger::startTimer ( )
inlinefinaloverridevirtual

Implements vcl::AbstractLogger.

◆ stopTimer()

void vcl::NullLogger::stopTimer ( )
inlinefinaloverridevirtual

Implements vcl::AbstractLogger.

◆ time()

double vcl::NullLogger::time ( ) const
inlinefinaloverridevirtual

Returns the time passed since the last call to startTimer member function, or the time passed between the call to startTimer and the call to stopTimer member functions. The time is expressed in seconds.

Returns
The time passed, expressed in seconds.

Implements vcl::AbstractLogger.


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