18 #ifndef _SDF_CONSOLE_HH_
19 #define _SDF_CONSOLE_HH_
33 #pragma warning(disable: 4251)
42 #define sdfdbg (sdf::Console::Instance()->Log("Dbg", \
46 #define sdfmsg (sdf::Console::Instance()->ColorMsg("Msg", \
47 __FILE__, __LINE__, 32))
50 #define sdfwarn (sdf::Console::Instance()->ColorMsg("Warning", \
51 __FILE__, __LINE__, 33))
54 #define sdferr (sdf::Console::Instance()->ColorMsg("Error", \
55 __FILE__, __LINE__, 31))
80 public:
template <
class T>
88 public:
void Prefix(
const std::string &_lbl,
89 const std::string &_file,
90 unsigned int _line,
int _color);
93 private: std::ostream *stream;
107 public:
void SetQuiet(
bool _q);
115 public: ConsoleStream &ColorMsg(
const std::string &lbl,
116 const std::string &file,
117 unsigned int line,
int color);
121 public: ConsoleStream &Log(
const std::string &lbl,
122 const std::string &file,
127 private: std::unique_ptr<ConsolePrivate> dataPtr;
152 *this->stream << _rhs;
Console::ConsoleStream msgStream
message stream
Definition: Console.hh:138
An ostream-like class that we'll use for logging.
Definition: Console.hh:68
Message, error, warning, and logging functionality.
Definition: Console.hh:65
std::shared_ptr< Console > ConsolePtr
Definition: Console.hh:62
std::ofstream logFileStream
logfile stream
Definition: Console.hh:144
ConsolePrivate()
Constructor.
Definition: Console.hh:135
Definition: Console.hh:132
static ConsolePtr Instance()
Return an instance to this class.
Console::ConsoleStream logStream
log stream
Definition: Console.hh:141
#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:73