jrl::qp::utils::Logger Class Reference

#include <jrl-qp/utils/Logger.h>

Public Member Functions

 Logger (std::ostream &os, std::string name, std::uint32_t flags=0)
 
LoggersetFlag (std::uint32_t flag, bool add=true)
 
LoggersetOutputStream (std::ostream &os)
 
template<typename... Args>
void comment (std::uint32_t flag, Args &&... args) const
 
void startIter (int i)
 
template<typename... Args>
void log (std::uint32_t flag, Args &&... args) const
 
Logger subLog (const std::string &name) const
 
int iter () const
 

Detailed Description

Class for logging data in a Matlab-compatible way, with a filter based on a system of binary flags.

Constructor & Destructor Documentation

◆ Logger()

jrl::qp::utils::Logger::Logger ( std::ostream &  os,
std::string  name,
std::uint32_t  flags = 0 
)
inline
Parameters
osStream where the data will be logged.
nameName of the Matlab struct that will record the data.
flagsFlag for which the logger will effectively output something.

Member Function Documentation

◆ comment()

template<typename... Args>
void jrl::qp::utils::Logger::comment ( std::uint32_t  flag,
Args &&...  args 
) const
inline

Log a comment c, if flag pass the filter.

◆ iter()

int jrl::qp::utils::Logger::iter ( ) const
inline

Current iteration number.

◆ log()

template<typename... Args>
void jrl::qp::utils::Logger::log ( std::uint32_t  flag,
Args &&...  args 
) const
inline

Log a given number of values.

Parameters
flagFlag(s) for which the values should be logged.
argsSequence of pairs (name, value).

◆ setFlag()

Logger & jrl::qp::utils::Logger::setFlag ( std::uint32_t  flag,
bool  add = true 
)

Add or remove one or several (aggregated) flags to filter the data to log. If add is true, flag is added with a "or". If false, it is removed with a "and not".

◆ setOutputStream()

Logger & jrl::qp::utils::Logger::setOutputStream ( std::ostream &  os)

Set the output stream.

◆ startIter()

void jrl::qp::utils::Logger::startIter ( int  i)

Indicate that a new iteration of the solver is starting.

◆ subLog()

Logger jrl::qp::utils::Logger::subLog ( const std::string &  name) const

Return a sub-logger. It will act as a struct with data for the current iteration of its parent log.


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