summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llprocess.cpp15
-rw-r--r--indra/llcommon/llprocess.h4
2 files changed, 19 insertions, 0 deletions
diff --git a/indra/llcommon/llprocess.cpp b/indra/llcommon/llprocess.cpp
index d30d87411d..9d6c19f1dd 100644
--- a/indra/llcommon/llprocess.cpp
+++ b/indra/llcommon/llprocess.cpp
@@ -81,6 +81,21 @@ bool LLProcess::isRunning(void)
return (mProcessID != 0);
}
+std::ostream& operator<<(std::ostream& out, const LLProcess::Params& params)
+{
+ std::string cwd(params.cwd);
+ if (! cwd.empty())
+ {
+ out << "cd '" << cwd << "': ";
+ }
+ out << '"' << std::string(params.executable) << '"';
+ BOOST_FOREACH(const std::string& arg, params.args)
+ {
+ out << " \"" << arg << '"';
+ }
+ return out;
+}
+
/*****************************************************************************
* Windows specific
*****************************************************************************/
diff --git a/indra/llcommon/llprocess.h b/indra/llcommon/llprocess.h
index 9ea129baf2..7dbdf23679 100644
--- a/indra/llcommon/llprocess.h
+++ b/indra/llcommon/llprocess.h
@@ -31,6 +31,7 @@
#include "llsdparam.h"
#include <boost/shared_ptr.hpp>
#include <boost/noncopyable.hpp>
+#include <iosfwd> // std::ostream
#if LL_WINDOWS
#define WIN32_LEAN_AND_MEAN
@@ -124,4 +125,7 @@ private:
bool mAutokill;
};
+/// for logging
+LL_COMMON_API std::ostream& operator<<(std::ostream&, const LLProcess::Params&);
+
#endif // LL_LLPROCESS_H