diff --git a/apps/openmw-mp/main.cpp b/apps/openmw-mp/main.cpp index 7aa11c62f..68c98dcd4 100644 --- a/apps/openmw-mp/main.cpp +++ b/apps/openmw-mp/main.cpp @@ -200,7 +200,8 @@ int main(int argc, char *argv[]) vector plugins(Utils::split(mgr.getString("plugins", "Plugins"), ',')); - Utils::printVersion("TES3MP dedicated server", TES3MP_VERSION, version.mCommitHash, TES3MP_PROTO_VERSION); + std::string versionInfo = Utils::getVersionInfo("TES3MP dedicated server", TES3MP_VERSION, version.mCommitHash, TES3MP_PROTO_VERSION); + LOG_MESSAGE_SIMPLE(TimedLog::LOG_INFO, "%s", versionInfo.c_str()); Script::SetModDir(dataDirectory); diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index 0cd866c9a..547114b76 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -195,7 +195,7 @@ bool parseOptions (int argc, char** argv, OMW::Engine& engine, Files::Configurat Print the multiplayer version first */ - Utils::printVersion("TES3MP client", TES3MP_VERSION, v.mCommitHash, TES3MP_PROTO_VERSION); + Log(Debug::Info) << Utils::getVersionInfo("TES3MP client", TES3MP_VERSION, v.mCommitHash, TES3MP_PROTO_VERSION); /* End of tes3mp addition */ diff --git a/components/openmw-mp/Utils.cpp b/components/openmw-mp/Utils.cpp index 64d5aa479..45eb889fa 100644 --- a/components/openmw-mp/Utils.cpp +++ b/components/openmw-mp/Utils.cpp @@ -207,14 +207,16 @@ std::string Utils::getArchitectureType() #endif } -void Utils::printVersion(std::string appName, std::string version, std::string commitHash, int protocol) +std::string Utils::getVersionInfo(std::string appName, std::string version, std::string commitHash, int protocol) { - cout << appName << " " << version; - cout << " (" << getOperatingSystemType() << " " << getArchitectureType() << ")" << endl; - cout << "Protocol version: " << protocol << endl; - cout << "Oldest compatible commit hash: " << commitHash.substr(0, 10) << endl; + std::stringstream stream; - cout << "------------------------------------------------------------" << endl; + stream << appName << " " << version << " (" << getOperatingSystemType() << " " << getArchitectureType() << ")" << endl; + stream << "Protocol version: " << protocol << endl; + stream << "Oldest compatible commit hash: " << commitHash.substr(0, 10) << endl; + stream << "------------------------------------------------------------" << endl; + + return stream.str(); } void Utils::printWithWidth(ostringstream &sstr, string str, size_t width) diff --git a/components/openmw-mp/Utils.hpp b/components/openmw-mp/Utils.hpp index 65bfc3a6d..804248f7e 100644 --- a/components/openmw-mp/Utils.hpp +++ b/components/openmw-mp/Utils.hpp @@ -59,7 +59,7 @@ namespace Utils std::string getOperatingSystemType(); std::string getArchitectureType(); - void printVersion(std::string appName, std::string version, std::string commitHash, int protocol); + std::string getVersionInfo(std::string appName, std::string version, std::string commitHash, int protocol); void printWithWidth(std::ostringstream &sstr, std::string str, size_t width);