18 #ifndef _SDF_CONSOLE_HH_
19 #define _SDF_CONSOLE_HH_
25 #include <boost/shared_ptr.hpp>
35 #define sdfdbg (sdf::Console::Instance()->Log("Dbg", \
39 #define sdfmsg (sdf::Console::Instance()->ColorMsg("Msg", \
40 __FILE__, __LINE__, 32))
43 #define sdfwarn (sdf::Console::Instance()->ColorMsg("Warning", \
44 __FILE__, __LINE__, 33))
47 #define sdferr (sdf::Console::Instance()->ColorMsg("Error", \
48 __FILE__, __LINE__, 31))
68 public:
template <
class T>
76 public:
void Prefix(
const std::string &_lbl,
77 const std::string &_file,
78 unsigned int _line,
int _color);
81 private: std::ostream *stream;
91 public:
static boost::shared_ptr<Console> Instance();
95 public:
void SetQuiet(
bool _q);
103 public: ConsoleStream &ColorMsg(
const std::string &lbl,
104 const std::string &file,
105 unsigned int line,
int color);
109 public: ConsoleStream &Log(
const std::string &lbl,
110 const std::string &file,
138 *this->stream << _rhs;
Console::ConsoleStream msgStream
message stream
Definition: Console.hh:124
An ostream-like class that we'll use for logging.
Definition: Console.hh:56
Message, error, warning, and logging functionality.
Definition: Console.hh:53
std::ofstream logFileStream
logfile stream
Definition: Console.hh:130
ConsolePrivate()
Constructor.
Definition: Console.hh:121
Definition: Console.hh:118
Console::ConsoleStream logStream
log stream
Definition: Console.hh:127
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system_util.hh:48
ConsoleStream & operator<<(const T &_rhs)
Redirect whatever is passed in to both our ostream (if non-NULL) and the log file (if open)...
ConsoleStream(std::ostream *_stream)
Constructor.
Definition: Console.hh:61
static Console * Instance()
Return an instance to this class.