]> granicus.if.org Git - icinga2/commitdiff
Move command argument logging into the unix process class.
authorMichael Friedrich <michael.friedrich@netways.de>
Mon, 16 Dec 2013 15:22:22 +0000 (16:22 +0100)
committerMichael Friedrich <michael.friedrich@netways.de>
Mon, 16 Dec 2013 15:22:22 +0000 (16:22 +0100)
Refs #5225

lib/base/process-unix.cpp
lib/base/process.cpp

index b6b67d626b64fc43261491b216b8c55c4e98f44b..84228cb6bea3ca487dde6e3095bccc7557104f54 100644 (file)
@@ -27,6 +27,7 @@
 #include <boost/make_shared.hpp>
 #include <boost/foreach.hpp>
 #include <boost/thread/thread.hpp>
+#include <boost/algorithm/string/join.hpp>
 
 #ifndef _WIN32
 #include <execvpe.h>
@@ -67,6 +68,8 @@ ProcessResult Process::Run(void)
 #endif /* HAVE_PIPE2 */
 
        // build argv
+       Log(LogDebug, "base", "Running command '" + boost::algorithm::join(m_Arguments, " ") + "'.");
+
        char **argv = new char *[m_Arguments.size() + 1];
 
        for (unsigned int i = 0; i < m_Arguments.size(); i++)
@@ -153,7 +156,7 @@ ProcessResult Process::Run(void)
        int fd = fds[0];
        (void) close(fds[1]);
 
-               char buffer[512];
+       char buffer[512];
 
        std::ostringstream outputStream;
 
index 6476dda759c8495d37a98813bb20d68e8c56a5f2..1df048e38e3ba90569809c095bc28c86dc4f337a 100644 (file)
 #include "base/process.h"
 #include "base/array.h"
 #include "base/objectlock.h"
-#include "base/logger_fwd.h"
 #include <boost/foreach.hpp>
-#include <boost/algorithm/string/join.hpp>
 
 using namespace icinga;
 
 Process::Process(const std::vector<String>& arguments, const Dictionary::Ptr& extraEnvironment)
        : m_Arguments(arguments), m_ExtraEnvironment(extraEnvironment), m_Timeout(600)
-{
-       Log(LogDebug, "base", "Running command '" + boost::algorithm::join(arguments, " ") + "'.");
-}
+{ }
 
 std::vector<String> Process::SplitCommand(const Value& command)
 {