\section{Log Class Reference}
\label{classmlpack_1_1Log}\index{Log@{Log}}


Provides a convenient way to give formatted output.  


\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static void \textbf{ Assert} (bool condition, const std\+::string \&message=\char`\"{}Assert Failed.\char`\"{})
\begin{DoxyCompactList}\small\item\em Checks if the specified condition is true. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Attributes}
\begin{DoxyCompactItemize}
\item 
static std\+::ostream \& \textbf{ cout}
\begin{DoxyCompactList}\small\item\em Reference to cout, if necessary. \end{DoxyCompactList}\item 
static M\+L\+P\+A\+C\+K\+\_\+\+E\+X\+P\+O\+RT \textbf{ util\+::\+Null\+Out\+Stream} \textbf{ Debug}
\begin{DoxyCompactList}\small\item\em M\+L\+P\+A\+C\+K\+\_\+\+E\+X\+P\+O\+RT is required for global variables, so that they are properly exported by the Windows compiler. \end{DoxyCompactList}\item 
static M\+L\+P\+A\+C\+K\+\_\+\+E\+X\+P\+O\+RT \textbf{ util\+::\+Prefixed\+Out\+Stream} \textbf{ Fatal}
\begin{DoxyCompactList}\small\item\em Prints fatal messages prefixed with [F\+A\+T\+AL], then terminates the program. \end{DoxyCompactList}\item 
static M\+L\+P\+A\+C\+K\+\_\+\+E\+X\+P\+O\+RT \textbf{ util\+::\+Prefixed\+Out\+Stream} \textbf{ Info}
\begin{DoxyCompactList}\small\item\em Prints informational messages if --verbose is specified, prefixed with [I\+N\+FO ]. \end{DoxyCompactList}\item 
static M\+L\+P\+A\+C\+K\+\_\+\+E\+X\+P\+O\+RT \textbf{ util\+::\+Prefixed\+Out\+Stream} \textbf{ Warn}
\begin{DoxyCompactList}\small\item\em Prints warning messages prefixed with [W\+A\+RN ]. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Provides a convenient way to give formatted output. 

The \doxyref{Log}{p.}{classmlpack_1_1Log} class has four members which can be used in the same way ostreams can be used\+:


\begin{DoxyItemize}
\item \doxyref{Log\+::\+Debug}{p.}{classmlpack_1_1Log_afd147ffc8dcfdceaccad2fa1dde00e30}
\item \doxyref{Log\+::\+Info}{p.}{classmlpack_1_1Log_a6e069f745e1bbea8ccc4c1d39bf56089}
\item \doxyref{Log\+::\+Warn}{p.}{classmlpack_1_1Log_af8dd463e0db2840410fe6b1165429d5b}
\item \doxyref{Log\+::\+Fatal}{p.}{classmlpack_1_1Log_a5b72fcdfa48547883454fbc59be9caf1}
\end{DoxyItemize}

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.


\begin{DoxyCode}
Log::Info << \textcolor{stringliteral}{"Checking a condition."} << std::endl;
\textcolor{keywordflow}{if} (!someCondition())
  Log::Warn << \textcolor{stringliteral}{"someCondition() is not satisfied!"} << std::endl;
Log::Info << \textcolor{stringliteral}{"Checking an important condition."} << std::endl;
\textcolor{keywordflow}{if} (!someImportantCondition())
\{
  Log::Fatal << \textcolor{stringliteral}{"someImportantCondition() is not satisfied! Terminating."};
  Log::Fatal << std::endl;
\}
\end{DoxyCode}


Any messages sent to \doxyref{Log\+::\+Debug}{p.}{classmlpack_1_1Log_afd147ffc8dcfdceaccad2fa1dde00e30} will not be shown when compiling in non-\/debug mode. Messages to \doxyref{Log\+::\+Info}{p.}{classmlpack_1_1Log_a6e069f745e1bbea8ccc4c1d39bf56089} will only be shown when the --verbose flag is given to the program (or rather, the \doxyref{C\+LI}{p.}{classmlpack_1_1CLI} class).

