0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

SERVER-19802 Included compiled modules in --version output

This commit is contained in:
Jonathan Reams 2015-08-06 15:47:19 -04:00
parent f07b870a56
commit bb207cb438
3 changed files with 16 additions and 0 deletions

View File

@ -583,6 +583,7 @@ bool handlePreValidationMongodOptions(const moe::Environment& params,
log() << mongodVersion() << endl;
printGitVersion();
printOpenSSLVersion();
printCompiledModules();
return false;
}
if (params.count("sysinfo") && params["sysinfo"].as<bool>() == true) {

View File

@ -73,6 +73,20 @@ namespace mongo {
return modules_list;
}
void printCompiledModules() {
stringstream ss;
ss << "modules: ";
auto modules_list = compiledModules();
if (modules_list.size() == 0) {
ss << "none";
} else {
for (const auto& m: modules_list) {
ss << m << " ";
}
}
log() << ss.str();
}
bool isSameMajorVersion(const char* version) {
int major = -1, minor = -1;
pcrecpp::RE ver_regex("^(\\d+)\\.(\\d+)\\.");

View File

@ -47,6 +47,7 @@ const char* gitVersion();
const char* distName();
void printGitVersion();
std::vector<std::string> compiledModules();
void printCompiledModules();
// Checks whether another version is the same major version as us
bool isSameMajorVersion(const char* version);