activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r908248 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main: ./ decaf/util/logging/
Date Tue, 09 Feb 2010 21:59:01 GMT
Author: tabish
Date: Tue Feb  9 21:59:00 2010
New Revision: 908248

URL: http://svn.apache.org/viewvc?rev=908248&view=rev
Log:
Some more work on the Logger Package.

Added:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/Formatter.cpp   (with
props)
Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/ConsoleHandler.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/ConsoleHandler.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/Formatter.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/SimpleFormatter.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/SimpleFormatter.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/StreamHandler.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am?rev=908248&r1=908247&r2=908248&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am Tue Feb  9 21:59:00 2010
@@ -560,6 +560,7 @@
     decaf/util/concurrent/locks/ReentrantLock.cpp \
     decaf/util/logging/ConsoleHandler.cpp \
     decaf/util/logging/ErrorManager.cpp \
+    decaf/util/logging/Formatter.cpp \
     decaf/util/logging/Handler.cpp \
     decaf/util/logging/Level.cpp \
     decaf/util/logging/LogManager.cpp \

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/ConsoleHandler.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/ConsoleHandler.cpp?rev=908248&r1=908247&r2=908248&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/ConsoleHandler.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/ConsoleHandler.cpp
Tue Feb  9 21:59:00 2010
@@ -35,3 +35,10 @@
 void ConsoleHandler::close() throw ( decaf::io::IOException ) {
     StreamHandler::close( true );
 }
+
+////////////////////////////////////////////////////////////////////////////////
+void ConsoleHandler::publish( const LogRecord& record ) {
+    StreamHandler::publish( record );
+
+    this->flush();
+}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/ConsoleHandler.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/ConsoleHandler.h?rev=908248&r1=908247&r2=908248&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/ConsoleHandler.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/ConsoleHandler.h
Tue Feb  9 21:59:00 2010
@@ -69,6 +69,14 @@
          */
         virtual void close() throw ( decaf::io::IOException );
 
+        /**
+         * Publish the Log Record to this Handler
+         *
+         * @param record
+         *      The <code>LogRecord</code> to Publish
+         */
+        virtual void publish( const LogRecord& record );
+
     };
 
 }}}

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/Formatter.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/Formatter.cpp?rev=908248&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/Formatter.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/Formatter.cpp Tue
Feb  9 21:59:00 2010
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Formatter.h"
+
+using namespace decaf;
+using namespace decaf::util;
+using namespace decaf::util::logging;
+
+////////////////////////////////////////////////////////////////////////////////
+std::string Formatter::formatMessage( const LogRecord& record ) const {
+
+    return record.getMessage();
+}

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/Formatter.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/Formatter.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/Formatter.h?rev=908248&r1=908247&r2=908248&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/Formatter.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/Formatter.h Tue Feb
 9 21:59:00 2010
@@ -51,15 +51,20 @@
          * @param record The Log Record to Format
          * @returns the formatted message
          */
-        virtual std::string formatMessage( const LogRecord& record ) const = 0;
+        virtual std::string formatMessage( const LogRecord& record ) const;
 
         /**
          * Return the header string for a set of formatted records.  In the
-         * default implementation this method should return empty string
-         * @param handler the target handler, can be null
-         * @return the head string
+         * default implementation this method should return empty string.
+         *
+         * @param handler
+         *      The target handler, can be NULL.
+         *
+         * @return the head string.
          */
-        virtual std::string getHead( const Handler* handler ) = 0;
+        virtual std::string getHead( const Handler* handler DECAF_UNUSED ) {
+            return "";
+        }
 
         /**
          * Return the tail string for a set of formatted records.  In the
@@ -67,7 +72,9 @@
          * @param handler the target handler, can be null
          * @return the tail string
          */
-        virtual std::string getTail( const Handler* handler ) = 0;
+        virtual std::string getTail( const Handler* handler DECAF_UNUSED ) {
+            return "";
+        }
 
     };
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/SimpleFormatter.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/SimpleFormatter.cpp?rev=908248&r1=908247&r2=908248&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/SimpleFormatter.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/SimpleFormatter.cpp
Tue Feb  9 21:59:00 2010
@@ -25,7 +25,7 @@
 using namespace decaf::util::logging;
 
 ////////////////////////////////////////////////////////////////////////////////
-SimpleFormatter::SimpleFormatter() {
+SimpleFormatter::SimpleFormatter() : Formatter() {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -36,18 +36,3 @@
 std::string SimpleFormatter::format( const LogRecord& record DECAF_UNUSED ) const {
     return "";
 }
-
-////////////////////////////////////////////////////////////////////////////////
-std::string SimpleFormatter::formatMessage( const LogRecord& record ) const{
-    return record.getMessage();
-}
-
-////////////////////////////////////////////////////////////////////////////////
-std::string SimpleFormatter::getHead( const Handler* handler DECAF_UNUSED ) {
-    return "";
-}
-
-////////////////////////////////////////////////////////////////////////////////
-std::string SimpleFormatter::getTail( const Handler* handler DECAF_UNUSED ) {
-    return "";
-}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/SimpleFormatter.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/SimpleFormatter.h?rev=908248&r1=908247&r2=908248&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/SimpleFormatter.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/SimpleFormatter.h
Tue Feb  9 21:59:00 2010
@@ -29,41 +29,24 @@
     /**
      * Print a brief summary of the LogRecord in a human readable format.
      * The summary will typically be 1 or 2 lines.
+     *
+     * @since 1.0
      */
     class DECAF_API SimpleFormatter : public Formatter {
     public:
 
         SimpleFormatter();
+
         virtual ~SimpleFormatter();
 
         /**
          * Format the given log record and return the formatted string.
-         * @param record The Log Record to Format
+         *
+         * @param record
+         *      The Log Record to Format.
          */
         virtual std::string format( const LogRecord& record ) const;
 
-        /**
-         * Format the message string from a log record.
-         * @param record The Log Record to Format
-         */
-         virtual std::string formatMessage( const LogRecord& record ) const;
-
-        /**
-         * Return the header string for a set of formatted records.  In the
-         * default implementation this method should return empty string
-         * @param handler the target handler, can be null
-         * @return empty string
-         */
-        virtual std::string getHead( const Handler* handler );
-
-        /**
-         * Return the tail string for a set of formatted records.  In the
-         * default implementation this method should return empty string
-         * @param handler the target handler, can be null
-         * @return empty string
-         */
-        virtual std::string getTail( const Handler* handler );
-
     };
 
 }}}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/StreamHandler.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/StreamHandler.cpp?rev=908248&r1=908247&r2=908248&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/StreamHandler.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/StreamHandler.cpp
Tue Feb  9 21:59:00 2010
@@ -22,6 +22,7 @@
 #include <decaf/util/logging/ErrorManager.h>
 #include <decaf/util/logging/Filter.h>
 #include <decaf/io/OutputStream.h>
+#include <decaf/io/OutputStreamWriter.h>
 #include <decaf/io/Writer.h>
 
 using namespace decaf;
@@ -181,8 +182,7 @@
 void StreamHandler::initializeWritter() {
 
     this->writerNotInitialized = false;
-    // TODO
-    //this->writer = new OutputStreamWriter(this.os);
+    this->writer = new OutputStreamWriter( this->stream );
 
     // Start the Document by writing out the Head element.
     this->write( getFormatter()->getHead( this ) );



Mime
View raw message