summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/components/log/logger.cpp
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2012-05-28 04:39:18 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2012-05-28 04:39:18 +0000
commitf278315081b24b59bf73e9613e552e3519200a71 (patch)
treecdfe0e8d00e2c3e8002284c4541429f91cb66e68 /sca-cpp/trunk/components/log/logger.cpp
parentc3eb9d1e20e1f8a7a101854d6a883692cac4e8d0 (diff)
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
Diffstat (limited to 'sca-cpp/trunk/components/log/logger.cpp')
-rw-r--r--sca-cpp/trunk/components/log/logger.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/sca-cpp/trunk/components/log/logger.cpp b/sca-cpp/trunk/components/log/logger.cpp
index eb18ed30db..d7a54507fb 100644
--- a/sca-cpp/trunk/components/log/logger.cpp
+++ b/sca-cpp/trunk/components/log/logger.cpp
@@ -30,6 +30,7 @@
#include "list.hpp"
#include "value.hpp"
#include "monad.hpp"
+#include "../../modules/http/http.hpp"
#include "scribe.hpp"
namespace tuscany {
@@ -40,24 +41,25 @@ namespace logger {
*/
class applyLog {
public:
- applyLog(const lambda<value(const list<value>&)>& relay, const value& category, scribe::Scribe& sc) : relay(relay), category(category), sc(sc) {
+ applyLog(const lambda<value(const list<value>&)>& relay, const value& host, const value& category, scribe::Scribe& sc) : relay(relay), host(host), category(category), sc(sc) {
}
const value operator()(const list<value>& params) const {
// Log the function params
debug(params, "logger::apply::params");
- scribe::log(params, category, sc);
+ scribe::log(params, host, category, sc);
- // Relay the function
+ // Relay the function call
const failable<value> res = relay(params);
// Log the result
- scribe::log(res, category, sc);
+ scribe::log(res, host, category, sc);
return res;
}
private:
const lambda<value(const list<value>&)> relay;
+ const value host;
const value category;
scribe::Scribe& sc;
};
@@ -65,17 +67,19 @@ private:
/**
* Start the component.
*/
-const failable<value> start(unused const list<value>& params) {
+const failable<value> start(const list<value>& params) {
// Connect to Scribe
scribe::Scribe& sc = *(new (gc_new<scribe::Scribe>()) scribe::Scribe("localhost", 1464));
// Extract the configured relay service and category
const value rel = car(params);
- const value category = ((lambda<value(list<value>)>)cadr(params))(list<value>());
+ const value host = ((lambda<value(list<value>)>)cadr(params))(list<value>());
+ const value category = ((lambda<value(list<value>)>)caddr(params))(list<value>());
+ debug(host, "logger::start::host");
debug(category, "logger::start::category");
// Return the component implementation lambda function
- return value(lambda<value(const list<value>&)>(applyLog(rel, category, sc)));
+ return value(lambda<value(const list<value>&)>(applyLog(rel, host, category, sc)));
}
}