From f278315081b24b59bf73e9613e552e3519200a71 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Mon, 28 May 2012 04:39:18 +0000 Subject: Improve error reporting with a reason code. Improve debug and audit logging. Fix test scripts to cleanup state from previous builds and correctly report test errors. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1343138 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/components/log/scribe.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sca-cpp/trunk/components/log/scribe.hpp') diff --git a/sca-cpp/trunk/components/log/scribe.hpp b/sca-cpp/trunk/components/log/scribe.hpp index 7fa420f945..5ae8a50776 100644 --- a/sca-cpp/trunk/components/log/scribe.hpp +++ b/sca-cpp/trunk/components/log/scribe.hpp @@ -98,7 +98,7 @@ private: ::scribe::thrift::scribeClient* client; boost::shared_ptr transport; - friend const failable log(const value& val, const value& category, const Scribe& sc); + friend const failable log(const value& val, const string& host, const value& category, const Scribe& sc); friend const failable status(const Scribe& sc); /** @@ -122,18 +122,20 @@ private: /** * Log an item. */ -const failable log(const value& val, const value& category, const Scribe& sc) { +const failable log(const value& val, const string& host, const value& category, const Scribe& sc) { debug(val, "scribe::log::value"); debug(category, "scribe::log::category"); const value cat = isString(category)? value(c_str(category)):category; const string cs(scheme::writeValue(cat)); const string vs(scheme::writeValue(val)); + ostringstream os; + os << "[" << host << "] " << vs; try { ::scribe::thrift::LogEntry entry; entry.category = c_str(cs); - entry.message = c_str(vs); + entry.message = c_str(str(os)); std::vector< ::scribe::thrift::LogEntry> msgs; msgs.push_back(entry); -- cgit v1.2.3