From 6f7a2fd54aebfcf85e2eb4df00b2e21c4971fcde Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Mon, 19 Nov 2018 20:50:09 +0100 Subject: [PATCH] Reduce verbosity of debug logging related to plugin detection --- src/plugin/plugin.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugin/plugin.cpp b/src/plugin/plugin.cpp index 48c0b27..c178088 100644 --- a/src/plugin/plugin.cpp +++ b/src/plugin/plugin.cpp @@ -64,16 +64,22 @@ namespace linuxdeploy { ldLog() << LD_DEBUG << "Searching for plugins in directory" << dir << std::endl; + bool extendedDebugLoggingEnabled = (getenv("DEBUG_PLUGIN_DETECTION") != nullptr); + for (bf::directory_iterator i(dir); i != bf::directory_iterator(); ++i) { // must be a file, and not a directory if (!(bf::is_directory(bf::absolute(*i)))) { - ldLog() << LD_DEBUG << "Entry is a directory, skipping:" << i->path() << std::endl; + if (extendedDebugLoggingEnabled) + ldLog() << LD_DEBUG << "Entry is a directory, skipping:" << i->path() << std::endl; + continue; } // file must be executable... if (!(bf::status(*i).permissions() & (bf::owner_exe | bf::group_exe | bf::others_exe))) { - ldLog() << LD_DEBUG << "File/symlink is not executable, skipping:" << i->path() << std::endl; + if (extendedDebugLoggingEnabled) + ldLog() << LD_DEBUG << "File/symlink is not executable, skipping:" << i->path() << std::endl; + continue; }