Skip to content

Commit 75944d8

Browse files
committed
Add toString method to the little<TYPE> and little_pod<TYPE> classes, and fix mongo/logger/log_test failure
1 parent 4ba0525 commit 75944d8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/mongo/bson/util/bswap.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ namespace mongo {
184184
\
185185
friend Nullstream& operator<<( Nullstream& ost, MYTYPE val ) { \
186186
return ost << T(val); \
187+
} \
188+
\
189+
std::string toString() const { \
190+
std::stringstream ss; \
191+
ss << this; \
192+
return ss.str(); \
187193
}
188194

189195

src/mongo/logger/logstream_builder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ namespace logger {
103103

104104
template <typename T>
105105
LogstreamBuilder& operator<<(const T& x) {
106-
//stream() << x.toString();
106+
stream() << x.toString();
107107
return *this;
108108
}
109109

0 commit comments

Comments
 (0)