From 873cbcbe91c6652160a56bb0385cedd35ba27902 Mon Sep 17 00:00:00 2001 From: Ashod Nakashian Date: Sat, 20 May 2017 13:28:09 -0400 Subject: [PATCH] wsd: logging corrections Change-Id: I35c52494137ea174c218bf936bc2440634036e3e Reviewed-on: https://gerrit.libreoffice.org/37889 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian --- kit/ChildSession.cpp | 4 ++-- wsd/ClientSession.cpp | 2 +- wsd/DocumentBroker.cpp | 2 +- wsd/FileServer.cpp | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index 1fbc19448..2ed065ab3 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -75,7 +75,7 @@ void ChildSession::disconnect() bool ChildSession::_handleInput(const char *buffer, int length) { - LOG_TRC(getName() + ": handling [" << getAbbreviatedMessage(buffer, length) << "]."); + LOG_TRC(getName() << ": handling [" << getAbbreviatedMessage(buffer, length) << "]."); const std::string firstLine = getFirstLine(buffer, length); const auto tokens = LOOLProtocol::tokenize(firstLine.data(), firstLine.size()); @@ -348,7 +348,7 @@ bool ChildSession::loadDocument(const char * /*buffer*/, int /*length*/, const s return false; } - LOG_INF("Created new view with viewid: [" << _viewId << + "] for username: [" << + LOG_INF("Created new view with viewid: [" << _viewId << "] for username: [" << _userName << "] in session: [" << getId() << "]."); std::unique_lock lockLokDoc(_docManager.getDocumentMutex()); diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp index 105b30d32..d21d925d8 100644 --- a/wsd/ClientSession.cpp +++ b/wsd/ClientSession.cpp @@ -497,7 +497,7 @@ bool ClientSession::handleKitToClientMessage(const char* buffer, const int lengt { const auto payload = std::make_shared(buffer, length, Message::Dir::Out); - LOG_TRC(getName() + ": handling kit-to-client [" << payload->abbr() << "]."); + LOG_TRC(getName() << ": handling kit-to-client [" << payload->abbr() << "]."); const std::string& firstLine = payload->firstLine(); const auto docBroker = _docBroker.lock(); diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp index 7f8b9bce4..5b5f4ebdc 100644 --- a/wsd/DocumentBroker.cpp +++ b/wsd/DocumentBroker.cpp @@ -460,7 +460,7 @@ bool DocumentBroker::load(const std::shared_ptr& session, const s // Mark the session as 'Document owner' if WOPI hosts supports it if (userid == _storage->getFileInfo()._ownerId) { - LOG_DBG("Session [" + sessionId + "] is the document owner"); + LOG_DBG("Session [" << sessionId << "] is the document owner"); session->setDocumentOwner(true); } diff --git a/wsd/FileServer.cpp b/wsd/FileServer.cpp index a50be2194..996069597 100644 --- a/wsd/FileServer.cpp +++ b/wsd/FileServer.cpp @@ -291,7 +291,7 @@ void FileServerRequestHandler::readDirToHash(const std::string &basePath, const struct stat fileStat; DIR *workingdir; - LOG_TRC("Pre-reading directory: " << basePath + path << "\n"); + LOG_TRC("Pre-reading directory: " << basePath << path << "\n"); workingdir = opendir((basePath + path).c_str()); while ((currentFile = readdir(workingdir)) != NULL) @@ -299,7 +299,7 @@ void FileServerRequestHandler::readDirToHash(const std::string &basePath, const if (currentFile->d_name[0] == '.') continue; - std::string relPath = path + "/" + currentFile->d_name; + const std::string relPath = path + '/' + currentFile->d_name; stat ((basePath + relPath).c_str(), &fileStat); if (S_ISDIR(fileStat.st_mode)) @@ -307,7 +307,7 @@ void FileServerRequestHandler::readDirToHash(const std::string &basePath, const else if (S_ISREG(fileStat.st_mode)) { - LOG_TRC("Reading file: '" << (basePath + relPath) << " as '" << relPath << "'\n"); + LOG_TRC("Reading file: '" << basePath << relPath << " as '" << relPath << "'\n"); std::ifstream file(basePath + relPath, std::ios::binary);