18 #ifndef _SDF_CONSOLE_HH_
19 #define _SDF_CONSOLE_HH_
32 #pragma warning(disable: 4251)
41 #define sdfdbg (sdf::Console::Instance()->Log("Dbg", __FILE__, __LINE__))
44 #define sdfmsg (sdf::Console::Instance()->ColorMsg("Msg", \
45 __FILE__, __LINE__, 32))
48 #define sdfwarn (sdf::Console::Instance()->ColorMsg("Warning", \
49 __FILE__, __LINE__, 33))
52 #define sdferr (sdf::Console::Instance()->ColorMsg("Error", \
53 __FILE__, __LINE__, 31))
78 public:
template <
class T>
86 public:
void Prefix(
const std::string &_lbl,
87 const std::string &_file,
88 unsigned int _line,
int _color);
91 private: std::ostream *stream;
104 public:
static void Clear();
108 public:
void SetQuiet(
bool _q);
116 public: ConsoleStream &ColorMsg(
const std::string &lbl,
117 const std::string &file,
118 unsigned int line,
int color);
122 public: ConsoleStream &Log(
const std::string &lbl,
123 const std::string &file,
128 private: std::unique_ptr<ConsolePrivate> dataPtr;
154 *this->stream << _rhs;
Console::ConsoleStream msgStream
message stream
Definition: Console.hh:139
An ostream-like class that we'll use for logging.
Definition: Console.hh:66
Message, error, warning, and logging functionality.
Definition: Console.hh:63
std::shared_ptr< Console > ConsolePtr
Definition: Console.hh:60
std::ofstream logFileStream
logfile stream
Definition: Console.hh:145
ConsolePrivate()
Constructor.
Definition: Console.hh:136
Definition: Console.hh:133
static ConsolePtr Instance()
Return an instance to this class.
Console::ConsoleStream logStream
log stream
Definition: Console.hh:142
#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:71