.TH "mlpack::Log" 3 "Tue Sep 9 2014" "Version 1.0.10" "MLPACK" \" -*- nroff -*- .ad l .nh .SH NAME mlpack::Log \- .PP Provides a convenient way to give formatted output\&. .SH SYNOPSIS .br .PP .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static void \fBAssert\fP (bool condition, const std::string &message='Assert Failed\&.')" .br .RI "\fIChecks if the specified condition is true\&. \fP" .in -1c .SS "Static Public Attributes" .in +1c .ti -1c .RI "static std::ostream & \fBcout\fP" .br .RI "\fIReference to cout, if necessary\&. \fP" .ti -1c .RI "static \fButil::NullOutStream\fP \fBDebug\fP" .br .RI "\fIDumps debug output into the bit nether regions\&. \fP" .ti -1c .RI "static \fButil::PrefixedOutStream\fP \fBFatal\fP" .br .RI "\fIPrints fatal messages prefixed with [FATAL], then terminates the program\&. \fP" .ti -1c .RI "static \fButil::PrefixedOutStream\fP \fBInfo\fP" .br .RI "\fIPrints informational messages if --verbose is specified, prefixed with [INFO ]\&. \fP" .ti -1c .RI "static \fButil::PrefixedOutStream\fP \fBWarn\fP" .br .RI "\fIPrints warning messages prefixed with [WARN ]\&. \fP" .in -1c .SH "Detailed Description" .PP Provides a convenient way to give formatted output\&. The \fBLog\fP class has four members which can be used in the same way ostreams can be used: .PP .IP "\(bu" 2 \fBLog::Debug\fP .IP "\(bu" 2 \fBLog::Info\fP .IP "\(bu" 2 \fBLog::Warn\fP .IP "\(bu" 2 \fBLog::Fatal\fP .PP .PP 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\&. .PP .PP .nf 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; } .fi .PP .PP Any messages sent to \fBLog::Debug\fP will not be shown when compiling in non-debug mode\&. Messages to \fBLog::Info\fP will only be shown when the --verbose flag is given to the program (or rather, the \fBCLI\fP class)\&. .PP \fBSee also:\fP .RS 4 PrefixedOutStream, NullOutStream, \fBCLI\fP .RE .PP .PP Definition at line 65 of file log\&.hpp\&. .SH "Member Function Documentation" .PP .SS "static void mlpack::Log::Assert (boolcondition, const std::string &message = \fC'Assert Failed\&.'\fP)\fC [static]\fP" .PP Checks if the specified condition is true\&. If not, halts program execution and prints a custom error message\&. Does nothing in non-debug mode\&. .PP Referenced by mlpack::emst::EdgePair::EdgePair()\&. .SH "Member Data Documentation" .PP .SS "std::ostream& mlpack::Log::cout\fC [static]\fP" .PP Reference to cout, if necessary\&. .PP Definition at line 98 of file log\&.hpp\&. .SS "\fButil::NullOutStream\fP mlpack::Log::Debug\fC [static]\fP" .PP Dumps debug output into the bit nether regions\&. .PP Definition at line 84 of file log\&.hpp\&. .PP Referenced by mlpack::gmm::PositiveDefiniteConstraint::ApplyConstraint(), mlpack::gmm::GMM< FittingType >::GMM(), and mlpack::distribution::DiscreteDistribution::Probability()\&. .SS "\fButil::PrefixedOutStream\fP mlpack::Log::Fatal\fC [static]\fP" .PP Prints fatal messages prefixed with [FATAL], then terminates the program\&. .PP Definition at line 95 of file log\&.hpp\&. .PP Referenced by mlpack::kernel::SphericalKernel::ConvolutionIntegral(), and mlpack::gmm::EigenvalueRatioConstraint::EigenvalueRatioConstraint()\&. .SS "\fButil::PrefixedOutStream\fP mlpack::Log::Info\fC [static]\fP" .PP Prints informational messages if --verbose is specified, prefixed with [INFO ]\&. .PP Definition at line 89 of file log\&.hpp\&. .SS "\fButil::PrefixedOutStream\fP mlpack::Log::Warn\fC [static]\fP" .PP Prints warning messages prefixed with [WARN ]\&. .PP Definition at line 92 of file log\&.hpp\&. .PP Referenced by mlpack::gmm::EigenvalueRatioConstraint::EigenvalueRatioConstraint(), mlpack::amf::RandomAcolInitialization< p >::Initialize(), and mlpack::cf::CF< FactorizerType >::NumUsersForSimilarity()\&. .SH "Author" .PP Generated automatically by Doxygen for MLPACK from the source code\&.