[Libreoffice-commits] online.git: kit/ChildSession.cpp wsd/ClientSession.cpp wsd/DocumentBroker.cpp wsd/FileServer.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Mon May 22 05:04:06 UTC 2017


 kit/ChildSession.cpp   |    4 ++--
 wsd/ClientSession.cpp  |    2 +-
 wsd/DocumentBroker.cpp |    2 +-
 wsd/FileServer.cpp     |    6 +++---
 4 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 873cbcbe91c6652160a56bb0385cedd35ba27902
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sat May 20 13:28:09 2017 -0400

    wsd: logging corrections
    
    Change-Id: I35c52494137ea174c218bf936bc2440634036e3e
    Reviewed-on: https://gerrit.libreoffice.org/37889
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index 1fbc1944..2ed065ab 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<std::mutex> lockLokDoc(_docManager.getDocumentMutex());
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 105b30d3..d21d925d 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<Message>(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 7f8b9bce..5b5f4ebd 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -460,7 +460,7 @@ bool DocumentBroker::load(const std::shared_ptr<ClientSession>& 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 a50be219..99606959 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);
 


More information about the Libreoffice-commits mailing list