From: Chuck Hagenbuch Date: Sun, 30 May 2010 19:13:28 +0000 (-0400) Subject: Simple Scribe client that wraps all of the internal thrift objects up in a simple API X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=25e2e58da291f5fb4eefc6c89b08e932cd45783b;p=horde.git Simple Scribe client that wraps all of the internal thrift objects up in a simple API --- diff --git a/framework/Scribe/lib/Horde/Scribe/Client.php b/framework/Scribe/lib/Horde/Scribe/Client.php new file mode 100644 index 000000000..506af100f --- /dev/null +++ b/framework/Scribe/lib/Horde/Scribe/Client.php @@ -0,0 +1,47 @@ +_transport = new TFramedTransport($socket); + $protocol = new TBinaryProtocol($this->_transport, false, false); + $this->_client = new scribeClient($protocol, $protocol); + } + + public function log($category, $message) + { + $this->logMulti(array($this->makeEntry($category, $message))); + } + + public function logMulti(array $messages) + { + $this->_transport->open(); + $this->_client->Log($messages); + $this->_transport->close(); + } + + public function makeEntry($category, $message) + { + return new LogEntry(array('category' => $category, 'message' => $message)); + } +} diff --git a/framework/Scribe/package.xml b/framework/Scribe/package.xml index 55826ff50..ca93b5f6c 100644 --- a/framework/Scribe/package.xml +++ b/framework/Scribe/package.xml @@ -37,6 +37,9 @@ http://pear.php.net/dtd/package-2.0.xsd"> + + + @@ -64,6 +67,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> +