summaryrefslogtreecommitdiff
path: root/src/glog/logging.h.in
diff options
context:
space:
mode:
Diffstat (limited to 'src/glog/logging.h.in')
-rw-r--r--src/glog/logging.h.in7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/glog/logging.h.in b/src/glog/logging.h.in
index b1de2c9..04cce1d 100644
--- a/src/glog/logging.h.in
+++ b/src/glog/logging.h.in
@@ -1107,6 +1107,12 @@ class GOOGLE_GLOG_DLL_DECL LogStreamBuf : public std::streambuf {
LogStreamBuf(char *buf, int len) {
setp(buf, buf + len - 2);
}
+
+ // Resets the buffer. Useful if we reuse it by means of TLS.
+ void reset() {
+ setp(pbase(), epptr());
+ }
+
// This effectively ignores overflow.
virtual int_type overflow(int_type ch) {
return ch;
@@ -1169,6 +1175,7 @@ public:
size_t pcount() const { return streambuf_.pcount(); }
char* pbase() const { return streambuf_.pbase(); }
char* str() const { return pbase(); }
+ void reset() { streambuf_.reset(); }
private:
LogStream(const LogStream&);