Visual Computing Library
Loading...
Searching...
No Matches
vcl::ConsoleLogger Class Reference
Inheritance diagram for vcl::ConsoleLogger:

Public Member Functions

 ConsoleLogger (std::ostream &errStream, std::ostream &warnStream, std::ostream &msgStream, std::ostream &progStream, std::ostream &debugStream)
 
- Public Member Functions inherited from vcl::AbstractLogger
virtual void enableIndentation ()=0
 
virtual void disableIndentation ()=0
 
virtual void enablePrintPercentage ()=0
 
virtual void disablePrintPercentage ()=0
 
virtual void setPrintLevel (LogLevel level)=0
 Sets the maximum print level of the logger.
 
virtual void enablePrintMessageDuringProgress ()=0
 
virtual void disablePrintMessageDuringProgress ()=0
 
virtual void enablePrintTimer ()=0
 
virtual void disablePrintTimer ()=0
 
virtual void reset ()=0
 
virtual void setMaxLineWidth (uint width)=0
 
virtual void startTimer ()=0
 
virtual void stopTimer ()=0
 
virtual double time () const =0
 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.
 
virtual void startNewTask (double fromPerc, double toPerc, const std::string &action)=0
 
virtual void endTask (const std::string &action)=0
 
virtual double percentage () const =0
 
virtual void setPercentage (uint newPerc)=0
 
virtual void log (const std::string &msg) const =0
 Prints a message to the logger, with level LogLevel::PROGRESS and without modifying the current percentage.
 
virtual void log (const std::string &msg, LogLevel lvl) const =0
 Prints a message to the logger, with the given level and without modifying the current percentage.
 
virtual void log (uint perc, const std::string &msg)=0
 Prints a message to the logger, with the level LogLevel::PROGRESS and with the given percentage.
 
virtual void log (uint perc, const std::string &msg, LogLevel lvl)=0
 Prints a message to the logger, with the given level and with the given percentage.
 
virtual void startProgress (const std::string &msg, uint progressSize, uint percPrintProgress=10, uint startPerc=0, uint endPerc=100)=0
 Allows to easily manage progresses with the logger, along with the progress and endProgress member functions.
 
virtual void endProgress ()=0
 Allows to easily manage progresses with the logger, along with the startProgress and progress member functions.
 
virtual void progress (uint n)=0
 Allows to easily manage progresses with the logger, along with the startProgress and endProgress member functions.
 

Protected Member Functions

std::ostream * levelStream (LogLevel lvl) const override
 
void alignLeft (std::ostream &o) const override
 
void alignRight (std::ostream &o) const override
 
void setWidth (std::ostream &o, uint w) const override
 
void flush (std::ostream &o) const override
 

Private Attributes

std::ostream & mErrStream = std::cerr
 
std::ostream & mWarnStream = std::cout
 
std::ostream & mMsgStream = std::cout
 
std::ostream & mProgStream = std::cout
 
std::ostream & mDebugStream = std::cerr
 

Additional Inherited Members

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

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