diff options
Diffstat (limited to 'sca-cpp/trunk/components/log')
-rw-r--r-- | sca-cpp/trunk/components/log/log.cpp | 4 | ||||
-rw-r--r-- | sca-cpp/trunk/components/log/logger.cpp | 4 | ||||
-rw-r--r-- | sca-cpp/trunk/components/log/scribe-cat.cpp | 4 | ||||
-rw-r--r-- | sca-cpp/trunk/components/log/scribe.hpp | 12 |
4 files changed, 16 insertions, 8 deletions
diff --git a/sca-cpp/trunk/components/log/log.cpp b/sca-cpp/trunk/components/log/log.cpp index 2e7742cfd7..f7f7086192 100644 --- a/sca-cpp/trunk/components/log/log.cpp +++ b/sca-cpp/trunk/components/log/log.cpp @@ -75,8 +75,8 @@ const failable<value> start(const list<value>& params) { scribe::Scribe& sc = *(new (gc_new<scribe::Scribe>()) scribe::Scribe("localhost", 1464)); // Extract the configured category - const value host = ((lambda<value(list<value>)>)car(params))(list<value>()); - const value category = ((lambda<value(list<value>)>)cadr(params))(list<value>()); + const value host = ((lambda<value(const list<value>&)>)car(params))(list<value>()); + const value category = ((lambda<value(const list<value>&)>)cadr(params))(list<value>()); debug(host, "log::start::host"); debug(category, "log::start::category"); diff --git a/sca-cpp/trunk/components/log/logger.cpp b/sca-cpp/trunk/components/log/logger.cpp index d7a54507fb..d7969036ab 100644 --- a/sca-cpp/trunk/components/log/logger.cpp +++ b/sca-cpp/trunk/components/log/logger.cpp @@ -73,8 +73,8 @@ const failable<value> start(const list<value>& params) { // Extract the configured relay service and category const value rel = car(params); - const value host = ((lambda<value(list<value>)>)cadr(params))(list<value>()); - const value category = ((lambda<value(list<value>)>)caddr(params))(list<value>()); + const value host = ((lambda<value(const list<value>&)>)cadr(params))(list<value>()); + const value category = ((lambda<value(const list<value>&)>)caddr(params))(list<value>()); debug(host, "logger::start::host"); debug(category, "logger::start::category"); diff --git a/sca-cpp/trunk/components/log/scribe-cat.cpp b/sca-cpp/trunk/components/log/scribe-cat.cpp index fbfdaca533..254e2167ae 100644 --- a/sca-cpp/trunk/components/log/scribe-cat.cpp +++ b/sca-cpp/trunk/components/log/scribe-cat.cpp @@ -38,12 +38,12 @@ namespace scribecat { int cat(const string& host, const string& category, const string& type) { // Connect to Scribe - scribe::Scribe& sc = *(new (gc_new<scribe::Scribe>()) scribe::Scribe("localhost", 1464)); + scribe::Scribe& sc = *(new (gc_new<scribe::Scribe>()) scribe::Scribe(host, 1464)); // Read lines from stdin and log them char buf[8193]; for (;;) { - gc_scoped_pool(); + gc_scoped_pool p; // Write line prefix ostringstream os; diff --git a/sca-cpp/trunk/components/log/scribe.hpp b/sca-cpp/trunk/components/log/scribe.hpp index 5ae8a50776..0f0570be64 100644 --- a/sca-cpp/trunk/components/log/scribe.hpp +++ b/sca-cpp/trunk/components/log/scribe.hpp @@ -66,7 +66,6 @@ namespace scribe { class Scribe { public: Scribe() : owner(false) { - debug("scribe::scribe"); } Scribe(const string host, const int port) : owner(true) { @@ -80,9 +79,18 @@ public: client = c.client; transport = c.transport; } + + const Scribe& operator=(const Scribe& c) { + debug("scribe::scribe::operator="); + if(this == &c) + return *this; + owner = false; + client = c.client; + transport = c.transport; + return *this; + } ~Scribe() { - debug("scribe::~scribe"); if (!owner) return; try { |