Go to the documentation of this file.
18 #ifndef SDF_CONSOLE_HH_
19 #define SDF_CONSOLE_HH_
33 #pragma warning(disable: 4251)
39 inline namespace SDF_VERSION_NAMESPACE {
46 #define sdfdbg (sdf::Console::Instance()->Log("Dbg", __FILE__, __LINE__))
49 #define sdfmsg (sdf::Console::Instance()->ColorMsg("Msg", \
50 __FILE__, __LINE__, 32))
53 #define sdfwarn (sdf::Console::Instance()->ColorMsg("Warning", \
54 __FILE__, __LINE__, 33))
57 #define sdferr (sdf::Console::Instance()->ColorMsg("Error", \
58 __FILE__, __LINE__, 31))
83 public:
template <
class T>
91 public:
void Prefix(
const std::string &_lbl,
92 const std::string &_file,
93 unsigned int _line,
int _color);
99 public:
void SetStream(std::ostream *_stream);
103 public: std::ostream *GetStream();
106 private: std::ostream *stream;
119 public:
static void Clear();
123 public:
void SetQuiet(
bool _q);
131 public: ConsoleStream &ColorMsg(
const std::string &lbl,
132 const std::string &file,
133 unsigned int line,
int color);
140 public: ConsoleStream &Log(
const std::string &lbl,
141 const std::string &file,
148 public: ConsoleStream &GetMsgStream();
154 public: ConsoleStream &GetLogStream();
158 private: std::unique_ptr<ConsolePrivate> dataPtr;
184 *this->stream << _rhs;
namespace for Simulation Description Format parser
Definition: Actor.hh:34
ConsolePrivate()
Constructor.
Definition: Console.hh:166
ConsoleStream & operator<<(const T &_rhs)
Redirect whatever is passed in to both our ostream (if non-NULL) and the log file (if open).
Definition: Console.hh:163
static ConsolePtr Instance()
Return an instance to this class.
An ostream-like class that we'll use for logging.
Definition: Console.hh:71
#define SDFORMAT_VISIBLE
Definition: system_util.hh:25
Message, error, warning, and logging functionality.
Definition: Console.hh:68
std::shared_ptr< Console > ConsolePtr
Definition: Console.hh:65
std::ostream & operator<<(std::ostream &os, ParamStreamer< T > s)
Definition: Param.hh:94
std::ofstream logFileStream
logfile stream
Definition: Console.hh:175
ConsoleStream(std::ostream *_stream)
Constructor.
Definition: Console.hh:76
Console::ConsoleStream msgStream
message stream
Definition: Console.hh:169
Console::ConsoleStream logStream
log stream
Definition: Console.hh:172