summaryrefslogtreecommitdiff
path: root/src/mongo/util/version.h
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2020-03-10 17:23:57 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-03-20 19:58:46 +0000
commitcddfeb0c7cb137d46b14da18a7cfd4905bfab87f (patch)
tree341d00e7c112cb94466990b75f129850e64c52fb /src/mongo/util/version.h
parent198a9d8ae3619362e00bd3a14e15e633ab731d18 (diff)
downloadmongo-cddfeb0c7cb137d46b14da18a7cfd4905bfab87f.tar.gz
SERVER-46765 fix '--version' & '--sysinfo', which use kPlain logging
Diffstat (limited to 'src/mongo/util/version.h')
-rw-r--r--src/mongo/util/version.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mongo/util/version.h b/src/mongo/util/version.h
index 0492afeb5bc..04ed69e4275 100644
--- a/src/mongo/util/version.h
+++ b/src/mongo/util/version.h
@@ -34,6 +34,7 @@
#include <vector>
#include "mongo/base/string_data.h"
+#include "mongo/bson/bsonobj.h"
namespace mongo {
@@ -144,7 +145,10 @@ public:
std::string makeVersionString(StringData binaryName) const;
/**
- * Appends the information associated with 'buildInfo', above, to the given builder.
+ * Appends several fields of build information to the `result`. One of them is
+ * "buildEnvironment", mapped to a subobject containing most of the information associated
+ * with 'buildInfo', above, but with the elements for which inBuildInfo == false
+ * removed.
*/
void appendBuildInfo(BSONObjBuilder* result) const;
@@ -154,9 +158,12 @@ public:
void logTargetMinOS() const;
/**
- * Logs the result of 'buildInfo', above.
+ * Logs similar info to `appendBuildInfo`, suitable for the --version flag or for a
+ * startup log message (trimmed for user-friendliness). The `buildInfo` data appear
+ * in a subobject mapped to the "environment" key, but with the elements for which
+ * inVersion == false removed. Puts to `os` if nonnull, else to LOGV2.
*/
- void logBuildInfo() const;
+ void logBuildInfo(std::ostream* os) const;
protected:
constexpr VersionInfoInterface() = default;