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/logger.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'sca-cpp/trunk/components/log/logger.cpp') 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&)>& relay, const value& category, scribe::Scribe& sc) : relay(relay), category(category), sc(sc) { + applyLog(const lambda&)>& relay, const value& host, const value& category, scribe::Scribe& sc) : relay(relay), host(host), category(category), sc(sc) { } const value operator()(const list& 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 res = relay(params); // Log the result - scribe::log(res, category, sc); + scribe::log(res, host, category, sc); return res; } private: const lambda&)> relay; + const value host; const value category; scribe::Scribe& sc; }; @@ -65,17 +67,19 @@ private: /** * Start the component. */ -const failable start(unused const list& params) { +const failable start(const list& params) { // Connect to Scribe scribe::Scribe& sc = *(new (gc_new()) scribe::Scribe("localhost", 1464)); // Extract the configured relay service and category const value rel = car(params); - const value category = ((lambda)>)cadr(params))(list()); + const value host = ((lambda)>)cadr(params))(list()); + const value category = ((lambda)>)caddr(params))(list()); + debug(host, "logger::start::host"); debug(category, "logger::start::category"); // Return the component implementation lambda function - return value(lambda&)>(applyLog(rel, category, sc))); + return value(lambda&)>(applyLog(rel, host, category, sc))); } } -- cgit v1.2.3