Ejemplo n.º 1
0
void VersionInfoInterface::logBuildInfo() const {
    log() << "git version: " << gitVersion();

#if defined(MONGO_CONFIG_SSL) && MONGO_CONFIG_SSL_PROVIDER == MONGO_CONFIG_SSL_PROVIDER_OPENSSL
    log() << openSSLVersion("OpenSSL version: ");
#endif

    log() << "allocator: " << allocator();

    std::stringstream ss;
    ss << "modules: ";
    auto modules_list = modules();
    if (modules_list.size() == 0) {
        ss << "none";
    } else {
        for (const auto& m : modules_list) {
            ss << m << " ";
        }
    }
    log() << ss.str();

    log() << "build environment:";
    for (auto&& envDataEntry : buildInfo()) {
        if (std::get<3>(envDataEntry)) {
            auto val = std::get<1>(envDataEntry);
            if (val.size() == 0)
                continue;
            log() << "    " << std::get<0>(envDataEntry) << ": " << std::get<1>(envDataEntry);
        }
    }
}
Ejemplo n.º 2
0
    void printShardingVersionInfo( bool out ) {
        if ( out ) {
            cout << "MongoS version " << versionString << " starting: pid=" <<
                ProcessId::getCurrent() << " port=" << cmdLine.port <<
                ( sizeof(int*) == 4 ? " 32" : " 64" ) << "-bit host=" << getHostNameCached() <<
                " (--help for usage)" << endl;
            DEV cout << "_DEBUG build" << endl;
            cout << "git version: " << gitVersion() << endl;
#ifdef MONGO_SSL
            cout << "OpenSSL version: " << openSSLVersion() << endl;
#endif
            cout <<  "build sys info: " << sysInfo() << endl;
        }
        else {
            log() << "MongoS version " << versionString << " starting: pid=" <<
                ProcessId::getCurrent() << " port=" << cmdLine.port <<
                ( sizeof( int* ) == 4 ? " 32" : " 64" ) << "-bit host=" << getHostNameCached() <<
                " (--help for usage)" << endl;
            DEV log() << "_DEBUG build" << endl;
            printGitVersion();
#ifdef MONGO_SSL
            printOpenSSLVersion();
#endif
            printSysInfo();
            printCommandLineOpts();
        }
    }
Ejemplo n.º 3
0
void VersionInfoInterface::appendBuildInfo(BSONObjBuilder* result) const {
    *result << "version" << version() << "gitVersion" << gitVersion()
#if defined(_WIN32)
            << "targetMinOS" << targetMinOS()
#endif
            << "modules" << modules() << "allocator" << allocator() << "javascriptEngine"
            << jsEngine() << "sysInfo"
            << "deprecated";

    BSONArrayBuilder versionArray(result->subarrayStart("versionArray"));
    versionArray << majorVersion() << minorVersion() << patchVersion() << extraVersion();
    versionArray.done();

    BSONObjBuilder opensslInfo(result->subobjStart("openssl"));
#ifdef MONGO_CONFIG_SSL
#if MONGO_CONFIG_SSL_PROVIDER == MONGO_CONFIG_SSL_PROVIDER_OPENSSL
    opensslInfo << "running" << openSSLVersion() << "compiled" << OPENSSL_VERSION_TEXT;
#elif MONGO_CONFIG_SSL_PROVIDER == MONGO_CONFIG_SSL_PROVIDER_WINDOWS
    opensslInfo << "running"
                << "Windows SChannel";
#elif MONGO_CONFIG_SSL_PROVIDER == MONGO_CONFIG_SSL_PROVIDER_APPLE
    opensslInfo << "running"
                << "Apple Secure Transport";
#else
#error "Unknown SSL Provider"
#endif  // MONGO_CONFIG_SSL_PROVIDER
#else
    opensslInfo << "running"
                << "disabled"
                << "compiled"
                << "disabled";
#endif
    opensslInfo.done();

    BSONObjBuilder buildvarsInfo(result->subobjStart("buildEnvironment"));
    for (auto&& envDataEntry : buildInfo()) {
        if (std::get<2>(envDataEntry)) {
            buildvarsInfo << std::get<0>(envDataEntry) << std::get<1>(envDataEntry);
        }
    }
    buildvarsInfo.done();

    *result << "bits" << (int)sizeof(void*) * 8;
    result->appendBool("debug", kDebugBuild);
    result->appendNumber("maxBsonObjectSize", BSONObjMaxUserSize);
}
Ejemplo n.º 4
0
void printShardingVersionInfo(bool out) {
    if (out) {
        std::cout << "MongoS version " << versionString
                  << " starting: pid=" << ProcessId::getCurrent()
                  << " port=" << serverGlobalParams.port << (sizeof(int*) == 4 ? " 32" : " 64")
                  << "-bit host=" << getHostNameCached() << " (--help for usage)" << std::endl;
        DEV std::cout << "DEBUG build" << std::endl;
        std::cout << "git version: " << gitVersion() << std::endl;
        std::cout << openSSLVersion("OpenSSL version: ") << std::endl;
    } else {
        log() << "MongoS version " << versionString << " starting: pid=" << ProcessId::getCurrent()
              << " port=" << serverGlobalParams.port << (sizeof(int*) == 4 ? " 32" : " 64")
              << "-bit host=" << getHostNameCached() << " (--help for usage)" << std::endl;
        DEV log() << "DEBUG build" << std::endl;
        logProcessDetails();
    }
}
Ejemplo n.º 5
0
    void appendBuildInfo(BSONObjBuilder& result) {
       result << "version" << versionString
              << "gitVersion" << gitVersion()
#if defined(_WIN32)
              << "targetMinOS" << targetMinOS()
#endif
              << "OpenSSLVersion" << openSSLVersion()
              << "sysInfo" << sysInfo()
              << "loaderFlags" << loaderFlags()
              << "compilerFlags" << compilerFlags()
              << "allocator" << allocator()
              << "versionArray" << versionArray
              << "javascriptEngine" << compiledJSEngine()
/*TODO: add this back once the module system is in place -- maybe once we do something like serverstatus with callbacks*/
//              << "interpreterVersion" << globalScriptEngine->getInterpreterVersionString()
              << "bits" << ( sizeof( int* ) == 4 ? 32 : 64 );
       result.appendBool( "debug" , debug );
       result.appendNumber("maxBsonObjectSize", BSONObjMaxUserSize);
    }
Ejemplo n.º 6
0
    void printOpenSSLVersion() {
#ifdef MONGO_SSL
        log() << openSSLVersion("OpenSSL version: ") << endl;
#endif
    }