Visual Computing Library
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/misc/logger/null_logger.h>

Inheritance diagram for vcl::NullLogger:

Public Member Functions

void enableIndentation () override final
 
void disableIndentation () override final
 
void enablePrintPercentage () override final
 
void disablePrintPercentage () override final
 
void setPrintLevel (LogLevel) override final
 Sets the maximum print level of the logger.
 
void enablePrintMessageDuringProgress () override final
 
void disablePrintMessageDuringProgress () override final
 
void enablePrintTimer () override final
 
void disablePrintTimer () override final
 
void reset () override final
 
void setMaxLineWidth (uint) override final
 
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.
 
void startNewTask (double, double, const std::string &) override final
 
void endTask (const std::string &) override final
 
double percentage () const override final
 
void setPercentage (uint) 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.
 
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 endProgress () override final
 Allows to easily manage progresses with the logger, along with the startProgress and progress member functions.
 
void progress (uint) override final
 Allows to easily manage progresses with the logger, along with the startProgress and endProgress member functions.
 

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();
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:84
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43

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: