activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r528824 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/
Date Sat, 14 Apr 2007 15:50:59 GMT
Author: tabish
Date: Sat Apr 14 08:50:57 2007
New Revision: 528824

URL: http://svn.apache.org/viewvc?view=rev&rev=528824
Log:
Cleaning up

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/ConsoleHandler.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Filter.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Formatter.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Handler.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LogManager.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LogManager.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LogRecord.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Logger.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Logger.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LoggerCommon.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LoggerHierarchy.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LoggerHierarchy.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/SimpleFormatter.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/SimpleLogger.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/StreamHandler.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/ConsoleHandler.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/ConsoleHandler.h?view=diff&rev=528824&r1=528823&r2=528824
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/ConsoleHandler.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/ConsoleHandler.h Sat Apr 14 08:50:57 2007
@@ -26,39 +26,38 @@
     /**
      * This Handler publishes log records to System.err. By default the
      * SimpleFormatter is used to generate brief summaries.
-     * 
-     * Configuration: By default each ConsoleHandler is initialized using 
+     *
+     * Configuration: By default each ConsoleHandler is initialized using
      * the following LogManager configuration properties. If properties are
-     * not defined (or have invalid values) then the specified default 
+     * not defined (or have invalid values) then the specified default
      * values are used.
      *
-     * ConsoleHandler.level specifies the default level for the Handler 
+     * ConsoleHandler.level specifies the default level for the Handler
      *  (defaults to Level.INFO).
-     * ConsoleHandler.filter specifies the name of a Filter class to use 
+     * ConsoleHandler.filter specifies the name of a Filter class to use
      *  (defaults to no Filter).
-     * ConsoleHandler.formatter specifies the name of a Formatter class to 
+     * ConsoleHandler.formatter specifies the name of a Formatter class to
      *  use (defaults to SimpleFormatter).
      */
-    class ConsoleHandler
-    {
+    class ConsoleHandler : public StreamHandler {
     private:
-   
+
         // The Standard Error Stream to log to
         io::StandardErrorOutputStream stream;
-      
+
         // The default Simple Formatter
         SimpleFormatter formatter;
-   
+
     public:
-   
-        ConsoleHandler(void) : StreamHandler(&stream, &formatter)
-        {
+
+        ConsoleHandler(void) : StreamHandler(&stream, &formatter) {
+
             // Defaults level to Info
             setLevel(Level.INFO);
         }
-      
+
         virtual ~ConsoleHandler(void) {}
-      
+
         /**
          * Close the current output stream.
          * <p>
@@ -68,11 +67,10 @@
          */
         virtual void close(void) throw ( cms::CMSException )
         {
-            if(getOutputStream())
-            {
+            if( getOutputStream() ) {
                 getOutputStream->flush();
             }
-        }      
+        }
 
     };
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Filter.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Filter.h?view=diff&rev=528824&r1=528823&r2=528824
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Filter.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Filter.h Sat Apr 14 08:50:57 2007
@@ -21,22 +21,21 @@
 
 namespace activemq{
 namespace logger{
-   
+
     /**
-     * A Filter can be used to provide fine grain control over what is 
+     * A Filter can be used to provide fine grain control over what is
      * logged, beyond the control provided by log levels.
-     * 
-     * Each Logger and each Handler can have a filter associated with it. 
-     * The Logger or Handler will call the isLoggable method to check if a 
-     * given LogRecord should be published. If isLoggable returns false, 
-     * the LogRecord will be discarded. 
+     *
+     * Each Logger and each Handler can have a filter associated with it.
+     * The Logger or Handler will call the isLoggable method to check if a
+     * given LogRecord should be published. If isLoggable returns false,
+     * the LogRecord will be discarded.
      */
-    class Filter
-    {
+    class Filter {
     public:
 
-        virtual ~Filter(void) {}
-      
+        virtual ~Filter() {}
+
         /**
          * Check if a given log record should be published.
          * @param record the <code>LogRecord</code> to check.

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Formatter.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Formatter.h?view=diff&rev=528824&r1=528823&r2=528824
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Formatter.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Formatter.h Sat Apr 14 08:50:57 2007
@@ -23,18 +23,17 @@
     /**
      * A Formatter provides support for formatting LogRecords.
      *
-     * Typically each logging Handler will have a Formatter associated with 
+     * Typically each logging Handler will have a Formatter associated with
      * it. The Formatter takes a LogRecord and converts it to a string.
      *
-     * Some formatters (such as the XMLFormatter) need to wrap head and 
-     * tail strings around a set of formatted records. The getHeader and 
+     * Some formatters (such as the XMLFormatter) need to wrap head and
+     * tail strings around a set of formatted records. The getHeader and
      * getTail methods can be used to obtain these strings.
      */
-    class Formatter
-    {
+    class Formatter {
     public:
 
-        virtual ~Formatter(void) {}
+        virtual ~Formatter() {}
 
         /**
          * Format the given log record and return the formatted string.
@@ -42,14 +41,14 @@
          * @returns the formatted record.
          */
         virtual std::string format( const LogRecord& record ) const = 0;
-      
+
         /**
          * Format the message string from a log record.
          * @param record The Log Record to Format
          * @returns the formatted message
          */
         virtual std::string formatMessage( const LogRecord& record ) const = 0;
-      
+
         /**
          * Return the header string for a set of formatted records.  In the
          * default implementation this method should return empty string

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Handler.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Handler.h?view=diff&rev=528824&r1=528823&r2=528824
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Handler.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Handler.h Sat Apr 14 08:50:57 2007
@@ -25,95 +25,94 @@
 
     class Filter;
     class Formatter;
-   
+
     /**
-     * A Handler object takes log messages from a Logger and exports them. 
-     * It might for example, write them to a console or write them to a file, 
-     * or send them to a network logging service, or forward them to an OS 
+     * A Handler object takes log messages from a Logger and exports them.
+     * It might for example, write them to a console or write them to a file,
+     * or send them to a network logging service, or forward them to an OS
      * log, or whatever.
-     * 
-     * A Handler can be disabled by doing a setLevel(Level.OFF) and can be 
+     *
+     * A Handler can be disabled by doing a setLevel(Level.OFF) and can be
      * re-enabled by doing a setLevel with an appropriate level.
-     * 
-     * Handler classes typically use LogManager properties to set default 
-     * values for the Handler's Filter, Formatter, and Level. See the 
-     * specific documentation for each concrete Handler class. 
+     *
+     * Handler classes typically use LogManager properties to set default
+     * values for the Handler's Filter, Formatter, and Level. See the
+     * specific documentation for each concrete Handler class.
      */
-    class Handler : public cms::Closeable
-    {
+    class Handler : public cms::Closeable {
     public:
-   
-        virtual ~Handler(void) {}
-      
+
+        virtual ~Handler() {}
+
         /**
          * Flush the Handler's output, clears any buffers.
          */
-        virtual void flush(void) = 0;
-      
+        virtual void flush() = 0;
+
         /**
          * Publish the Log Record to this Handler
          * @param record The Log Record to Publish
          */
         virtual void publish( const LogRecord& record ) = 0;
-      
+
         /**
          * Check if this Handler would actually log a given LogRecord.
          * <p>
-         * This method checks if the LogRecord has an appropriate Level and 
-         * whether it satisfies any Filter. It also may make other Handler 
-         * specific checks that might prevent a handler from logging the 
+         * This method checks if the LogRecord has an appropriate Level and
+         * whether it satisfies any Filter. It also may make other Handler
+         * specific checks that might prevent a handler from logging the
          * LogRecord.
          * @param record <code>LogRecord</code> to check
          */
         virtual void isLoggable( const LogRecord& record ) = 0;
-      
+
         /**
          * Sets the Filter that this Handler uses to filter Log Records
          * <p>
-         * For each call of publish the Handler will call this Filter (if it 
-         * is non-null) to check if the LogRecord should be published or 
+         * For each call of publish the Handler will call this Filter (if it
+         * is non-null) to check if the LogRecord should be published or
          * discarded.
          * @param filter <code>Filter</code> derived instance
          */
         virtual void setFilter( const Filter* filter ) = 0;
-      
+
         /**
          * Gets the Filter that this Handler uses to filter Log Records
          * @returns <code>Filter</code> derived instance
          */
-        virtual const Filter* getFilter(void) = 0;
-      
+        virtual const Filter* getFilter() = 0;
+
         /**
-         * Set the log level specifying which message levels will be logged 
+         * Set the log level specifying which message levels will be logged
          * by this Handler.
          * <p>
-         * The intention is to allow developers to turn on voluminous logging, 
+         * The intention is to allow developers to turn on voluminous logging,
          * but to limit the messages that are sent to certain Handlers.
          * @param value Level enumeration value
          */
         virtual void setLevel( Level value ) = 0;
-      
+
         /**
-         * Get the log level specifying which message levels will be logged 
+         * Get the log level specifying which message levels will be logged
          * by this Handler.
          * @returns Level enumeration value
          */
-        virtual Level getLevel(void) = 0;
-      
+        virtual Level getLevel() = 0;
+
         /**
          * Sets the <code>Formatter</code> used by this Handler
          * <p>
-         * Some Handlers may not use Formatters, in which case the 
+         * Some Handlers may not use Formatters, in which case the
          * Formatter will be remembered, but not used.
          * @param formatter <code>Filter</code> derived instance
          */
         virtual void setFormatter( const Formatter* formatter ) = 0;
-      
+
         /**
          * Gets the <code>Formatter</code> used by this Handler
          * @returns <code>Filter</code> derived instance
          */
-        virtual const Formatter* getFormatter(void) = 0;
+        virtual const Formatter* getFormatter() = 0;
 
    };
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LogManager.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LogManager.cpp?view=diff&rev=528824&r1=528823&r2=528824
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LogManager.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LogManager.cpp Sat Apr 14 08:50:57 2007
@@ -33,7 +33,7 @@
 unsigned int LogManager::refCount = 0;
 
 ////////////////////////////////////////////////////////////////////////////////
-LogManager::~LogManager( void )
+LogManager::~LogManager()
 {
     // TODO - Delete all the loggers.
 }
@@ -43,47 +43,42 @@
 {
     // Copy the properties
     this->properties.copy(properties);
-    
+
     // Update the configuration of the loggers.
     // TODO
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void LogManager::addPropertyChangeListener( 
+void LogManager::addPropertyChangeListener(
     PropertyChangeListener* listener )
 {
-    if(find(listeners.begin(), listeners.end(), listener) == listeners.end())
-    {
-        listeners.push_back(listener);
+    if( find(listeners.begin(), listeners.end(), listener) == listeners.end() ) {
+        listeners.push_back( listener );
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void LogManager::removePropertyChangeListener( 
+void LogManager::removePropertyChangeListener(
     PropertyChangeListener* listener )
 {
-    listeners.remove(listener);
+    listeners.remove( listener );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-Logger* LogManager::getLogger( const std::string& name AMQCPP_UNUSED)
-{
+Logger* LogManager::getLogger( const std::string& name AMQCPP_UNUSED ) {
     return NULL;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-int LogManager::getLoggerNames( const std::vector<std::string>& names  AMQCPP_UNUSED)
-{
+int LogManager::getLoggerNames( const std::vector<std::string>& names  AMQCPP_UNUSED ) {
     return 0;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-LogManager* LogManager::getInstance( void )
-{
-    synchronized( &mutex )
-    {
-        if( instance == NULL )
-        {
+LogManager* LogManager::getInstance() {
+
+    synchronized( &mutex ) {
+        if( instance == NULL ) {
             instance = new LogManager();
         }
 
@@ -91,24 +86,21 @@
 
         return instance;
     }
-    
+
     return NULL;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void LogManager::returnInstance( void )
-{
-    synchronized( &mutex )
-    {
-        if( refCount == 0 )
-        {
+void LogManager::returnInstance() {
+
+    synchronized( &mutex ) {
+        if( refCount == 0 ) {
             return ;
         }
 
         refCount--;
 
-        if( refCount == 0 )
-        {
+        if( refCount == 0 ) {
             delete instance;
             instance = NULL;
         }
@@ -116,12 +108,11 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void LogManager::destroy( void )
+void LogManager::destroy()
 {
-    if( instance != NULL )
-    {
-        synchronized( &mutex )
-        {
+    if( instance != NULL ) {
+
+        synchronized( &mutex ) {
             delete instance;
             instance = NULL;
             refCount = 0;

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LogManager.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LogManager.h?view=diff&rev=528824&r1=528823&r2=528824
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LogManager.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LogManager.h Sat Apr 14 08:50:57 2007
@@ -32,52 +32,52 @@
     class PropertyChangeListener;
 
     /**
-     * There is a single global LogManager object that is used to maintain 
+     * There is a single global LogManager object that is used to maintain
      * a set of shared state about Loggers and log services.
      *
      * This LogManager object:
      *
-     *   * Manages a hierarchical namespace of Logger objects. All named 
+     *   * Manages a hierarchical namespace of Logger objects. All named
      *     Loggers are stored in this namespace.
-     *   * Manages a set of logging control properties. These are simple 
-     *     key-value pairs that can be used by Handlers and other logging 
-     *     objects to configure themselves. 
+     *   * Manages a set of logging control properties. These are simple
+     *     key-value pairs that can be used by Handlers and other logging
+     *     objects to configure themselves.
      *
-     * The global LogManager object can be retrieved using 
-     * LogManager.getLogManager(). The LogManager object is created during 
+     * The global LogManager object can be retrieved using
+     * LogManager.getLogManager(). The LogManager object is created during
      * class initialization and cannot subsequently be changed.
      *
      * ***TODO****
-     * By default, the LogManager reads its initial configuration from a 
-     * properties file "lib/logging.properties" in the JRE directory. If 
-     * you edit that property file you can change the default logging 
+     * By default, the LogManager reads its initial configuration from a
+     * properties file "lib/logging.properties" in the JRE directory. If
+     * you edit that property file you can change the default logging
      * configuration for all uses of that JRE.
      *
-     * In addition, the LogManager uses two optional system properties that 
+     * In addition, the LogManager uses two optional system properties that
      * allow more control over reading the initial configuration:
      *
      *    * "decaf.logger.config.class"
-     *    * "decaf.logger.config.file" 
+     *    * "decaf.logger.config.file"
      *
-     * These two properties may be set via the Preferences API, or as 
-     * command line property definitions to the "java" command, or as 
+     * These two properties may be set via the Preferences API, or as
+     * command line property definitions to the "java" command, or as
      * system property definitions passed to JNI_CreateJavaVM.
      *
-     * If the "java.util.logging.config.class" property is set, then the 
-     * property value is treated as a class name. The given class will be 
-     * loaded, an object will be instantiated, and that object's constructor 
-     * is responsible for reading in the initial configuration. (That object 
-     * may use other system properties to control its configuration.) The 
-     * alternate configuration class can use readConfiguration(InputStream) 
+     * If the "java.util.logging.config.class" property is set, then the
+     * property value is treated as a class name. The given class will be
+     * loaded, an object will be instantiated, and that object's constructor
+     * is responsible for reading in the initial configuration. (That object
+     * may use other system properties to control its configuration.) The
+     * alternate configuration class can use readConfiguration(InputStream)
      * to define properties in the LogManager.
      *
-     * If "java.util.logging.config.class" property is not set, then the 
+     * If "java.util.logging.config.class" property is not set, then the
      * "java.util.logging.config.file" system property can be used to specify
      * a properties file (in java.util.Properties format). The initial
      * logging configuration will be read from this file.
      *
-     * If neither of these properties is defined then, as described above, 
-     * the LogManager will read its initial configuration from a properties 
+     * If neither of these properties is defined then, as described above,
+     * the LogManager will read its initial configuration from a properties
      * file "lib/logging.properties" in the JRE directory.
      *
      * The properties for loggers and Handlers will have names starting with
@@ -86,53 +86,52 @@
      *
      * The global logging properties may include:
      *
-     *    * A property "handlers". This defines a whitespace separated 
-     *      list of class names for handler classes to load and register as 
+     *    * A property "handlers". This defines a whitespace separated
+     *      list of class names for handler classes to load and register as
      *      handlers on the root Logger (the Logger named ""). Each class
      *      name must be for a Handler class which has a default constructor.
-     *      Note that these Handlers may be created lazily, when they are 
+     *      Note that these Handlers may be created lazily, when they are
      *      first used.
-     *    * A property "<logger>.handlers". This defines a whitespace or 
+     *    * A property "<logger>.handlers". This defines a whitespace or
      *      comma separated list of class names for handlers classes to load
-     *      and register as handlers to the specified logger. Each class name 
-     *      must be for a Handler class which has a default constructor. Note 
-     *      that these Handlers may be created lazily, when they are first 
+     *      and register as handlers to the specified logger. Each class name
+     *      must be for a Handler class which has a default constructor. Note
+     *      that these Handlers may be created lazily, when they are first
      *      used.
      *    * A property "<logger>.useParentHandlers". This defines a boolean
-     *      value. By default every logger calls its parent in addition to 
-     *      handling the logging message itself, this often result in 
+     *      value. By default every logger calls its parent in addition to
+     *      handling the logging message itself, this often result in
      *      messages being handled by the root logger as well. When setting
      *      this property to false a Handler needs to be configured for this
      *      logger otherwise no logging messages are delivered.
      *    * A property "config". This property is intended to allow arbitrary
-     *      configuration code to be run. The property defines a whitespace 
-     *      separated list of class names. A new instance will be created for 
-     *      each named class. The default constructor of each class may 
-     *      execute arbitrary code to update the logging configuration, such 
-     *      as setting logger levels, adding handlers, adding filters, etc. 
+     *      configuration code to be run. The property defines a whitespace
+     *      separated list of class names. A new instance will be created for
+     *      each named class. The default constructor of each class may
+     *      execute arbitrary code to update the logging configuration, such
+     *      as setting logger levels, adding handlers, adding filters, etc.
      *
-     * Loggers are organized into a naming hierarchy based on their dot 
-     * separated names. Thus "a.b.c" is a child of "a.b", but "a.b1" and 
+     * Loggers are organized into a naming hierarchy based on their dot
+     * separated names. Thus "a.b.c" is a child of "a.b", but "a.b1" and
      * a.b2" are peers.
      *
      * All properties whose names end with ".level" are assumed to define
      * log levels for Loggers. Thus "foo.level" defines a log level for
-     * the logger called "foo" and (recursively) for any of its children 
+     * the logger called "foo" and (recursively) for any of its children
      * in the naming hierarchy. Log Levels are applied in the order they
-     * are defined in the properties file. Thus level settings for child 
-     * nodes in the tree should come after settings for their parents. The 
-     * property name ".level" can be used to set the level for the root of 
+     * are defined in the properties file. Thus level settings for child
+     * nodes in the tree should come after settings for their parents. The
+     * property name ".level" can be used to set the level for the root of
      * the tree.
      *
-     * All methods on the LogManager object are multi-thread safe. 
+     * All methods on the LogManager object are multi-thread safe.
      */
-    class LogManager
-    {
+    class LogManager {
     private:
-    
+
         // Change listener on this class's Properties
         std::list<PropertyChangeListener*> listeners;
-        
+
         // Properties of the Log Manager
         util::SimpleProperties properties;
 
@@ -152,7 +151,7 @@
          * logger.
          * @returns The Logger Properties Pointer
          */
-        virtual const util::Properties& getProperties( void ) const {
+        virtual const util::Properties& getProperties() const {
             return properties;
         }
 
@@ -170,7 +169,7 @@
          * instance of a change event listener does nothing.
          * @param listener a PropertyChangeListener
          */
-        virtual void addPropertyChangeListener( 
+        virtual void addPropertyChangeListener(
             PropertyChangeListener* listener );
 
         /**
@@ -182,7 +181,7 @@
 
         /**
          * Retrieves or creates a new Logger using the name specified
-         * a new logger inherits the configuration of the logger's 
+         * a new logger inherits the configuration of the logger's
          * parent if there is no configuration data for the logger.
          * @param name The name of the Logger.
          */
@@ -201,25 +200,25 @@
          * Get the singleton instance
          * @return Pointer to an instance of the Log Manager
          */
-        static LogManager* getInstance( void );
+        static LogManager* getInstance();
 
         /**
          * Returns a Checked out instance of this Manager
          */
-        static void returnInstance( void );
+        static void returnInstance();
 
         /**
          * Forcefully Delete the Instance of this LogManager
          * even if there are outstanding references.
          */
-        static void destroy( void );
+        static void destroy();
 
     protected:
 
         /**
          * Constructor, hidden to protect against direct instantiation
          */
-        LogManager( void ) {}
+        LogManager() {}
 
         /**
          * Copy Constructo

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LogRecord.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LogRecord.h?view=diff&rev=528824&r1=528823&r2=528824
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LogRecord.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LogRecord.h Sat Apr 14 08:50:57 2007
@@ -61,7 +61,7 @@
          * Get Level of this log record
          * @return Level enumeration value.
          */
-        Level getLevel(void) const { 
+        Level getLevel() const { 
             return level; 
         };
       
@@ -77,7 +77,7 @@
          * Gets the Source Logger's Name
          * @return the source loggers name
          */
-        const std::string& getLoggerName(void) const { 
+        const std::string& getLoggerName() const { 
             return loggerName; 
         };
       
@@ -93,7 +93,7 @@
          * Gets the Source Log File name
          * @return the source loggers name
          */
-        const std::string& getSourceFile(void) const { 
+        const std::string& getSourceFile() const { 
             return sourceFile; 
         };
       
@@ -109,7 +109,7 @@
          * Gets the Source Log line number
          * @return the source loggers line number
          */
-        unsigned long getSourceLine(void) const { 
+        unsigned long getSourceLine() const { 
             return sourceLine;
         };
       
@@ -125,7 +125,7 @@
          * Gets the Message to be Logged
          * @return the source logger's message
          */
-        const std::string& getMessage(void) const { 
+        const std::string& getMessage() const { 
             return message; 
         };
       
@@ -141,7 +141,7 @@
          * Gets the name of the function where this log was logged
          * @return the source logger's message
          */
-        const std::string& getSourceFunction(void) const { 
+        const std::string& getSourceFunction() const { 
             return functionName; 
          };
       
@@ -157,7 +157,7 @@
          * Gets the time in mills that this message was logged.
          * @return UTC time in milliseconds
          */
-        unsigned long getTimestamp(void) const { return timeStamp; };
+        unsigned long getTimestamp() const { return timeStamp; };
       
         /**
          * Sets the time in mills that this message was logged.
@@ -171,7 +171,7 @@
          * Gets the Thread Id where this Log was created
          * @return the source loggers line number
          */
-        unsigned long getTreadId(void) const { 
+        unsigned long getTreadId() const { 
             return threadId; 
         };
       

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Logger.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Logger.cpp?view=diff&rev=528824&r1=528823&r2=528824
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Logger.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Logger.cpp Sat Apr 14 08:50:57 2007
@@ -26,147 +26,129 @@
 using namespace activemq::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
-Logger::Logger( const std::string& name AMQCPP_UNUSED, 
-                Logger* parent AMQCPP_UNUSED )
-{
+Logger::Logger( const std::string& name AMQCPP_UNUSED,
+                Logger* parent AMQCPP_UNUSED ) {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-Logger::~Logger(void)
-{
+Logger::~Logger() {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Logger::addHandler(Handler* handler) throw ( IllegalArgumentException )
-{
-    if(handler == NULL)
+void Logger::addHandler( Handler* handler ) throw ( IllegalArgumentException ) {
+
+    if( handler == NULL )
     {
         IllegalArgumentException(
-            __FILE__, __LINE__, 
+            __FILE__, __LINE__,
             "Logger::addHandler - HAndler cannot be null");
     }
-    
-    if(find(handlers.begin(), handlers.end(), handler) != handlers.end())
+
+    if( find( handlers.begin(), handlers.end(), handler) != handlers.end() )
     {
-        handlers.push_back(handler);
+        handlers.push_back( handler );
     }
 }
 
-
 ////////////////////////////////////////////////////////////////////////////////
-void Logger::removeHandler(Handler* handler)
-{
-    list<Handler*>::iterator itr = 
-        find(handlers.begin(), handlers.end(), handler);
+void Logger::removeHandler( Handler* handler ) {
+
+    list<Handler*>::iterator itr =
+        find( handlers.begin(), handlers.end(), handler );
+
+    if( itr != handlers.end() ) {
 
-    if(itr != handlers.end())
-    {
         delete *itr;
         handlers.erase(itr);
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Logger::setFilter( Filter* filter AMQCPP_UNUSED )
-{
+void Logger::setFilter( Filter* filter AMQCPP_UNUSED ){
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-bool Logger::isLoggable( Level level AMQCPP_UNUSED ) const
-{
+bool Logger::isLoggable( Level level AMQCPP_UNUSED ) const{
     return false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Logger::entry(const std::string& blockName AMQCPP_UNUSED, 
-                   const std::string& file AMQCPP_UNUSED, 
-                   const int line AMQCPP_UNUSED)
-{
+void Logger::entry( const std::string& blockName AMQCPP_UNUSED,
+                    const std::string& file AMQCPP_UNUSED,
+                    const int line AMQCPP_UNUSED ) {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Logger::exit(const std::string& blockName AMQCPP_UNUSED, 
-                  const std::string& file AMQCPP_UNUSED, 
-                  const int line AMQCPP_UNUSED)
-{
+void Logger::exit(const std::string& blockName AMQCPP_UNUSED,
+                  const std::string& file AMQCPP_UNUSED,
+                  const int line AMQCPP_UNUSED) {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Logger::debug(const std::string& file AMQCPP_UNUSED, 
-                   const int line AMQCPP_UNUSED, 
-                   const std::string fnctionName AMQCPP_UNUSED, 
-                   const std::string& message AMQCPP_UNUSED)
-{
+void Logger::debug( const std::string& file AMQCPP_UNUSED,
+                    const int line AMQCPP_UNUSED,
+                    const std::string fnctionName AMQCPP_UNUSED,
+                    const std::string& message AMQCPP_UNUSED ) {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Logger::info(const std::string& file AMQCPP_UNUSED, 
-                  const int line AMQCPP_UNUSED, 
-                  const std::string fnctionName AMQCPP_UNUSED, 
-                  const std::string& message AMQCPP_UNUSED)
-{
+void Logger::info( const std::string& file AMQCPP_UNUSED,
+                   const int line AMQCPP_UNUSED,
+                   const std::string fnctionName AMQCPP_UNUSED,
+                   const std::string& message AMQCPP_UNUSED ) {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Logger::error(const std::string& file AMQCPP_UNUSED, 
-                   const int line AMQCPP_UNUSED, 
-                   const std::string fnctionName AMQCPP_UNUSED,
-                   const std::string& message AMQCPP_UNUSED)
-{
+void Logger::error( const std::string& file AMQCPP_UNUSED,
+                    const int line AMQCPP_UNUSED,
+                    const std::string fnctionName AMQCPP_UNUSED,
+                    const std::string& message AMQCPP_UNUSED ) {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Logger::warn(const std::string& file AMQCPP_UNUSED, 
-                  const int line AMQCPP_UNUSED, 
-                  const std::string fnctionName AMQCPP_UNUSED, 
-                  const std::string& message AMQCPP_UNUSED)
-{
+void Logger::warn( const std::string& file AMQCPP_UNUSED,
+                   const int line AMQCPP_UNUSED,
+                   const std::string fnctionName AMQCPP_UNUSED,
+                   const std::string& message AMQCPP_UNUSED ) {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Logger::fatal(const std::string& file AMQCPP_UNUSED, 
-                   const int line AMQCPP_UNUSED, 
-                   const std::string fnctionName AMQCPP_UNUSED, 
-                   const std::string& message AMQCPP_UNUSED)
-{
+void Logger::fatal( const std::string& file AMQCPP_UNUSED,
+                    const int line AMQCPP_UNUSED,
+                    const std::string fnctionName AMQCPP_UNUSED,
+                    const std::string& message AMQCPP_UNUSED ) {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Logger::log( Level level AMQCPP_UNUSED, 
-                  const std::string& message AMQCPP_UNUSED)
-{
+void Logger::log( Level level AMQCPP_UNUSED,
+                  const std::string& message AMQCPP_UNUSED ) {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Logger::log(Level level AMQCPP_UNUSED, 
-                 const std::string& file AMQCPP_UNUSED, 
-                 const int line AMQCPP_UNUSED, 
-                 const std::string& message AMQCPP_UNUSED, 
-                 cms::CMSException& ex AMQCPP_UNUSED)
-{
+void Logger::log( Level level AMQCPP_UNUSED,
+                  const std::string& file AMQCPP_UNUSED,
+                  const int line AMQCPP_UNUSED,
+                  const std::string& message AMQCPP_UNUSED,
+                  cms::CMSException& ex AMQCPP_UNUSED ) {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Logger::log(Level level AMQCPP_UNUSED, 
-                 const std::string& file AMQCPP_UNUSED, 
-                 const int line AMQCPP_UNUSED, 
-                 const std::string& message AMQCPP_UNUSED, ...)
-{
+void Logger::log( Level level AMQCPP_UNUSED,
+                  const std::string& file AMQCPP_UNUSED,
+                  const int line AMQCPP_UNUSED,
+                  const std::string& message AMQCPP_UNUSED, ... ) {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Logger::log(LogRecord& record AMQCPP_UNUSED)
-{
+void Logger::log( LogRecord& record AMQCPP_UNUSED ) {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-Logger* Logger::getLogger(const std::string& name AMQCPP_UNUSED)
-{
+Logger* Logger::getLogger( const std::string& name AMQCPP_UNUSED ) {
     return NULL;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-Logger* Logger::getAnonymousLogger(void)
-{
+Logger* Logger::getAnonymousLogger() {
     return NULL;
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Logger.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Logger.h?view=diff&rev=528824&r1=528823&r2=528824
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Logger.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/Logger.h Sat Apr 14 08:50:57 2007
@@ -69,7 +69,7 @@
          */
         Logger( const std::string& name, Logger* parent );
         
-        virtual ~Logger(void);
+        virtual ~Logger();
         
         /**
          * Gets the name of this Logger
@@ -122,7 +122,7 @@
          * Gets the Filter object that this class is using.
          * @return the Filter in use, can be null
          */
-        virtual const Filter* getFilter(void) const {
+        virtual const Filter* getFilter() const {
             return filter;
         }
         
@@ -132,7 +132,7 @@
          * effective level will be inherited from its parent.
          * @return the level that is currently set
          */
-        virtual Level getLevel(void) const {
+        virtual Level getLevel() const {
             return level;
         }
         
@@ -156,7 +156,7 @@
          * its parent logger.
          * @return true if using Parent Handlers
          */
-        virtual bool getUseParentHandlers(void) const {
+        virtual bool getUseParentHandlers() const {
             return useParentHandlers;
         }
         
@@ -378,7 +378,7 @@
          * The caller is responsible for destroying the returned logger.
          * @return Newly created anonymous logger
          */
-        static Logger* getAnonymousLogger(void);
+        static Logger* getAnonymousLogger();
 
         /**
          * Find or create a logger for a named subsystem. If a logger has 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LoggerCommon.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LoggerCommon.h?view=diff&rev=528824&r1=528823&r2=528824
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LoggerCommon.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LoggerCommon.h Sat Apr 14 08:50:57 2007
@@ -24,22 +24,22 @@
 #undef DEBUG
 #endif
 
-   /**
-    * Defines an enumeration for logging levels
-    */
-   enum Level
-   {
-      Off,
-      Null,
-      Markblock,
-      Debug,
-      Info,
-      Warn,
-      Error,
-      Fatal,
-      Throwing
-   };
-   
+    /**
+     * Defines an enumeration for logging levels
+     */
+    enum Level
+    {
+        Off,
+        Null,
+        Markblock,
+        Debug,
+        Info,
+        Warn,
+        Error,
+        Fatal,
+        Throwing
+    };
+
 }}
 
 #endif /*_ACTIVEMQ_LOGGER_LOGGERCOMMON_H_ */

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LoggerHierarchy.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LoggerHierarchy.cpp?view=diff&rev=528824&r1=528823&r2=528824
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LoggerHierarchy.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LoggerHierarchy.cpp Sat Apr 14 08:50:57 2007
@@ -21,12 +21,10 @@
 using namespace activemq::logger;
 
 ////////////////////////////////////////////////////////////////////////////////
-LoggerHierarchy::LoggerHierarchy(void)
-{
+LoggerHierarchy::LoggerHierarchy(){
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-LoggerHierarchy::~LoggerHierarchy(void)
-{
+LoggerHierarchy::~LoggerHierarchy(){
 }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LoggerHierarchy.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LoggerHierarchy.h?view=diff&rev=528824&r1=528823&r2=528824
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LoggerHierarchy.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/LoggerHierarchy.h Sat Apr 14 08:50:57 2007
@@ -24,8 +24,8 @@
     {
     public:
 
-    	LoggerHierarchy(void);
-    	virtual ~LoggerHierarchy(void);
+        LoggerHierarchy();
+        virtual ~LoggerHierarchy();
 
     };
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/SimpleFormatter.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/SimpleFormatter.h?view=diff&rev=528824&r1=528823&r2=528824
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/SimpleFormatter.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/SimpleFormatter.h Sat Apr 14 08:50:57 2007
@@ -22,54 +22,53 @@
 namespace activemq{
 namespace logger{
 
-   /**
-    * Print a brief summary of the LogRecord in a human readable format. 
-    * The summary will typically be 1 or 2 lines.
-    */
-   class SimpleFormatter : public Formatter
-   {
-   public:
-      
-      SimpleFormatter(void) {}
-      virtual ~SimpleFormatter(void) {}
-
-      /**
-       * Format the given log record and return the formatted string.
-       * @param record The Log Record to Format
-       */
-      virtual std::string format( const LogRecord& record ) const {
-         return "";
-      }
-      
-      /**
-       * Format the message string from a log record.
-       * @param record The Log Record to Format
-       */
-      virtual std::string formatMessage( const LogRecord& record ) const{
-         return record.getMessage();
-      }
-      
-      /**
-       * 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 "";
-      }
-
-      /**
-       * 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 ) {
-         return "";
-      }
+    /**
+     * Print a brief summary of the LogRecord in a human readable format.
+     * The summary will typically be 1 or 2 lines.
+     */
+    class SimpleFormatter : public Formatter {
+    public:
 
-   };
+        SimpleFormatter() {}
+        virtual ~SimpleFormatter() {}
+
+        /**
+         * Format the given log record and return the formatted string.
+         * @param record The Log Record to Format
+         */
+        virtual std::string format( const LogRecord& record ) const {
+            return "";
+        }
+
+        /**
+         * Format the message string from a log record.
+         * @param record The Log Record to Format
+         */
+         virtual std::string formatMessage( const LogRecord& record ) const{
+            return record.getMessage();
+        }
+
+        /**
+         * 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 "";
+        }
+
+        /**
+         * 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 ) {
+            return "";
+        }
+
+    };
 
 }}
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/SimpleLogger.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/SimpleLogger.cpp?view=diff&rev=528824&r1=528823&r2=528824
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/SimpleLogger.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/SimpleLogger.cpp Sat Apr 14 08:50:57 2007
@@ -25,9 +25,9 @@
 using namespace std;
 
 ////////////////////////////////////////////////////////////////////////////////
-SimpleLogger::SimpleLogger(const std::string& name)
+SimpleLogger::SimpleLogger( const std::string& name )
 {
-   this->name = name;
+    this->name = name;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -35,54 +35,46 @@
 {}
 
 ////////////////////////////////////////////////////////////////////////////////
-void SimpleLogger::mark(const std::string& message)
-{
-   LogWriter::getInstance().log("", 0, "", message);
+void SimpleLogger::mark( const std::string& message ) {
+    LogWriter::getInstance().log( "", 0, "", message );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void SimpleLogger::debug(const std::string& file,
-                   const int          line,
-                   const std::string& message)
-{
-   LogWriter::getInstance().log(file, line, "DEBUG:", message);
+void SimpleLogger::debug( const std::string& file,
+                          const int          line,
+                          const std::string& message ) {
+    LogWriter::getInstance().log( file, line, "DEBUG:", message );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void SimpleLogger::info(const std::string& file,
-                  const int          line,
-                  const std::string& message)
-{
-   LogWriter::getInstance().log(file, line, "INFO:", message);
+void SimpleLogger::info( const std::string& file,
+                         const int          line,
+                         const std::string& message ) {
+    LogWriter::getInstance().log( file, line, "INFO:", message );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void SimpleLogger::warn(const std::string& file,
-                  const int          line,
-                  const std::string& message)
-{
-   LogWriter::getInstance().log(file, line, "WARNING:", message);
+void SimpleLogger::warn( const std::string& file,
+                         const int          line,
+                         const std::string& message ) {
+    LogWriter::getInstance().log( file, line, "WARNING:", message );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void SimpleLogger::error(const std::string& file,
-                   const int          line,
-                   const std::string& message)
-{
-   LogWriter::getInstance().log(file, line, "ERROR:", message);
+void SimpleLogger::error( const std::string& file,
+                          const int          line,
+                          const std::string& message ) {
+    LogWriter::getInstance().log( file, line, "ERROR:", message );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void SimpleLogger::fatal(const std::string& file,
-                   const int          line,
-                   const std::string& message)
-{
-   LogWriter::getInstance().log(file, line, "FATAL:", message);
+void SimpleLogger::fatal( const std::string& file,
+                          const int          line,
+                          const std::string& message ) {
+    LogWriter::getInstance().log( file, line, "FATAL:", message );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void SimpleLogger::log(const std::string& message)
-{
-   LogWriter::getInstance().log(message);
+void SimpleLogger::log(const std::string& message ) {
+    LogWriter::getInstance().log( message );
 }
-

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/StreamHandler.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/StreamHandler.h?view=diff&rev=528824&r1=528823&r2=528824
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/StreamHandler.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/logger/StreamHandler.h Sat Apr 14 08:50:57 2007
@@ -29,199 +29,187 @@
 namespace activemq{
 namespace logger{
 
-   class StreamHandler : public Handler
-   {
-   private:
-   
-      // OutputStream to write to
-      io::OutputStream* stream;
-      
-      // Formats this Handlers output
-      Formatter* formatter;
-      
-      // Filter object for Log Filtering
-      Filter* filter;
-
-   public:
-   
-      /**
-       * Create a StreamHandler, with no current output stream.
-       */
-      StreamHandler(void)
-      {
-         stream = NULL;
-         formatter = NULL;
-         filter = NULL;
-         
-         level = Level::FATAL;  // We take everything by default
-      }
-      
-      /**
-       * Create a StreamHandler, with no current output stream.
-       */
-      StreamHandler(io::OutputStream* stream, Formatter* formatter)
-      {
-         this->stream = stream;
-         this->formatter = formatter;
-         this->filter = NULL;
-         
-         level = Level::Fatal;  // We take everything by default
-      }
-
-      /**
-       * Destructor
-       */
-      virtual ~StreamHandler(void) 
-      {
-         try
-         {
-            close();
-         }
-         AMQ_CATCH_NOTHROW(exceptions::ActiveMQException)
-         AMQ_CATCALL_NOTHROW()
-      }
-
-      /**
-       * Close the current output stream.
-       * <p>
-       * The close method will perform a flush and then close the Handler. 
-       * After close has been called this Handler  should no longer be used. 
-       * Method calls may either be silently ignored or may throw runtime 
-       * exceptions.
-       * @throw CMSException
-       */
-      virtual void close(void) throw ( cms::CMSException )
-      {
-         if(stream)
-         {
-            stream.flush();
-            stream.close();
-         }
-      }
-      
-      /**
-       * Flush the Handler's output, clears any buffers.
-       */
-      virtual void flush(void)
-      {
-         if(stream)
-         {
-            stream->flush();
-         }
-      }
-      
-      /**
-       * Publish the Log Record to this Handler
-       * @param The Log Record to Publish
-       */
-      virtual void publish(const LogRecord& record)
-      {
-         try
-         {
-            if(!stream)
-            {
-               throw exceptions::NullPointerException(
-                  __FILE__, __LINE__,
-                  "StreamHandler::publish - Stream not set.");
+    class StreamHandler : public Handler {
+    private:
+
+        // OutputStream to write to
+        io::OutputStream* stream;
+
+        // Formats this Handlers output
+        Formatter* formatter;
+
+        // Filter object for Log Filtering
+        Filter* filter;
+
+    public:
+
+        /**
+         * Create a StreamHandler, with no current output stream.
+         */
+        StreamHandler() {
+            this->stream = NULL;
+            this->formatter = NULL;
+            this->filter = NULL;
+
+            this->level = Level::FATAL;  // We take everything by default
+        }
+
+        /**
+         * Create a StreamHandler, with no current output stream.
+         */
+        StreamHandler( io::OutputStream* stream, Formatter* formatter )
+        {
+            this->stream = stream;
+            this->formatter = formatter;
+            this->filter = NULL;
+
+           this->level = Level::Fatal;  // We take everything by default
+        }
+
+        /**
+         * Destructor
+         */
+        virtual ~StreamHandler() {
+            try {
+                this->close();
+            }
+            AMQ_CATCH_NOTHROW(exceptions::ActiveMQException)
+            AMQ_CATCALL_NOTHROW()
+        }
+
+        /**
+         * Close the current output stream.
+         * <p>
+         * The close method will perform a flush and then close the Handler.
+         * After close has been called this Handler  should no longer be used.
+         * Method calls may either be silently ignored or may throw runtime
+         * exceptions.
+         * @throw CMSException
+         */
+        virtual void close() throw ( cms::CMSException ) {
+            if( stream ) {
+                stream.flush();
+                stream.close();
+            }
+        }
+
+        /**
+         * Flush the Handler's output, clears any buffers.
+         */
+        virtual void flush() {
+            if(stream) {
+                stream->flush();
+            }
+        }
+
+        /**
+         * Publish the Log Record to this Handler
+         * @param The Log Record to Publish
+         */
+        virtual void publish( const LogRecord& record ) {
+
+            try {
+
+                if( !stream ) {
+                    throw exceptions::NullPointerException(
+                        __FILE__, __LINE__,
+                        "StreamHandler::publish - Stream not set.");
+                }
+
+                // Check if we should log this record
+                if(isLoggable( record) ) {
+
+                    std::string log = formatter->format(record);
+
+                    synchronized(stream) {
+                        // Write the data to the stream
+                        stream->write(log.c_str(), log.length());
+                    }
+                }
             }
-            
-            // Check if we should log this record
-            if(isLoggable(record))
-            {
-               std::string log = formatter->format(record);
-   
-               synchronized(stream)
-               {
-                  // Write the data to the stream
-                  stream->write(log.c_str(), log.length());
-               }
+            AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+            AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+        }
+
+        /**
+         * Check if this Handler would actually log a given LogRecord.
+         * <p>
+         * @param <code>LogRecord</code> to check
+         */
+        virtual void isLoggable( const LogRecord& record ) {
+
+            if( filter ) {
+                // Allow for some filtering to occurr
+                return filter->isLoggable( record );
             }
-         }
-         AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
-         AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
-      }
-      
-      /**
-       * Check if this Handler would actually log a given LogRecord.
-       * <p>
-       * 
-       * @param <code>LogRecord</code> to check
-       */
-      virtual void isLoggable(const LogRecord& record)
-      {
-         if(filter)
-         {
-            // Allow for some filtering to occurr
-            return filter->isLoggable(record));
-         }
-
-         // By default we want everything that is greater than or
-         // equal to the set level of this Handler.
-         return record.level >= level;
-      }
-      
-      /**
-       * Sets the Filter that this Handler uses to filter Log Records
-       * @param <code>Filter</code> derived instance
-       */
-      virtual void setFilter(const Filter* filter){
-         this->filter = filter;
-      }
-      
-      /**
-       * Gets the Filter that this Handler uses to filter Log Records
-       * @param <code>Filter</code> derived instance
-       */
-      virtual const Filter* getFilter(void){
-         return filter;
-      }
-      
-      /**
-       * Set the log level specifying which message levels will be logged 
-       * by this Handler.
-       * <p>
-       * The intention is to allow developers to turn on voluminous logging, 
-       * but to limit the messages that are sent to certain Handlers.
-       * @param Level enumeration value
-       */
-      virtual void setLevel(Level level){
-         this->level = level;
-      }
-      
-      /**
-       * Get the log level specifying which message levels will be logged 
-       * by this Handler.
-       * @param Level enumeration value
-       */
-      virtual Level getLevel(void){
-         return level;
-      }
-      
-      /**
-       * Sets the <code>Formatter</code> used by this Handler
-       * @param <code>Filter</code> derived instance
-       */
-      virtual void setFormatter(const Formatter* formatter){
-         this->formatter = formatter;
-      }
-      
-      /**
-       * Gets the <code>Formatter</code> used by this Handler
-       * @param <code>Filter</code> derived instance
-       */
-      virtual const Formatter* getFormatter(void){
-         return formatter;
-      }
-      
-      /**
-       * Gets the output Stream that this Handler is using
-       * @return OuputStream pointer
-       */
-      virtual io::OutputStream* getOutputStream(void) const(
-         return stream;
-      }
 
-   };
+            // By default we want everything that is greater than or
+            // equal to the set level of this Handler.
+            return record.level >= level;
+        }
+
+        /**
+         * Sets the Filter that this Handler uses to filter Log Records
+         * @param <code>Filter</code> derived instance
+         */
+        virtual void setFilter( const Filter* filter ){
+            this->filter = filter;
+        }
+
+        /**
+         * Gets the Filter that this Handler uses to filter Log Records
+         * @param <code>Filter</code> derived instance
+         */
+        virtual const Filter* getFilter(){
+            return filter;
+        }
+
+        /**
+         * Set the log level specifying which message levels will be logged
+         * by this Handler.
+         * <p>
+         * The intention is to allow developers to turn on voluminous logging,
+         * but to limit the messages that are sent to certain Handlers.
+         * @param Level enumeration value
+         */
+        virtual void setLevel( Level level ){
+            this->level = level;
+        }
+
+        /**
+         * Get the log level specifying which message levels will be logged
+         * by this Handler.
+         * @param Level enumeration value
+         */
+        virtual Level getLevel(){
+            return level;
+        }
+
+        /**
+         * Sets the <code>Formatter</code> used by this Handler
+         * @param <code>Filter</code> derived instance
+         */
+        virtual void setFormatter( const Formatter* formatter ){
+            this->formatter = formatter;
+        }
+
+        /**
+         * Gets the <code>Formatter</code> used by this Handler
+         * @param <code>Filter</code> derived instance
+         */
+        virtual const Formatter* getFormatter(){
+            return formatter;
+        }
+
+        /**
+         * Gets the output Stream that this Handler is using
+         * @return OuputStream pointer
+         */
+        virtual io::OutputStream* getOutputStream() const(
+            return stream;
+        }
+
+    };
 
 }}
 



Mime
View raw message