activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r419365 [15/25] - in /incubator/activemq/trunk: activemq-core/src/main/java/org/apache/activemq/thread/ activemq-core/src/test/java/org/apache/activemq/openwire/v1/ activemq-cpp/src/main/activemq/concurrent/ activemq-cpp/src/main/activemq/c...
Date Wed, 05 Jul 2006 22:27:47 GMT
Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/Logger.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/Logger.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/Logger.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/Logger.h Wed Jul  5 15:27:34 2006
@@ -1,425 +1,425 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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.
- */
-#ifndef _ACTIVEMQ_LOGGER_LOGGER_H_
-#define _ACTIVEMQ_LOGGER_LOGGER_H_
-
-#include <activemq/logger/LoggerCommon.h>
-#include <activemq/logger/LogRecord.h>
-#include <activemq/exceptions/IllegalArgumentException.h>
-
-#include <list>
-#include <string>
-#include <stdarg.h>
-
-namespace activemq{
-namespace logger{
-    
-    class Handler;
-    class Filter;
-
-    class Logger
-    {
-    private:
-    
-        // The name of this Logger
-        std::string name;
-        
-        // The Parent of this Logger
-        Logger* parent;
-        
-        // list of Handlers owned by this logger
-        std::list<Handler*> handlers;
-        
-        // Filter used by this Logger
-        Filter* filter;
-        
-        // The Log Level of this Logger
-        Level level;
-        
-        // Using Parent Handlers?
-        bool useParentHandlers;
-    
-    public:
-    
-        /**
-         * Creates a new instance of the Logger with the given name
-         * and assign it the given parent logger.
-         * <p>
-         * The logger will be initially configured with a null Level 
-         * and with useParentHandlers true.
-         * @param name - A name for the logger. This should be a 
-         * dot-separated name and should normally be based on the package 
-         * name or class name of the subsystem, such as java.net or 
-         * javax.swing. It may be null for anonymous Loggers.
-         */
-        Logger(const std::string& name, Logger* parent);
-        
-        /**
-         * Destructor
-         */
-        virtual ~Logger(void);
-        
-        /**
-         * Gets the name of this Logger
-         * 
-         * @return logger name
-         */
-        virtual const std::string& getName(void) const {
-            return name;
-        }
-
-        /**
-         * Add a log Handler to receive logging messages.
-         * <p>
-         * By default, Loggers also send their output to their parent logger.
-         * Typically the root Logger is configured with a set of Handlers 
-         * that essentially act as default handlers for all loggers.
-         * 
-         * @param A Logging Handler
-         * #throws IllegalArgumentException
-         */
-        virtual void addHandler(Handler* handler) 
-            throw ( exceptions::IllegalArgumentException );
-        
-        /**
-         * Removes the specified Handler and destroys it
-         * <p>
-         * Returns silently if the given Handler is not found.
-         * 
-         * @param The Handler to remove
-         */
-        virtual void removeHandler(Handler* handler);
-
-        /**
-         * Gets a vector containing all the handlers that this class
-         * has been assigned to use.
-         */        
-        virtual const std::list<Handler*>& getHandlers(void) const;
-        
-        /**
-         * Set a filter to control output on this Logger.
-         * <p>
-         * After passing the initial "level" check, the Logger will call 
-         * this Filter to check if a log record should really be published. 
-         * <p>
-         * The caller releases ownership of this filter to this logger
-         * 
-         * @param Filter to use, can be null
-         */
-        virtual void setFilter(Filter* filter); 
-        
-        /**
-         * Gets the Filter object that this class is using.
-         * @return the Filter in use, can be null
-         */
-        virtual const Filter* getFilter(void) const {
-            return filter;
-        }
-        
-        /**
-         * Get the log Level that has been specified for this Logger. The 
-         * result may be the Null level, which means that this logger's 
-         * effective level will be inherited from its parent.
-         */
-        virtual Level getLevel(void) const {
-            return level;
-        }
-        
-        /**
-         * Set the log level specifying which message levels will be logged 
-         * by this logger. Message levels lower than this value will be 
-         * discarded. The level value Level.OFF can be used to turn off 
-         * logging.
-         * <p>
-         * If the new level is the Null Level, it means that this node 
-         * should inherit its level from its nearest ancestor with a 
-         * specific (non-null) level value. 
-         * 
-         * @param new Level value
-         */
-        virtual void setLevel(Level level) {
-            this->level = level;
-        }
-        
-        /**
-         * Discover whether or not this logger is sending its output to 
-         * its parent logger.
-         * 
-         * @return true if using Parent Handlers
-         */
-        virtual bool getUseParentHandlers(void) const {
-            return useParentHandlers;
-        }
-        
-        /**
-         * pecify whether or not this logger should send its output to it's 
-         * parent Logger. This means that any LogRecords will also be 
-         * written to the parent's Handlers, and potentially to its parent, 
-         * recursively up the namespace.
-         * 
-         * @param True is output is to be writen to the parent
-         */
-        virtual void setUseParentHandlers(bool value) {
-            this->useParentHandlers = value;
-        }
-        
-        /**
-         * Logs an Block Enter message
-         * <p>
-         * This is a convenience method that is used to tag a block enter, a
-         * log record with the class name function name and the string 
-         * Entering is logged at the DEBUG log level.
-         * @param source block name
-         * @param source file name
-         * @param source line name
-         */
-        virtual void entry(const std::string& blockName,
-                           const std::string& file,
-                           const int line);
-        
-        /**
-         * Logs an Block Exit message
-         * <p>
-         * This is a convenience method that is used to tag a block exit, a
-         * log record with the class name function name and the string 
-         * Exiting is logged at the DEBUG log level.
-         * @param source block name
-         * @param source file name
-         * @param source line name
-         */
-        virtual void exit(const std::string& blockName,
-                          const std::string& file,
-                          const int line);
-
-        /**
-         * Log a Debug Level Log
-         * <p>
-         * If the logger is currently enabled for the DEBUG message level 
-         * then the given message is forwarded to all the registered output
-         * Handler objects.
-         * 
-         * @param file name where the log was generated
-         * @param line number where the log was generated
-         * @param name of the function that logged this
-         * @param the message to log
-         */
-        virtual void debug(const std::string& file,
-                           const int line,
-                           const std::string fnctionName,
-                           const std::string& message);
-
-        /**
-         * Log a info Level Log
-         * <p>
-         * If the logger is currently enabled for the info message level 
-         * then the given message is forwarded to all the registered output
-         * Handler objects.
-         * 
-         * @param file name where the log was generated
-         * @param line number where the log was generated
-         * @param name of the function that logged this
-         * @param the message to log
-         */
-        virtual void info(const std::string& file,
-                          const int line,
-                          const std::string fnctionName,
-                          const std::string& message);
-
-        /**
-         * Log a warn Level Log
-         * <p>
-         * If the logger is currently enabled for the warn message level 
-         * then the given message is forwarded to all the registered output
-         * Handler objects.
-         * 
-         * @param file name where the log was generated
-         * @param line number where the log was generated
-         * @param name of the function that logged this
-         * @param the message to log
-         */
-        virtual void warn(const std::string& file,
-                          const int line,
-                          const std::string fnctionName,
-                          const std::string& message);
-                        
-        /**
-         * Log a error Level Log
-         * <p>
-         * If the logger is currently enabled for the error message level 
-         * then the given message is forwarded to all the registered output
-         * Handler objects.
-         * 
-         * @param file name where the log was generated
-         * @param line number where the log was generated
-         * @param name of the function that logged this
-         * @param the message to log
-         */
-        virtual void error(const std::string& file,
-                           const int line,
-                           const std::string fnctionName,
-                           const std::string& message);
-
-        /**
-         * Log a fatal Level Log
-         * <p>
-         * If the logger is currently enabled for the fatal message level 
-         * then the given message is forwarded to all the registered output
-         * Handler objects.
-         * 
-         * @param file name where the log was generated
-         * @param line number where the log was generated
-         * @param name of the function that logged this
-         * @param the message to log
-         */
-        virtual void fatal(const std::string& file,
-                           const int line,
-                           const std::string fnctionName,
-                           const std::string& message);
-                         
-        /**
-         * Log a Throw Message
-         * <p>
-         * If the logger is currently enabled for the Throwing message level 
-         * then the given message is forwarded to all the registered output
-         * Handler objects.
-         * 
-         * @param file name where the log was generated
-         * @param line number where the log was generated
-         * @param name of the function that logged this
-         * @param the message to log
-         */
-        virtual void throwing(const std::string& file,
-                              const int line,
-                              const std::string fnctionName,
-                              const std::string& message);
-        
-        /**
-         * Check if a message of the given level would actually be logged 
-         * by this logger. This check is based on the Loggers effective 
-         * level, which may be inherited from its parent.
-         * 
-         * @param level - a message logging level 
-         * returns true if the given message level is currently being logged.
-         */
-        virtual bool isLoggable(Level level) const;
-        
-        /**
-         * Log a LogRecord.
-         *
-         * All the other logging methods in this class call through this 
-         * method to actually perform any logging. Subclasses can override 
-         * this single method to capture all log activity. 
-         * 
-         * @param record - the LogRecord to be published
-         */
-        virtual void log(LogRecord& record);
-         
-        /**
-         * Log a message, with no arguments.
-         * <p>
-         * If the logger is currently enabled for the given message level 
-         * then the given message is forwarded to all the registered output 
-         * Handler objects
-         * 
-         * @param the Level to log at
-         * @param the message to log
-         */
-        virtual void log(Level level, const std::string& message);
-
-        /**
-         * Log a message, with the list of params that is formatted into
-         * the message string.
-         * <p>
-         * If the logger is currently enabled for the given message level 
-         * then the given message is forwarded to all the registered output 
-         * Handler objects
-         * 
-         * @param the Level to log at
-         * @param the message to log
-         * @param variable length arguement to format the message string.
-         */
-        virtual void log(Level level, 
-                         const std::string& file,
-                         const int line,
-                         const std::string& message, ...);
-
-        /**
-         * Log a message, with associated Throwable information.
-         *
-         * If the logger is currently enabled for the given message level 
-         * then the given arguments are stored in a LogRecord which is 
-         * forwarded to all registered output handlers.
-         *
-         * Note that the thrown argument is stored in the LogRecord thrown 
-         * property, rather than the LogRecord parameters property. Thus is 
-         * it processed specially by output Formatters and is not treated 
-         * as a formatting parameter to the LogRecord message property. 
-         * 
-         * @param the Level to log at
-         * @param File that the message was logged in
-         * @param line number where the message was logged at.
-         * @param Exception to log
-         */
-        virtual void log(Level level, 
-                         const std::string& file,
-                         const int line,
-                         const std::string& message, 
-                         cms::CMSException& ex);
-
-    public:
-    
-        /**
-         * Creates an anonymous logger
-         * <p>
-         * The newly created Logger is not registered in the LogManager 
-         * namespace. There will be no access checks on updates to the 
-         * logger.
-         * Even although the new logger is anonymous, it is configured to 
-         * have the root logger ("") as its parent. This means that by 
-         * default it inherits its effective level and handlers from the 
-         * root logger.
-         * <p>
-         * The caller is responsible for destroying the returned logger.
-         * 
-         * @return Newly created anonymous logger
-         */
-        static Logger* getAnonymousLogger(void);
-
-        /**
-         * Find or create a logger for a named subsystem. If a logger has 
-         * already been created with the given name it is returned. 
-         * Otherwise a new logger is created.
-         * <p>
-         * If a new logger is created its log level will be configured based 
-         * on the LogManager and it will configured to also send logging 
-         * output to its parent loggers Handlers. It will be registered in 
-         * the LogManager global namespace. 
-         * 
-         * @param name - A name for the logger. This should be a 
-         * dot-separated name and should normally be based on the package 
-         * name or class name of the subsystem, such as cms or 
-         * activemq.core.ActiveMQConnection
-         * 
-         * @return a suitable logger.
-         */
-        static Logger* getLogger(const std::string& name);
-
-    };
-
-}}
-
-#endif /*_ACTIVEMQ_LOGGER_LOGGER_H_*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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.
+ */
+#ifndef _ACTIVEMQ_LOGGER_LOGGER_H_
+#define _ACTIVEMQ_LOGGER_LOGGER_H_
+
+#include <activemq/logger/LoggerCommon.h>
+#include <activemq/logger/LogRecord.h>
+#include <activemq/exceptions/IllegalArgumentException.h>
+
+#include <list>
+#include <string>
+#include <stdarg.h>
+
+namespace activemq{
+namespace logger{
+    
+    class Handler;
+    class Filter;
+
+    class Logger
+    {
+    private:
+    
+        // The name of this Logger
+        std::string name;
+        
+        // The Parent of this Logger
+        Logger* parent;
+        
+        // list of Handlers owned by this logger
+        std::list<Handler*> handlers;
+        
+        // Filter used by this Logger
+        Filter* filter;
+        
+        // The Log Level of this Logger
+        Level level;
+        
+        // Using Parent Handlers?
+        bool useParentHandlers;
+    
+    public:
+    
+        /**
+         * Creates a new instance of the Logger with the given name
+         * and assign it the given parent logger.
+         * <p>
+         * The logger will be initially configured with a null Level 
+         * and with useParentHandlers true.
+         * @param name - A name for the logger. This should be a 
+         * dot-separated name and should normally be based on the package 
+         * name or class name of the subsystem, such as java.net or 
+         * javax.swing. It may be null for anonymous Loggers.
+         */
+        Logger(const std::string& name, Logger* parent);
+        
+        /**
+         * Destructor
+         */
+        virtual ~Logger(void);
+        
+        /**
+         * Gets the name of this Logger
+         * 
+         * @return logger name
+         */
+        virtual const std::string& getName(void) const {
+            return name;
+        }
+
+        /**
+         * Add a log Handler to receive logging messages.
+         * <p>
+         * By default, Loggers also send their output to their parent logger.
+         * Typically the root Logger is configured with a set of Handlers 
+         * that essentially act as default handlers for all loggers.
+         * 
+         * @param A Logging Handler
+         * #throws IllegalArgumentException
+         */
+        virtual void addHandler(Handler* handler) 
+            throw ( exceptions::IllegalArgumentException );
+        
+        /**
+         * Removes the specified Handler and destroys it
+         * <p>
+         * Returns silently if the given Handler is not found.
+         * 
+         * @param The Handler to remove
+         */
+        virtual void removeHandler(Handler* handler);
+
+        /**
+         * Gets a vector containing all the handlers that this class
+         * has been assigned to use.
+         */        
+        virtual const std::list<Handler*>& getHandlers(void) const;
+        
+        /**
+         * Set a filter to control output on this Logger.
+         * <p>
+         * After passing the initial "level" check, the Logger will call 
+         * this Filter to check if a log record should really be published. 
+         * <p>
+         * The caller releases ownership of this filter to this logger
+         * 
+         * @param Filter to use, can be null
+         */
+        virtual void setFilter(Filter* filter); 
+        
+        /**
+         * Gets the Filter object that this class is using.
+         * @return the Filter in use, can be null
+         */
+        virtual const Filter* getFilter(void) const {
+            return filter;
+        }
+        
+        /**
+         * Get the log Level that has been specified for this Logger. The 
+         * result may be the Null level, which means that this logger's 
+         * effective level will be inherited from its parent.
+         */
+        virtual Level getLevel(void) const {
+            return level;
+        }
+        
+        /**
+         * Set the log level specifying which message levels will be logged 
+         * by this logger. Message levels lower than this value will be 
+         * discarded. The level value Level.OFF can be used to turn off 
+         * logging.
+         * <p>
+         * If the new level is the Null Level, it means that this node 
+         * should inherit its level from its nearest ancestor with a 
+         * specific (non-null) level value. 
+         * 
+         * @param new Level value
+         */
+        virtual void setLevel(Level level) {
+            this->level = level;
+        }
+        
+        /**
+         * Discover whether or not this logger is sending its output to 
+         * its parent logger.
+         * 
+         * @return true if using Parent Handlers
+         */
+        virtual bool getUseParentHandlers(void) const {
+            return useParentHandlers;
+        }
+        
+        /**
+         * pecify whether or not this logger should send its output to it's 
+         * parent Logger. This means that any LogRecords will also be 
+         * written to the parent's Handlers, and potentially to its parent, 
+         * recursively up the namespace.
+         * 
+         * @param True is output is to be writen to the parent
+         */
+        virtual void setUseParentHandlers(bool value) {
+            this->useParentHandlers = value;
+        }
+        
+        /**
+         * Logs an Block Enter message
+         * <p>
+         * This is a convenience method that is used to tag a block enter, a
+         * log record with the class name function name and the string 
+         * Entering is logged at the DEBUG log level.
+         * @param source block name
+         * @param source file name
+         * @param source line name
+         */
+        virtual void entry(const std::string& blockName,
+                           const std::string& file,
+                           const int line);
+        
+        /**
+         * Logs an Block Exit message
+         * <p>
+         * This is a convenience method that is used to tag a block exit, a
+         * log record with the class name function name and the string 
+         * Exiting is logged at the DEBUG log level.
+         * @param source block name
+         * @param source file name
+         * @param source line name
+         */
+        virtual void exit(const std::string& blockName,
+                          const std::string& file,
+                          const int line);
+
+        /**
+         * Log a Debug Level Log
+         * <p>
+         * If the logger is currently enabled for the DEBUG message level 
+         * then the given message is forwarded to all the registered output
+         * Handler objects.
+         * 
+         * @param file name where the log was generated
+         * @param line number where the log was generated
+         * @param name of the function that logged this
+         * @param the message to log
+         */
+        virtual void debug(const std::string& file,
+                           const int line,
+                           const std::string fnctionName,
+                           const std::string& message);
+
+        /**
+         * Log a info Level Log
+         * <p>
+         * If the logger is currently enabled for the info message level 
+         * then the given message is forwarded to all the registered output
+         * Handler objects.
+         * 
+         * @param file name where the log was generated
+         * @param line number where the log was generated
+         * @param name of the function that logged this
+         * @param the message to log
+         */
+        virtual void info(const std::string& file,
+                          const int line,
+                          const std::string fnctionName,
+                          const std::string& message);
+
+        /**
+         * Log a warn Level Log
+         * <p>
+         * If the logger is currently enabled for the warn message level 
+         * then the given message is forwarded to all the registered output
+         * Handler objects.
+         * 
+         * @param file name where the log was generated
+         * @param line number where the log was generated
+         * @param name of the function that logged this
+         * @param the message to log
+         */
+        virtual void warn(const std::string& file,
+                          const int line,
+                          const std::string fnctionName,
+                          const std::string& message);
+                        
+        /**
+         * Log a error Level Log
+         * <p>
+         * If the logger is currently enabled for the error message level 
+         * then the given message is forwarded to all the registered output
+         * Handler objects.
+         * 
+         * @param file name where the log was generated
+         * @param line number where the log was generated
+         * @param name of the function that logged this
+         * @param the message to log
+         */
+        virtual void error(const std::string& file,
+                           const int line,
+                           const std::string fnctionName,
+                           const std::string& message);
+
+        /**
+         * Log a fatal Level Log
+         * <p>
+         * If the logger is currently enabled for the fatal message level 
+         * then the given message is forwarded to all the registered output
+         * Handler objects.
+         * 
+         * @param file name where the log was generated
+         * @param line number where the log was generated
+         * @param name of the function that logged this
+         * @param the message to log
+         */
+        virtual void fatal(const std::string& file,
+                           const int line,
+                           const std::string fnctionName,
+                           const std::string& message);
+                         
+        /**
+         * Log a Throw Message
+         * <p>
+         * If the logger is currently enabled for the Throwing message level 
+         * then the given message is forwarded to all the registered output
+         * Handler objects.
+         * 
+         * @param file name where the log was generated
+         * @param line number where the log was generated
+         * @param name of the function that logged this
+         * @param the message to log
+         */
+        virtual void throwing(const std::string& file,
+                              const int line,
+                              const std::string fnctionName,
+                              const std::string& message);
+        
+        /**
+         * Check if a message of the given level would actually be logged 
+         * by this logger. This check is based on the Loggers effective 
+         * level, which may be inherited from its parent.
+         * 
+         * @param level - a message logging level 
+         * returns true if the given message level is currently being logged.
+         */
+        virtual bool isLoggable(Level level) const;
+        
+        /**
+         * Log a LogRecord.
+         *
+         * All the other logging methods in this class call through this 
+         * method to actually perform any logging. Subclasses can override 
+         * this single method to capture all log activity. 
+         * 
+         * @param record - the LogRecord to be published
+         */
+        virtual void log(LogRecord& record);
+         
+        /**
+         * Log a message, with no arguments.
+         * <p>
+         * If the logger is currently enabled for the given message level 
+         * then the given message is forwarded to all the registered output 
+         * Handler objects
+         * 
+         * @param the Level to log at
+         * @param the message to log
+         */
+        virtual void log(Level level, const std::string& message);
+
+        /**
+         * Log a message, with the list of params that is formatted into
+         * the message string.
+         * <p>
+         * If the logger is currently enabled for the given message level 
+         * then the given message is forwarded to all the registered output 
+         * Handler objects
+         * 
+         * @param the Level to log at
+         * @param the message to log
+         * @param variable length arguement to format the message string.
+         */
+        virtual void log(Level level, 
+                         const std::string& file,
+                         const int line,
+                         const std::string& message, ...);
+
+        /**
+         * Log a message, with associated Throwable information.
+         *
+         * If the logger is currently enabled for the given message level 
+         * then the given arguments are stored in a LogRecord which is 
+         * forwarded to all registered output handlers.
+         *
+         * Note that the thrown argument is stored in the LogRecord thrown 
+         * property, rather than the LogRecord parameters property. Thus is 
+         * it processed specially by output Formatters and is not treated 
+         * as a formatting parameter to the LogRecord message property. 
+         * 
+         * @param the Level to log at
+         * @param File that the message was logged in
+         * @param line number where the message was logged at.
+         * @param Exception to log
+         */
+        virtual void log(Level level, 
+                         const std::string& file,
+                         const int line,
+                         const std::string& message, 
+                         cms::CMSException& ex);
+
+    public:
+    
+        /**
+         * Creates an anonymous logger
+         * <p>
+         * The newly created Logger is not registered in the LogManager 
+         * namespace. There will be no access checks on updates to the 
+         * logger.
+         * Even although the new logger is anonymous, it is configured to 
+         * have the root logger ("") as its parent. This means that by 
+         * default it inherits its effective level and handlers from the 
+         * root logger.
+         * <p>
+         * The caller is responsible for destroying the returned logger.
+         * 
+         * @return Newly created anonymous logger
+         */
+        static Logger* getAnonymousLogger(void);
+
+        /**
+         * Find or create a logger for a named subsystem. If a logger has 
+         * already been created with the given name it is returned. 
+         * Otherwise a new logger is created.
+         * <p>
+         * If a new logger is created its log level will be configured based 
+         * on the LogManager and it will configured to also send logging 
+         * output to its parent loggers Handlers. It will be registered in 
+         * the LogManager global namespace. 
+         * 
+         * @param name - A name for the logger. This should be a 
+         * dot-separated name and should normally be based on the package 
+         * name or class name of the subsystem, such as cms or 
+         * activemq.core.ActiveMQConnection
+         * 
+         * @return a suitable logger.
+         */
+        static Logger* getLogger(const std::string& name);
+
+    };
+
+}}
+
+#endif /*_ACTIVEMQ_LOGGER_LOGGER_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/Logger.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/LoggerCommon.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/LoggerCommon.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/LoggerCommon.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/LoggerCommon.h Wed Jul  5 15:27:34 2006
@@ -1,45 +1,45 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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.
- */
-#ifndef _ACTIVEMQ_LOGGER_LOGGERCOMMON_H_
-#define _ACTIVEMQ_LOGGER_LOGGERCOMMON_H_
-
-namespace activemq{
-namespace logger{
-
-#ifdef DEBUG
-#undef DEBUG
-#endif
-
-   /**
-    * Defines an enumeration for logging levels
-    */
-   enum Level
-   {
-      Off,
-      Null,
-      Markblock,
-      Debug,
-      Info,
-      Warn,
-      Error,
-      Fatal,
-      Throwing
-   };
-   
-}}
-
-#endif /*_ACTIVEMQ_LOGGER_LOGGERCOMMON_H_ */
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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.
+ */
+#ifndef _ACTIVEMQ_LOGGER_LOGGERCOMMON_H_
+#define _ACTIVEMQ_LOGGER_LOGGERCOMMON_H_
+
+namespace activemq{
+namespace logger{
+
+#ifdef DEBUG
+#undef DEBUG
+#endif
+
+   /**
+    * Defines an enumeration for logging levels
+    */
+   enum Level
+   {
+      Off,
+      Null,
+      Markblock,
+      Debug,
+      Info,
+      Warn,
+      Error,
+      Fatal,
+      Throwing
+   };
+   
+}}
+
+#endif /*_ACTIVEMQ_LOGGER_LOGGERCOMMON_H_ */

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/LoggerCommon.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/LoggerDefines.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/LoggerDefines.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/LoggerDefines.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/LoggerDefines.h Wed Jul  5 15:27:34 2006
@@ -1,55 +1,55 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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.
- */
-#ifndef _ACTIVEMQ_LOGGER_LOGGERDEFINES_H_
-#define _ACTIVEMQ_LOGGER_LOGGERDEFINES_H_
-
-#include <activemq/logger/SimpleLogger.h>
-#include <sstream>
-
-#define LOGCMS_DECLARE(loggerName)                                  \
-   static activemq::logger::SimpleLogger loggerName;
-
-#define LOGCMS_INITIALIZE(loggerName, className, loggerFamily)      \
-   activemq::logger::SimpleLogger className::loggerName(loggerFamily);
-
-#define LOGCMS_DECLARE_LOCAL(loggerName)                            \
-   activemq::logger::Logger loggerName;
-
-#define LOGCMS_DEBUG(logger, message)                               \
-   logger.debug(__FILE__, __LINE__, message);
-
-#define LOGCMS_DEBUG_1(logger, message, value);                     \
-   {                                                                \
-      std::ostringstream ostream;                                   \
-      ostream << message << value;                                  \
-      logger.debug(__FILE__, __LINE__, ostream.str());              \
-   }
-
-#define LOGCMS_INFO(logger, message)                                \
-   logger.info(__FILE__, __LINE__, message);
-
-#define LOGCMS_ERROR(logger, message)                               \
-   logger.error(__FILE__, __LINE__, message);
-
-#define LOGCMS_WARN(logger, message)                                \
-   logger.warn(__FILE__, __LINE__, message);
-
-#define LOGCMS_FATAL(logger, message)                               \
-   logger.fatal(__FILE__, __LINE__, message);
-
-
-#endif
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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.
+ */
+#ifndef _ACTIVEMQ_LOGGER_LOGGERDEFINES_H_
+#define _ACTIVEMQ_LOGGER_LOGGERDEFINES_H_
+
+#include <activemq/logger/SimpleLogger.h>
+#include <sstream>
+
+#define LOGCMS_DECLARE(loggerName)                                  \
+   static activemq::logger::SimpleLogger loggerName;
+
+#define LOGCMS_INITIALIZE(loggerName, className, loggerFamily)      \
+   activemq::logger::SimpleLogger className::loggerName(loggerFamily);
+
+#define LOGCMS_DECLARE_LOCAL(loggerName)                            \
+   activemq::logger::Logger loggerName;
+
+#define LOGCMS_DEBUG(logger, message)                               \
+   logger.debug(__FILE__, __LINE__, message);
+
+#define LOGCMS_DEBUG_1(logger, message, value);                     \
+   {                                                                \
+      std::ostringstream ostream;                                   \
+      ostream << message << value;                                  \
+      logger.debug(__FILE__, __LINE__, ostream.str());              \
+   }
+
+#define LOGCMS_INFO(logger, message)                                \
+   logger.info(__FILE__, __LINE__, message);
+
+#define LOGCMS_ERROR(logger, message)                               \
+   logger.error(__FILE__, __LINE__, message);
+
+#define LOGCMS_WARN(logger, message)                                \
+   logger.warn(__FILE__, __LINE__, message);
+
+#define LOGCMS_FATAL(logger, message)                               \
+   logger.fatal(__FILE__, __LINE__, message);
+
+
+#endif

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/LoggerDefines.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/LoggerHierarchy.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/LoggerHierarchy.cpp?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/LoggerHierarchy.cpp (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/LoggerHierarchy.cpp Wed Jul  5 15:27:34 2006
@@ -1,32 +1,32 @@
-/*
-* Copyright 2006 The Apache Software Foundation or its licensors, as
-* applicable.
-*
-* Licensed 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 "LoggerHierarchy.h"
-
-using namespace activemq;
-using namespace activemq::logger;
-
-////////////////////////////////////////////////////////////////////////////////
-LoggerHierarchy::LoggerHierarchy(void)
-{
-}
-
-////////////////////////////////////////////////////////////////////////////////
-LoggerHierarchy::~LoggerHierarchy(void)
-{
-}
-
+/*
+* Copyright 2006 The Apache Software Foundation or its licensors, as
+* applicable.
+*
+* Licensed 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 "LoggerHierarchy.h"
+
+using namespace activemq;
+using namespace activemq::logger;
+
+////////////////////////////////////////////////////////////////////////////////
+LoggerHierarchy::LoggerHierarchy(void)
+{
+}
+
+////////////////////////////////////////////////////////////////////////////////
+LoggerHierarchy::~LoggerHierarchy(void)
+{
+}
+

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/LoggerHierarchy.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/LoggerHierarchy.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/LoggerHierarchy.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/LoggerHierarchy.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/LoggerHierarchy.h Wed Jul  5 15:27:34 2006
@@ -1,41 +1,41 @@
-/*
-* Copyright 2006 The Apache Software Foundation or its licensors, as
-* applicable.
-*
-* Licensed 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.
-*/
-#ifndef _ACTIVEMQ_LOGGER_LOGGERHIERARCHY_H_
-#define _ACTIVEMQ_LOGGER_LOGGERHIERARCHY_H_
-
-namespace activemq{
-namespace logger{
-
-    class LoggerHierarchy
-    {
-    public:
-
-        /**
-         * Default Constructor
-         */
-    	LoggerHierarchy(void);
-
-        /**
-         * Destructor
-         */
-    	virtual ~LoggerHierarchy(void);
-
-    };
-
-}}
-
-#endif /*_ACTIVEMQ_LOGGER_LOGGERHIERARCHY_H_*/
+/*
+* Copyright 2006 The Apache Software Foundation or its licensors, as
+* applicable.
+*
+* Licensed 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.
+*/
+#ifndef _ACTIVEMQ_LOGGER_LOGGERHIERARCHY_H_
+#define _ACTIVEMQ_LOGGER_LOGGERHIERARCHY_H_
+
+namespace activemq{
+namespace logger{
+
+    class LoggerHierarchy
+    {
+    public:
+
+        /**
+         * Default Constructor
+         */
+    	LoggerHierarchy(void);
+
+        /**
+         * Destructor
+         */
+    	virtual ~LoggerHierarchy(void);
+
+    };
+
+}}
+
+#endif /*_ACTIVEMQ_LOGGER_LOGGERHIERARCHY_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/LoggerHierarchy.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/MarkBlockLogger.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/MarkBlockLogger.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/MarkBlockLogger.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/MarkBlockLogger.h Wed Jul  5 15:27:34 2006
@@ -1,71 +1,71 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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.
- */
-#ifndef _ACTIVEMQ_LOGGER_MARKBLOCKLOGGER_H_
-#define _ACTIVEMQ_LOGGER_MARKBLOCKLOGGER_H_
-
-#include <activemq/logger/Logger.h>
-
-namespace activemq{
-namespace logger{
-
-   /**
-    * Defines a class that can be used to mark the entry and exit from
-    * scoped blocks.
-    * <p>
-    * Create an instance of this class at the start of a scoped block,
-    * passing it the logger to use and the name of the block.  The block
-    * entry and exit will be marked using the scope name, logger to the
-    * logger at the MARKBLOCK log level.
-    */
-   class MarkBlockLogger
-   {
-   private:
-   
-      // Pointer to the Logger to use for Logging
-      Logger* logger;
-      
-      // Block Name to Log
-      std::string blockName;
-      
-   public:
-
-      /**
-       * Constructor - Marks Block entry
-       * @param Logger to use
-       * @param Block name
-       */
-      MarkBlockLogger(Logger* logger, const std::string& blockName)
-      {
-         this->logger = logger;
-         this->blockName = blockName;
-         
-         logger.mark(blockName + " - Entered");
-      }
-
-      /**
-       * Destructor - Marks Block Exit
-       */
-      virtual ~MarkBlockLogger(void)
-      {
-         logger->mark(blockName + " - Exited");
-      }
-
-   };
-
-}}
-
-#endif /*_ACTIVEMQ_LOGGER_MARKBLOCKLOGGER_H_*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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.
+ */
+#ifndef _ACTIVEMQ_LOGGER_MARKBLOCKLOGGER_H_
+#define _ACTIVEMQ_LOGGER_MARKBLOCKLOGGER_H_
+
+#include <activemq/logger/Logger.h>
+
+namespace activemq{
+namespace logger{
+
+   /**
+    * Defines a class that can be used to mark the entry and exit from
+    * scoped blocks.
+    * <p>
+    * Create an instance of this class at the start of a scoped block,
+    * passing it the logger to use and the name of the block.  The block
+    * entry and exit will be marked using the scope name, logger to the
+    * logger at the MARKBLOCK log level.
+    */
+   class MarkBlockLogger
+   {
+   private:
+   
+      // Pointer to the Logger to use for Logging
+      Logger* logger;
+      
+      // Block Name to Log
+      std::string blockName;
+      
+   public:
+
+      /**
+       * Constructor - Marks Block entry
+       * @param Logger to use
+       * @param Block name
+       */
+      MarkBlockLogger(Logger* logger, const std::string& blockName)
+      {
+         this->logger = logger;
+         this->blockName = blockName;
+         
+         logger.mark(blockName + " - Entered");
+      }
+
+      /**
+       * Destructor - Marks Block Exit
+       */
+      virtual ~MarkBlockLogger(void)
+      {
+         logger->mark(blockName + " - Exited");
+      }
+
+   };
+
+}}
+
+#endif /*_ACTIVEMQ_LOGGER_MARKBLOCKLOGGER_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/MarkBlockLogger.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/PropertiesChangeListener.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/PropertiesChangeListener.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/PropertiesChangeListener.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/PropertiesChangeListener.h Wed Jul  5 15:27:34 2006
@@ -1,50 +1,50 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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.
- */
-#ifndef _ACTIVEMQ_LOGGER_PROPERTIESCHANGELISTENER_H_
-#define _ACTIVEMQ_LOGGER_PROPERTIESCHANGELISTENER_H_
-
-namespace activemq{
-namespace logger{
-
-   /**
-    * Defines the interface that classes can use to listen for change
-    * events on Properties.
-    */
-   class PropertiesChangeListener
-   {
-   public:
-   
-      /**
-       * Destructor
-       */
-      virtual ~PropertiesChangeListener() {}
-      
-      /**
-       * Change Event, called when a property is changed
-       * @param Name of the Property
-       * @param Old Value of the Property
-       * @param New Value of the Property
-       */
-      virtual void onPropertyChanged(const std::string& name,
-                                     const std::string& oldValue,
-                                     const std::string& newValue) = 0;
-
-   };
-
-}}
-
-#endif /*_ACTIVEMQ_LOGGER_PROPERTIESCHANGELISTENER_H_*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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.
+ */
+#ifndef _ACTIVEMQ_LOGGER_PROPERTIESCHANGELISTENER_H_
+#define _ACTIVEMQ_LOGGER_PROPERTIESCHANGELISTENER_H_
+
+namespace activemq{
+namespace logger{
+
+   /**
+    * Defines the interface that classes can use to listen for change
+    * events on Properties.
+    */
+   class PropertiesChangeListener
+   {
+   public:
+   
+      /**
+       * Destructor
+       */
+      virtual ~PropertiesChangeListener() {}
+      
+      /**
+       * Change Event, called when a property is changed
+       * @param Name of the Property
+       * @param Old Value of the Property
+       * @param New Value of the Property
+       */
+      virtual void onPropertyChanged(const std::string& name,
+                                     const std::string& oldValue,
+                                     const std::string& newValue) = 0;
+
+   };
+
+}}
+
+#endif /*_ACTIVEMQ_LOGGER_PROPERTIESCHANGELISTENER_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/PropertiesChangeListener.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/SimpleFormatter.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/SimpleFormatter.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/SimpleFormatter.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/SimpleFormatter.h Wed Jul  5 15:27:34 2006
@@ -1,87 +1,87 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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.
- */
-#ifndef _ACTIVEMQ_LOGGER_SIMPLEFORMATTER_H_
-#define _ACTIVEMQ_LOGGER_SIMPLEFORMATTER_H_
-
-#include <activemq/logger/formatter.h>
-
-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:
-      
-      /**
-       * Constructor
-       */
-      SimpleFormatter(void) {}
-
-      /** 
-       * Destructor
-       */
-      virtual ~SimpleFormatter(void) {}
-
-      /**
-       * Format the given log record and return the formatted string.
-       * @param The Log Record to Format
-       */
-      virtual std::string format(const LogRecord& record) const
-      {
-         return "";
-      }
-      
-      /**
-       * Format the message string from a log record.
-       * @param 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 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 the target handler, can be null
-       * @return empty string
-       */
-      virtual std::string getTail(const Handler* handler)
-      {
-         return "";
-      }
-
-   };
-
-}}
-
-#endif /*_ACTIVEMQ_LOGGER_SIMPLEFORMATTER_H_*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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.
+ */
+#ifndef _ACTIVEMQ_LOGGER_SIMPLEFORMATTER_H_
+#define _ACTIVEMQ_LOGGER_SIMPLEFORMATTER_H_
+
+#include <activemq/logger/formatter.h>
+
+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:
+      
+      /**
+       * Constructor
+       */
+      SimpleFormatter(void) {}
+
+      /** 
+       * Destructor
+       */
+      virtual ~SimpleFormatter(void) {}
+
+      /**
+       * Format the given log record and return the formatted string.
+       * @param The Log Record to Format
+       */
+      virtual std::string format(const LogRecord& record) const
+      {
+         return "";
+      }
+      
+      /**
+       * Format the message string from a log record.
+       * @param 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 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 the target handler, can be null
+       * @return empty string
+       */
+      virtual std::string getTail(const Handler* handler)
+      {
+         return "";
+      }
+
+   };
+
+}}
+
+#endif /*_ACTIVEMQ_LOGGER_SIMPLEFORMATTER_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/SimpleFormatter.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/SimpleLogger.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/SimpleLogger.cpp?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/SimpleLogger.cpp (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/SimpleLogger.cpp Wed Jul  5 15:27:34 2006
@@ -1,88 +1,88 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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 "SimpleLogger.h"
-
-#include <iostream>
-#include <activemq/logger/LogWriter.h>
-
-using namespace activemq;
-using namespace activemq::logger;
-using namespace activemq::concurrent;
-using namespace std;
-
-////////////////////////////////////////////////////////////////////////////////
-SimpleLogger::SimpleLogger(const std::string& name)
-{
-   this->name = name;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-SimpleLogger::~SimpleLogger()
-{}
-
-////////////////////////////////////////////////////////////////////////////////
-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::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::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::log(const std::string& message)
-{
-   LogWriter::getInstance().log(message);
-}
-
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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 "SimpleLogger.h"
+
+#include <iostream>
+#include <activemq/logger/LogWriter.h>
+
+using namespace activemq;
+using namespace activemq::logger;
+using namespace activemq::concurrent;
+using namespace std;
+
+////////////////////////////////////////////////////////////////////////////////
+SimpleLogger::SimpleLogger(const std::string& name)
+{
+   this->name = name;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+SimpleLogger::~SimpleLogger()
+{}
+
+////////////////////////////////////////////////////////////////////////////////
+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::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::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::log(const std::string& message)
+{
+   LogWriter::getInstance().log(message);
+}
+

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/SimpleLogger.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/SimpleLogger.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/SimpleLogger.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/SimpleLogger.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/SimpleLogger.h Wed Jul  5 15:27:34 2006
@@ -1,93 +1,93 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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.
- */
-#ifndef _ACTIVEMQ_LOGGER_SIMPLELOGGER_H_
-#define _ACTIVEMQ_LOGGER_SIMPLELOGGER_H_
-
-#include <string>
-
-namespace activemq{
-namespace logger{
-
-   class SimpleLogger
-   {
-   public:
-
-      /**
-       * Constructor
-       */   
-      SimpleLogger( const std::string& name );
-      
-      /**
-       * Destructor
-       */
-      virtual ~SimpleLogger();
-      
-      /**
-       * Log a Mark Block Level Log
-       */
-      virtual void mark(const std::string& message);
-
-      /**
-       * Log a Debug Level Log
-       */
-      virtual void debug(const std::string& file,
-                         const int          line,
-                         const std::string& message);
-
-      /**
-       * Log a Informational Level Log
-       */
-      virtual void info(const std::string& file,
-                        const int          line,
-                        const std::string& message);
-
-      /**
-       * Log a Warning Level Log
-       */
-      virtual void warn(const std::string& file,
-                        const int          line,
-                        const std::string& message);
-                        
-      /**
-       * Log a Error Level Log
-       */
-      virtual void error(const std::string& file,
-                         const int          line,
-                         const std::string& message);
-
-      /**
-       * Log a Fatal Level Log
-       */
-      virtual void fatal(const std::string& file,
-                         const int          line,
-                         const std::string& message);
-                         
-      /**
-       * No-frills log.
-       */
-      virtual void log(const std::string& message);
-                         
-   private:
-      
-      // Name of this Logger
-      std::string name;
-      
-   };
-   
-}}
-
-#endif /*_ACTIVEMQ_LOGGER_SIMPLELOGGER_H_*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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.
+ */
+#ifndef _ACTIVEMQ_LOGGER_SIMPLELOGGER_H_
+#define _ACTIVEMQ_LOGGER_SIMPLELOGGER_H_
+
+#include <string>
+
+namespace activemq{
+namespace logger{
+
+   class SimpleLogger
+   {
+   public:
+
+      /**
+       * Constructor
+       */   
+      SimpleLogger( const std::string& name );
+      
+      /**
+       * Destructor
+       */
+      virtual ~SimpleLogger();
+      
+      /**
+       * Log a Mark Block Level Log
+       */
+      virtual void mark(const std::string& message);
+
+      /**
+       * Log a Debug Level Log
+       */
+      virtual void debug(const std::string& file,
+                         const int          line,
+                         const std::string& message);
+
+      /**
+       * Log a Informational Level Log
+       */
+      virtual void info(const std::string& file,
+                        const int          line,
+                        const std::string& message);
+
+      /**
+       * Log a Warning Level Log
+       */
+      virtual void warn(const std::string& file,
+                        const int          line,
+                        const std::string& message);
+                        
+      /**
+       * Log a Error Level Log
+       */
+      virtual void error(const std::string& file,
+                         const int          line,
+                         const std::string& message);
+
+      /**
+       * Log a Fatal Level Log
+       */
+      virtual void fatal(const std::string& file,
+                         const int          line,
+                         const std::string& message);
+                         
+      /**
+       * No-frills log.
+       */
+      virtual void log(const std::string& message);
+                         
+   private:
+      
+      // Name of this Logger
+      std::string name;
+      
+   };
+   
+}}
+
+#endif /*_ACTIVEMQ_LOGGER_SIMPLELOGGER_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/SimpleLogger.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/StreamHandler.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/StreamHandler.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/StreamHandler.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/StreamHandler.h Wed Jul  5 15:27:34 2006
@@ -1,228 +1,228 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed 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.
- */
-#ifndef _ACTIVEMQ_LOGGER_STREAMHANDLER_H_
-#define _ACTIVEMQ_LOGGER_STREAMHANDLER_H_
-
-#include <activemq/logger/LoggerCommon.h>
-#include <activemq/logger/Handler.h>
-#include <activemq/logger/Formatter.h>
-#include <activemq/logger/Filter.h>
-#include <activemq/io/OutputStream.h>
-#include <activemq/exceptions/NullPointerException.h>
-#include <activemq/exceptions/InvalidStateException.h>
-#include <activemq/concurrent/Concurrent.h>
-
-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.");
-            }
-            
-            // 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));
-         }
-
-         // 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;
-      }
-
-   };
-
-}}
-
-#endif /*_ACTIVEMQ_LOGGER_STREAMHANDLER_H_*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed 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.
+ */
+#ifndef _ACTIVEMQ_LOGGER_STREAMHANDLER_H_
+#define _ACTIVEMQ_LOGGER_STREAMHANDLER_H_
+
+#include <activemq/logger/LoggerCommon.h>
+#include <activemq/logger/Handler.h>
+#include <activemq/logger/Formatter.h>
+#include <activemq/logger/Filter.h>
+#include <activemq/io/OutputStream.h>
+#include <activemq/exceptions/NullPointerException.h>
+#include <activemq/exceptions/InvalidStateException.h>
+#include <activemq/concurrent/Concurrent.h>
+
+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.");
+            }
+            
+            // 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));
+         }
+
+         // 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;
+      }
+
+   };
+
+}}
+
+#endif /*_ACTIVEMQ_LOGGER_STREAMHANDLER_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/logger/StreamHandler.h
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message