[ox/trace] Add delimiter setter to trace handlers

This commit is contained in:
Gary Talent 2018-09-01 21:52:26 -05:00
parent cbfd9566d1
commit 6648d941c9

View File

@ -56,6 +56,7 @@ class OutStream {
class StdOutStream { class StdOutStream {
private: private:
const char *m_delimiter = " ";
TraceMsg m_msg; TraceMsg m_msg;
public: public:
@ -67,11 +68,19 @@ class StdOutStream {
template<typename T> template<typename T>
constexpr inline StdOutStream &operator<<(const T &v) { constexpr inline StdOutStream &operator<<(const T &v) {
m_msg.msg += " "; m_msg.msg += m_delimiter;
m_msg.msg += v; m_msg.msg += v;
return *this; return *this;
} }
/**
* del sets the delimiter between log segments.
*/
inline StdOutStream &del(const char *delimiter) {
m_delimiter = delimiter;
return *this;
}
}; };
@ -90,6 +99,10 @@ class NullStream {
return *this; return *this;
} }
inline NullStream &del(const char*) {
return *this;
}
}; };
#ifdef DEBUG #ifdef DEBUG