diff --git a/common/Util.cpp b/common/Util.cpp index 0ca96021a..ab21e0c96 100644 --- a/common/Util.cpp +++ b/common/Util.cpp @@ -658,7 +658,9 @@ namespace Util if (plain.empty() || anonymized.empty()) return; - LOG_TRC("Anonymizing [" << plain << "] -> [" << anonymized << "]."); + auto &log = Log::logger(); + if (log.trace() && plain != anonymized) + LOG_TRC("Anonymizing [" << plain << "] -> [" << anonymized << "]."); std::unique_lock lock(AnonymizedMutex); @@ -673,7 +675,9 @@ namespace Util const auto it = AnonymizedStrings.find(text); if (it != AnonymizedStrings.end()) { - LOG_TRC("Found anonymized [" << text << "] -> [" << it->second << "]."); + auto &log = Log::logger(); + if (log.trace() && text != it->second) + LOG_TRC("Found anonymized [" << text << "] -> [" << it->second << "]."); return it->second; } } diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp index 6b61765ae..7f5938bb1 100644 --- a/wsd/ClientSession.cpp +++ b/wsd/ClientSession.cpp @@ -419,12 +419,14 @@ bool ClientSession::loadDocument(const char* /*buffer*/, int /*length*/, std::string encodedUserId; Poco::URI::encode(getUserId(), "", encodedUserId); oss << " authorid=" << encodedUserId; + encodedUserId = ""; Poco::URI::encode(LOOLWSD::anonymizeUsername(getUserId()), "", encodedUserId); oss << " xauthorid=" << encodedUserId; std::string encodedUserName; Poco::URI::encode(getUserName(), "", encodedUserName); oss << " author=" << encodedUserName; + encodedUserName = ""; Poco::URI::encode(LOOLWSD::anonymizeUsername(getUserName()), "", encodedUserName); oss << " xauthor=" << encodedUserName; }