Provides a convenient way to give formatted output.
static void Assert (bool condition, const std::string &message='Assert Failed.')
Checks if the specified condition is true.
static std::ostream & cout
Reference to cout, if necessary. static util::NullOutStream Debug
Dumps debug output into the bit nether regions. static util::PrefixedOutStream Fatal
Prints fatal messages prefixed with [FATAL], then terminates the program. static util::PrefixedOutStream Info
Prints informational messages if --verbose is specified, prefixed with [INFO ]. static util::PrefixedOutStream Warn
Prints warning messages prefixed with [WARN ].
Provides a convenient way to give formatted output.
The Log class has four members which can be used in the same way ostreams can be used:
Log::Debug
Log::Info
Log::Warn
Log::Fatal
Each of these will prefix a tag to the output (for easy filtering), and the fatal output will terminate the program when a newline is encountered. An example is given below.
Log::Info << "Checking a condition." << std::endl; if (!someCondition()) Log::Warn << "someCondition() is not satisfied!" << std::endl; Log::Info << "Checking an important condition." << std::endl; if (!someImportantCondition()) { Log::Fatal << "someImportantCondition() is not satisfied! Terminating."; Log::Fatal << std::endl; }
Any messages sent to Log::Debug will not be shown when compiling in non-debug mode. Messages to Log::Info will only be shown when the --verbose flag is given to the program (or rather, the CLI class).
See also:
PrefixedOutStream, NullOutStream, CLI
Definition at line 65 of file log.hpp.
Checks if the specified condition is true. If not, halts program execution and prints a custom error message. Does nothing in non-debug mode.
Referenced by mlpack::emst::EdgePair::EdgePair().
Reference to cout, if necessary.
Definition at line 98 of file log.hpp.
Dumps debug output into the bit nether regions.
Definition at line 84 of file log.hpp.
Referenced by mlpack::gmm::PositiveDefiniteConstraint::ApplyConstraint(), mlpack::gmm::GMM< FittingType >::GMM(), and mlpack::distribution::DiscreteDistribution::Probability().
Prints fatal messages prefixed with [FATAL], then terminates the program.
Definition at line 95 of file log.hpp.
Referenced by mlpack::kernel::SphericalKernel::ConvolutionIntegral(), and mlpack::gmm::EigenvalueRatioConstraint::EigenvalueRatioConstraint().
Prints informational messages if --verbose is specified, prefixed with [INFO ].
Definition at line 89 of file log.hpp.
Prints warning messages prefixed with [WARN ].
Definition at line 92 of file log.hpp.
Referenced by mlpack::gmm::EigenvalueRatioConstraint::EigenvalueRatioConstraint(), mlpack::amf::RandomAcolInitialization< p >::Initialize(), and mlpack::cf::CF< FactorizerType >::NumUsersForSimilarity().
Generated automatically by Doxygen for MLPACK from the source code.