diff options
author | ADAM David Alan Martin <adam.martin@10gen.com> | 2018-05-03 15:19:40 -0400 |
---|---|---|
committer | ADAM David Alan Martin <adam.martin@10gen.com> | 2018-05-03 16:17:11 -0400 |
commit | 6b23bd026bb74b1e44d93951662070076e99b361 (patch) | |
tree | 2cf83635a86435c920fa7282aaa391f87ef16abe /src/mongo/logger | |
parent | 397af5415328cbf53c7d70b514d25d32c7b8c3c6 (diff) | |
download | mongo-6b23bd026bb74b1e44d93951662070076e99b361.tar.gz |
SERVER-33909 More detailed error reporting from CAPI
The `libmongodbcapi.h` file now contains detailed documentation of
all preconditions, postconditions, and behaviors. All operations
now take a `libmongodbcapi_status *` argument which will be
populated with the failure results of an operation.
The internals of how the `libmongodbcapi_` functions are implemented
have been rewritten to catch and report nearly all failures, as well
as to use more native C++ idioms such as exceptions and RAII.
Diffstat (limited to 'src/mongo/logger')
-rw-r--r-- | src/mongo/logger/log_domain-impl.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/logger/log_domain-impl.h b/src/mongo/logger/log_domain-impl.h index 4d7bef91b58..1ebf5e11f18 100644 --- a/src/mongo/logger/log_domain-impl.h +++ b/src/mongo/logger/log_domain-impl.h @@ -81,8 +81,9 @@ template <typename E> auto LogDomain<E>::detachAppender(AppenderHandle handle) -> std::unique_ptr<EventAppender> { // So technically this could just return a moved unique_ptr reference // Still, eliding is a thing so swap is a nice certainty. - std::unique_ptr<EventAppender> appender{nullptr}; - appender.swap(_appenders.at(handle._index)); + std::unique_ptr<EventAppender> appender; + using std::swap; + swap(appender, _appenders.at(handle._index)); return appender; } |