reduce verbosity of FileServer trace logging.

Change-Id: I5a57e91742be504bcb2e51b45f6890420e52bb91
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87134
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
This commit is contained in:
Michael Meeks
2020-01-21 11:55:32 +00:00
parent 1c0fb25e90
commit aadf5af77b

View File

@ -474,12 +474,14 @@ void FileServerRequestHandler::readDirToHash(const std::string &basePath, const
struct stat fileStat;
DIR *workingdir;
LOG_TRC("Pre-reading directory: " << basePath << path);
workingdir = opendir((basePath + path).c_str());
if (!workingdir)
return;
size_t fileCount = 0;
std::string filesRead;
while ((currentFile = readdir(workingdir)) != nullptr)
{
if (currentFile->d_name[0] == '.')
@ -493,7 +495,9 @@ void FileServerRequestHandler::readDirToHash(const std::string &basePath, const
else if (S_ISREG(fileStat.st_mode))
{
LOG_TRC("Reading file: '" << basePath << relPath << " as '" << relPath << "'");
fileCount++;
filesRead.append(currentFile->d_name);
filesRead.append(" ");
std::ifstream file(basePath + relPath, std::ios::binary);
@ -539,6 +543,9 @@ void FileServerRequestHandler::readDirToHash(const std::string &basePath, const
}
}
closedir(workingdir);
if (fileCount > 0)
LOG_TRC("Pre-read " << fileCount << " file(s) from directory: " << basePath << path << ": " << filesRead);
}
void FileServerRequestHandler::initialize()