MLPACK  1.0.8
log.hpp
Go to the documentation of this file.
1 
22 #ifndef __MLPACK_CORE_IO_LOG_HPP
23 #define __MLPACK_CORE_IO_LOG_HPP
24 
25 #include <string>
26 
27 #include "prefixedoutstream.hpp"
28 #include "nulloutstream.hpp"
29 
30 namespace mlpack {
31 
65 class Log
66 {
67  public:
73  static void Assert(bool condition,
74  const std::string& message = "Assert Failed.");
75 
76 
77  // We only use PrefixedOutStream if the program is compiled with debug
78  // symbols.
79 #ifdef DEBUG
82 #else
85 #endif
86 
90 
93 
96 
98  static std::ostream& cout;
99 };
100 
101 }; //namespace mlpack
102 
103 #endif
Provides a convenient way to give formatted output.
Definition: log.hpp:65
static void Assert(bool condition, const std::string &message="Assert Failed.")
Checks if the specified condition is true.
static util::PrefixedOutStream Fatal
Prints fatal messages prefixed with [FATAL], then terminates the program.
Definition: log.hpp:95
static util::PrefixedOutStream Info
Prints informational messages if –verbose is specified, prefixed with [INFO ].
Definition: log.hpp:89
static util::NullOutStream Debug
Dumps debug output into the bit nether regions.
Definition: log.hpp:84
static util::PrefixedOutStream Warn
Prints warning messages prefixed with [WARN ].
Definition: log.hpp:92
static std::ostream & cout
Reference to cout, if necessary.
Definition: log.hpp:98
Allows us to output to an ostream with a prefix at the beginning of each line, in the same way we wou...
Used for Log::Debug when not compiled with debugging symbols.