diff options
author | Andy Schwerin <schwerin@mongodb.com> | 2015-05-07 16:45:29 -0400 |
---|---|---|
committer | Andy Schwerin <schwerin@mongodb.com> | 2015-05-13 17:58:55 -0400 |
commit | 532dfe1180c2da552bebed70af1e7fba34cf355c (patch) | |
tree | 9fb15c1576003307169bd249db500ad1aee21d99 /src/mongo/logger/logstream_builder.h | |
parent | cd97edbe4be0e6ddc9139a21e13594fd19a26a5e (diff) | |
download | mongo-532dfe1180c2da552bebed70af1e7fba34cf355c.tar.gz |
SERVER-13874 Make mongo::Milliseconds et al. aliases for equivalent stdx::chrono types.
Also introduces operators for adding stdx::chrono::duration to Date_t,
subtracting two Date_ts to get Milliseconds, and remove the use of
reinterpret_cast from the implementation of BSON Timestamp type.
Diffstat (limited to 'src/mongo/logger/logstream_builder.h')
-rw-r--r-- | src/mongo/logger/logstream_builder.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/logger/logstream_builder.h b/src/mongo/logger/logstream_builder.h index 7c923d6ece3..638534484ee 100644 --- a/src/mongo/logger/logstream_builder.h +++ b/src/mongo/logger/logstream_builder.h @@ -35,6 +35,7 @@ #include "mongo/logger/log_component.h" #include "mongo/logger/log_severity.h" #include "mongo/logger/message_log_domain.h" +#include "mongo/stdx/chrono.h" #include "mongo/util/exit_code.h" namespace mongo { @@ -130,6 +131,12 @@ namespace logger { LogstreamBuilder& operator<<(unsigned long long x) { stream() << x; return *this; } LogstreamBuilder& operator<<(bool x) { stream() << x; return *this; } + template <typename Rep, typename Period> + LogstreamBuilder& operator<<(stdx::chrono::duration<Rep, Period> d) { + stream() << d; + return *this; + } + template <typename T> LogstreamBuilder& operator<<(const T& x) { stream() << x.toString(); |