mlpack  2.0.1
log.hpp
Go to the documentation of this file.
1 
14 #ifndef __MLPACK_CORE_UTIL_LOG_HPP
15 #define __MLPACK_CORE_UTIL_LOG_HPP
16 
17 #include <string>
18 
19 #include "prefixedoutstream.hpp"
20 #include "nulloutstream.hpp"
21 
22 namespace mlpack {
23 
57 class Log
58 {
59  public:
65  static void Assert(bool condition,
66  const std::string& message = "Assert Failed.");
67 
68 
69  // We only use PrefixedOutStream if the program is compiled with debug
70  // symbols.
71 #ifdef DEBUG
74 #else
77 #endif
78 
82 
85 
88 
90  static std::ostream& cout;
91 };
92 
93 }; //namespace mlpack
94 
95 #endif
Provides a convenient way to give formatted output.
Definition: log.hpp:57
Linear algebra utility functions, generally performed on matrices or vectors.
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:87
static util::PrefixedOutStream Info
Prints informational messages if –verbose is specified, prefixed with [INFO ].
Definition: log.hpp:81
static util::NullOutStream Debug
Dumps debug output into the bit nether regions.
Definition: log.hpp:76
static util::PrefixedOutStream Warn
Prints warning messages prefixed with [WARN ].
Definition: log.hpp:84
static std::ostream & cout
Reference to cout, if necessary.
Definition: log.hpp:90
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.