\begin{DoxySeeAlso}{See also}
Prefixed\+Out\+Stream, Null\+Out\+Stream, \doxyref{C\+LI}{p.}{classmlpack_1_1CLI} 
\end{DoxySeeAlso}


Definition at line 56 of file log.\+hpp.



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1Log_acf2da487d1dac6cd100996cf82eba5e8}} 
\index{mlpack\+::\+Log@{mlpack\+::\+Log}!Assert@{Assert}}
\index{Assert@{Assert}!mlpack\+::\+Log@{mlpack\+::\+Log}}
\subsubsection{Assert()}
{\footnotesize\ttfamily static void Assert (\begin{DoxyParamCaption}\item[{bool}]{condition,  }\item[{const std\+::string \&}]{message = {\ttfamily \char`\"{}Assert~Failed.\char`\"{}} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



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 Edge\+Pair\+::\+Edge\+Pair(), and mlpack\+::tree\+::split\+::\+Perform\+Split().



\subsection{Member Data Documentation}
\mbox{\label{classmlpack_1_1Log_a6b0108441adaafe36dbe523901a38c35}} 
\index{mlpack\+::\+Log@{mlpack\+::\+Log}!cout@{cout}}
\index{cout@{cout}!mlpack\+::\+Log@{mlpack\+::\+Log}}
\subsubsection{cout}
{\footnotesize\ttfamily std\+::ostream\& cout\hspace{0.3cm}{\ttfamily [static]}}



Reference to cout, if necessary. 



Definition at line 93 of file log.\+hpp.

\mbox{\label{classmlpack_1_1Log_afd147ffc8dcfdceaccad2fa1dde00e30}} 
\index{mlpack\+::\+Log@{mlpack\+::\+Log}!Debug@{Debug}}
\index{Debug@{Debug}!mlpack\+::\+Log@{mlpack\+::\+Log}}
\subsubsection{Debug}
{\footnotesize\ttfamily M\+L\+P\+A\+C\+K\+\_\+\+E\+X\+P\+O\+RT \textbf{ util\+::\+Null\+Out\+Stream} Debug\hspace{0.3cm}{\ttfamily [static]}}



M\+L\+P\+A\+C\+K\+\_\+\+E\+X\+P\+O\+RT is required for global variables, so that they are properly exported by the Windows compiler. 

Dumps debug output into the bit nether regions. 

Definition at line 79 of file log.\+hpp.



Referenced by Diagonal\+G\+M\+M\+::\+Diagonal\+G\+M\+M(), G\+M\+M\+::\+G\+M\+M(), and mlpack\+::bindings\+::cli\+::\+Parse\+Command\+Line().

\mbox{\label{classmlpack_1_1Log_a5b72fcdfa48547883454fbc59be9caf1}} 
\index{mlpack\+::\+Log@{mlpack\+::\+Log}!Fatal@{Fatal}}
\index{Fatal@{Fatal}!mlpack\+::\+Log@{mlpack\+::\+Log}}
\subsubsection{Fatal}
{\footnotesize\ttfamily M\+L\+P\+A\+C\+K\+\_\+\+E\+X\+P\+O\+RT \textbf{ util\+::\+Prefixed\+Out\+Stream} Fatal\hspace{0.3cm}{\ttfamily [static]}}



Prints fatal messages prefixed with [F\+A\+T\+AL], then terminates the program. 



Definition at line 90 of file log.\+hpp.



Referenced by Positive\+Definite\+Constraint\+::\+Apply\+Constraint(), Eigenvalue\+Ratio\+Constraint\+::\+Apply\+Constraint(), Naive\+Kernel\+Rule$<$ Kernel\+Type $>$\+::\+Apply\+Kernel\+Matrix(), Nystroem\+Kernel\+Rule$<$ Kernel\+Type, Point\+Selection\+Policy $>$\+::\+Apply\+Kernel\+Matrix(), Spherical\+Kernel\+::\+Convolution\+Integral(), mlpack\+::util\+::\+Disable\+Backtrace(), Eigenvalue\+Ratio\+Constraint\+::\+Eigenvalue\+Ratio\+Constraint(), Average\+Interpolation\+::\+Get\+Weights(), Similarity\+Interpolation\+::\+Get\+Weights(), Regression\+Interpolation\+::\+Get\+Weights(), Mean\+Imputation$<$ T $>$\+::\+Impute(), Given\+Initialization\+::\+Initialize(), Given\+Initialization\+::\+Initialize\+One(), Z\+Score\+Normalization\+::\+Normalize(), mlpack\+::bindings\+::cli\+::\+Parse\+Command\+Line(), Discrete\+Distribution\+::\+Probability(), and Tf\+Idf\+Encoding\+Policy\+::serialize().

\mbox{\label{classmlpack_1_1Log_a6e069f745e1bbea8ccc4c1d39bf56089}} 
\index{mlpack\+::\+Log@{mlpack\+::\+Log}!Info@{Info}}
\index{Info@{Info}!mlpack\+::\+Log@{mlpack\+::\+Log}}
\subsubsection{Info}
{\footnotesize\ttfamily M\+L\+P\+A\+C\+K\+\_\+\+E\+X\+P\+O\+RT \textbf{ util\+::\+Prefixed\+Out\+Stream} Info\hspace{0.3cm}{\ttfamily [static]}}



Prints informational messages if --verbose is specified, prefixed with [I\+N\+FO ]. 



Definition at line 84 of file log.\+hpp.



Referenced by mlpack\+::util\+::\+Disable\+Verbose(), mlpack\+::util\+::\+Enable\+Verbose(), mlpack\+::bindings\+::cli\+::\+End\+Program(), Simple\+Residue\+Termination\+::\+Is\+Converged(), Simple\+Tolerance\+Termination$<$ Mat\+Type $>$\+::\+Is\+Converged(), Mountain\+Car\+::\+Is\+Terminal(), Continuous\+Mountain\+Car\+::\+Is\+Terminal(), Cart\+Pole\+::\+Is\+Terminal(), Pendulum\+::\+Is\+Terminal(), Acrobot\+::\+Is\+Terminal(), Double\+Pole\+Cart\+::\+Is\+Terminal(), Continuous\+Double\+Pole\+Cart\+::\+Is\+Terminal(), and mlpack\+::bindings\+::cli\+::\+Parse\+Command\+Line().

\mbox{\label{classmlpack_1_1Log_af8dd463e0db2840410fe6b1165429d5b}} 
\index{mlpack\+::\+Log@{mlpack\+::\+Log}!Warn@{Warn}}
\index{Warn@{Warn}!mlpack\+::\+Log@{mlpack\+::\+Log}}
\subsubsection{Warn}
{\footnotesize\ttfamily M\+L\+P\+A\+C\+K\+\_\+\+E\+X\+P\+O\+RT \textbf{ util\+::\+Prefixed\+Out\+Stream} Warn\hspace{0.3cm}{\ttfamily [static]}}



Prints warning messages prefixed with [W\+A\+RN ]. 



Definition at line 87 of file log.\+hpp.



Referenced by Eigenvalue\+Ratio\+Constraint\+::\+Eigenvalue\+Ratio\+Constraint(), Random\+Acol\+Initialization$<$ columns\+To\+Average $>$\+::\+Initialize(), Max\+Iteration\+Termination\+::\+Max\+Iteration\+Termination(), and C\+F\+Type$<$ Decomposition\+Policy, Normalization\+Type $>$\+::\+Num\+Users\+For\+Similarity().



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
/var/www/mlpack.\+ratml.\+org/mlpack.\+org/\+\_\+src/mlpack-\/3.\+3.\+0/src/mlpack/core/util/\textbf{ log.\+hpp}\end{DoxyCompactItemize}
