loolwsd/Unit.cpp | 6 +++--- loolwsd/test/UnitPrefork.cpp | 17 +++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-)
New commits: commit 10659d970befb63df2583d2627beb6c5ab9fb98e Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> Date: Sun Nov 6 12:10:43 2016 -0500 loolwsd: UnitPrefork logs updated Change-Id: I7cc37295459aceac6ba38af4fb274c39f55885a4 Reviewed-on: https://gerrit.libreoffice.org/30634 Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@gmail.com> diff --git a/loolwsd/test/UnitPrefork.cpp b/loolwsd/test/UnitPrefork.cpp index 3407e6b..e6837f5 100644 --- a/loolwsd/test/UnitPrefork.cpp +++ b/loolwsd/test/UnitPrefork.cpp @@ -69,7 +69,7 @@ public: } else { - Log::info("Got memory stats [" + memory + "]."); + LOG_INF("Got memory stats [" << memory << "]."); assert(tokens.count() == 2); _childPSS = atoi(tokens[0].c_str()); _childDirty = atoi(tokens[1].c_str()); @@ -86,20 +86,21 @@ public: std::unique_lock<std::mutex> lock(_mutex); _childSockets.push_back(socket); + LOG_INF("Unit-prefork: got new child, have " << _childSockets.size() << " of " << NumToPrefork); + if (_childSockets.size() >= NumToPrefork) { Poco::Timestamp::TimeDiff elapsed = _startTime.elapsed(); const auto totalTime = (1000. * elapsed)/Poco::Timestamp::resolution(); - Log::info() << "Launched " << _childSockets.size() << " in " - << totalTime << Log::end; + LOG_INF("Launched " << _childSockets.size() << " in " << totalTime); size_t totalPSSKb = 0; size_t totalDirtyKb = 0; // Skip the last one as it's not completely initialized yet. for (size_t i = 0; i < _childSockets.size() - 1; ++i) { - Log::info() << "Getting memory of child #" << i + 1 << " of " << _childSockets.size() << Log::end; + LOG_INF("Getting memory of child #" << i + 1 << " of " << _childSockets.size()); _childSockets[i]->sendFrame("unit-memdump: \n", sizeof("unit-memdump: \n")); if (_cv.wait_for(lock, std::chrono::milliseconds(5 * 1000)) == std::cv_status::timeout) @@ -181,10 +182,10 @@ namespace std::ostringstream oss; oss << numPSSKb << " " << numDirtyKb; const auto res = oss.str(); - Log::info("readMemorySize: [" + res + "]."); + LOG_INF("readMemorySize: [" << res << "]."); if (res.empty()) { - Log::error("Failed to read memory stats."); + LOG_ERR("Failed to read memory stats."); throw std::runtime_error("Failed to read memory stats."); } @@ -239,7 +240,7 @@ public: assert(len<sizeof(buffer)); numSockets++; char *extDot = strrchr(buffer, '.'); - Log::info() << "fd:" << ent->d_name << " -> " << buffer << Log::end; + LOG_INF("fd:" << ent->d_name << " -> " << buffer); if (!strncmp(buffer, "/dev/", sizeof ("/dev/") -1)) deviceCount++; else if (extDot && !strcmp(extDot, ".res")) @@ -305,7 +306,7 @@ public: memory = _failure; else memory = readMemorySizes(_procSMaps); - Log::info("filterKitMessage sending back: [" + memory + "]."); + LOG_INF("filterKitMessage sending back: [" << memory << "]."); ws->sendFrame(memory.c_str(), memory.length()); return true; } commit ca17fc74c753fd24447545da824ca29757609005 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> Date: Sun Nov 6 12:06:21 2016 -0500 loolwsd: Unit logs updated Change-Id: Ic60e59f21bdb426997808d14a4e0375e38362161 Reviewed-on: https://gerrit.libreoffice.org/30633 Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@gmail.com> diff --git a/loolwsd/Unit.cpp b/loolwsd/Unit.cpp index 43c9e9a..f269fc7 100644 --- a/loolwsd/Unit.cpp +++ b/loolwsd/Unit.cpp @@ -31,7 +31,7 @@ UnitBase *UnitBase::linkAndCreateUnit(UnitType type, const std::string &unitLibP void *dlHandle = dlopen(unitLibPath.c_str(), RTLD_GLOBAL|RTLD_NOW); if (!dlHandle) { - Log::error("Failed to load " + unitLibPath + ": " + std::string(dlerror())); + LOG_ERR("Failed to load " << unitLibPath << ": " << dlerror()); return NULL; } @@ -49,7 +49,7 @@ UnitBase *UnitBase::linkAndCreateUnit(UnitType type, const std::string &unitLibP createHooks = reinterpret_cast<CreateUnitHooksFunction *>(dlsym(dlHandle, symbol)); if (!createHooks) { - Log::error("No " + std::string(symbol) + " symbol in " + unitLibPath); + LOG_ERR("No " << symbol << " symbol in " << unitLibPath); return NULL; } UnitBase *pHooks = createHooks(); @@ -72,7 +72,7 @@ bool UnitBase::init(UnitType type, const std::string &unitLibPath) TimeoutThread.trySleep(Global->_timeoutMilliSeconds); if (!Global->_timeoutShutdown) { - Log::error("Unit test timeout"); + LOG_ERR("Unit test timeout"); Global->timeout(); } }); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits