18 #ifndef _SDF_CONSOLE_HH_
19 #define _SDF_CONSOLE_HH_
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))
73 public:
template <
class T>
81 public:
void Prefix(
const std::string &_lbl,
82 const std::string &_file,
83 unsigned int _line,
int _color);
86 private: std::ostream *stream;
100 public:
void SetQuiet(
bool _q);
108 public: ConsoleStream &ColorMsg(
const std::string &lbl,
109 const std::string &file,
110 unsigned int line,
int color);
114 public: ConsoleStream &Log(
const std::string &lbl,
115 const std::string &file,
118 private: std::unique_ptr<ConsolePrivate> dataPtr;
143 *this->stream << _rhs;
Console::ConsoleStream msgStream
message stream
Definition: Console.hh:129
An ostream-like class that we'll use for logging.
Definition: Console.hh:61
Message, error, warning, and logging functionality.
Definition: Console.hh:58
std::shared_ptr< Console > ConsolePtr
Definition: Console.hh:55
std::ofstream logFileStream
logfile stream
Definition: Console.hh:135
ConsolePrivate()
Constructor.
Definition: Console.hh:126
Definition: Console.hh:123
static ConsolePtr Instance()
Return an instance to this class.
Console::ConsoleStream logStream
log stream
Definition: Console.hh:132
#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:66