• Classes
  • Modules
  • Namespaces
  • Files
  • Related Pages
  • File List
  • File Members

loggingACSCategory.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002  *    ALMA - Atacama Large Millimiter Array
00003  *    (c) European Southern Observatory, 2002
00004  *    Copyright by ESO (in the framework of the ALMA collaboration)
00005  *    and Cosylab 2002, All rights reserved
00006  *
00007  *    This library is free software; you can redistribute it and/or
00008  *    modify it under the terms of the GNU Lesser General Public
00009  *    License as published by the Free Software Foundation; either
00010  *    version 2.1 of the License, or (at your option) any later version.
00011  *
00012  *    This library is distributed in the hope that it will be useful,
00013  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  *    Lesser General Public License for more details.
00016  *
00017  *    You should have received a copy of the GNU Lesser General Public
00018  *    License along with this library; if not, write to the Free Software
00019  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00020  *
00021  *
00022  * "@(#) "
00023  *
00024  * who       when        what
00025  * --------  ----------  ----------------------------------------------
00026  * javarias  May 7, 2010         created
00027  */
00028 
00029 #ifndef LOGGINGACSCATEGORY_H_
00030 #define LOGGINGACSCATEGORY_H_
00031 
00032 #define LOG4CPP_FIX_ERROR_COLLISION 1
00033 #include <log4cpp/Category.hh>
00034 #include <log4cpp/Appender.hh>
00035 #include "loggingACSLoggingEvent.h"
00036 #include "loggingACSHierarchyMaintainer.h"
00037 
00038 namespace logging {
00039 class ACSCategory: private ::log4cpp::Category {
00040         friend class ACSHierarchyMaintainer;
00041 public:
00042 
00043         ACSCategory(const std::string& name, log4cpp::Category* parent,
00044                         log4cpp::Priority::Value priority = log4cpp::Priority::NOTSET);
00045 
00046         void setPriority(::log4cpp::Priority::Value priority) throw (std::invalid_argument);
00047 
00048         virtual ~ACSCategory();
00049 
00050         void log(ACSLoggingEvent& lr) throw ();
00051         void log(const std::string& message,
00052                         ::log4cpp::Priority::Value priority, const std::string& routine,
00053                         const std::string& file, unsigned int line, const std::string& host,
00054                         const std::string& context, const std::string& audience,
00055                         const std::string& sourceObject, const std::string& array,
00056                         const std::string& antenna, const std::string& stackId,
00057                         const int stackLevel, const std::string& uri) throw ();
00058 
00059         void log (const std::string& message,
00060                         ::log4cpp::Priority::Value priority, const std::string& routine,
00061                         const std::string& file, unsigned int line) throw ();
00062 
00063         void trace(const std::string& message, ::log4cpp::Priority::Value priority,
00064                         const std::string& routine, const std::string& file,
00065                         unsigned int line, const std::string& host,
00066                         const std::string& context, const std::string& audience,
00067                         const std::string& sourceObject, const std::string& array,
00068                         const std::string& antenna, const std::string& stackId,
00069                         const int stackLevel, const std::string& uri) throw ();
00070 
00071         inline bool isTraceEnabled() const throw () {
00072                 return isPriorityEnabled(::log4cpp::Priority::TRACE);
00073         }
00074 
00075         void delouse(const std::string& message, ::log4cpp::Priority::Value priority,
00076                         const std::string& routine, const std::string& file,
00077                         unsigned int line, const std::string& host,
00078                         const std::string& context, const std::string& audience,
00079                         const std::string& sourceObject, const std::string& array,
00080                         const std::string& antenna, const std::string& stackId,
00081                         const int stackLevel, const std::string& uri) throw ();
00082         inline bool isDelouseEnabled() const throw () {
00083                 return isPriorityEnabled(::log4cpp::Priority::DELOUSE);
00084         }
00085 
00086         void debug(const std::string& message, ::log4cpp::Priority::Value priority,
00087                         const std::string& routine, const std::string& file,
00088                         unsigned int line, const std::string& host,
00089                         const std::string& context, const std::string& audience,
00090                         const std::string& sourceObject, const std::string& array,
00091                         const std::string& antenna, const std::string& stackId,
00092                         const int stackLevel, const std::string& urie) throw ();
00093         inline bool isDebugEnabled() const throw () {
00094                 return isPriorityEnabled(::log4cpp::Priority::DEBUG);
00095         }
00096         ;
00097 
00098         void info(const std::string& message, ::log4cpp::Priority::Value priority,
00099                         const std::string& routine, const std::string& file,
00100                         unsigned int line, const std::string& host,
00101                         const std::string& context, const std::string& audience,
00102                         const std::string& sourceObject, const std::string& array,
00103                         const std::string& antenna, const std::string& stackId,
00104                         const int stackLevel, const std::string& uri) throw ();
00105         inline bool isInfoEnabled() const throw () {
00106                 return isPriorityEnabled(::log4cpp::Priority::INFO);
00107         }
00108         ;
00109 
00110         void notice(const std::string& message, ::log4cpp::Priority::Value priority,
00111                         const std::string& routine, const std::string& file,
00112                         unsigned int line, const std::string& host,
00113                         const std::string& context, const std::string& audience,
00114                         const std::string& sourceObject, const std::string& array,
00115                         const std::string& antenna, const std::string& stackId,
00116                         const int stackLevel, const std::string& uri) throw ();
00117         inline bool isNoticeEnabled() const throw () {
00118                 return isPriorityEnabled(::log4cpp::Priority::NOTICE);
00119         }
00120         ;
00121 
00122         void warn(const std::string& message, ::log4cpp::Priority::Value priority,
00123                         const std::string& routine, const std::string& file,
00124                         unsigned int line, const std::string& host,
00125                         const std::string& context, const std::string& audience,
00126                         const std::string& sourceObject, const std::string& array,
00127                         const std::string& antenna, const std::string& stackId,
00128                         const int stackLevel, const std::string& uri) throw ();
00129         inline bool isWarnEnabled() const throw () {
00130                 return isPriorityEnabled(::log4cpp::Priority::WARN);
00131         }
00132         ;
00133 
00134         void error(const std::string& message, ::log4cpp::Priority::Value priority,
00135                         const std::string& routine, const std::string& file,
00136                         unsigned int line, const std::string& host,
00137                         const std::string& context, const std::string& audience,
00138                         const std::string& sourceObject, const std::string& array,
00139                         const std::string& antenna, const std::string& stackId,
00140                         const int stackLevel, const std::string& uri) throw ();
00141         inline bool isErrorEnabled() const throw () {
00142                 return isPriorityEnabled(::log4cpp::Priority::ERROR);
00143         }
00144         ;
00145 
00146         void crit(const std::string& message, ::log4cpp::Priority::Value priority,
00147                         const std::string& routine, const std::string& file,
00148                         unsigned int line, const std::string& host,
00149                         const std::string& context, const std::string& audience,
00150                         const std::string& sourceObject, const std::string& array,
00151                         const std::string& antenna, const std::string& stackId,
00152                         const int stackLevel, const std::string& uri) throw ();
00153         inline bool isCritEnabled() const throw () {
00154                 return isPriorityEnabled(::log4cpp::Priority::CRIT);
00155         }
00156         ;
00157 
00158         void alert(const std::string& message, ::log4cpp::Priority::Value priority,
00159                         const std::string& routine, const std::string& file,
00160                         unsigned int line, const std::string& host,
00161                         const std::string& context, const std::string& audience,
00162                         const std::string& sourceObject, const std::string& array,
00163                         const std::string& antenna, const std::string& stackId,
00164                         const int stackLevel, const std::string& uri) throw ();
00165         inline bool isAlertEnabled() const throw () {
00166                 return isPriorityEnabled(::log4cpp::Priority::ALERT);
00167         }
00168         ;
00169 
00170         void emerg(const std::string& message, ::log4cpp::Priority::Value priority,
00171                         const std::string& routine, const std::string& file,
00172                         unsigned int line, const std::string& host,
00173                         const std::string& context, const std::string& audience,
00174                         const std::string& sourceObject, const std::string& array,
00175                         const std::string& antenna, const std::string& stackId,
00176                         const int stackLevel, const std::string& uri) throw ();
00177         inline bool isEmergEnabled() const throw () {
00178                 return isPriorityEnabled(::log4cpp::Priority::EMERG);
00179         }
00180         ;
00181 
00182         static ACSCategory& getInstance(const std::string& name);
00183 
00184         static ACSCategory* exist(const std::string& name);
00185 
00186         void addAppender(log4cpp::Appender* appender) throw(std::invalid_argument);
00187 
00188         log4cpp::Appender* getAppender (const std::string &name) const;
00189 
00190 
00191 private:
00192         ACSCategory(const Category& other);
00193         ACSCategory& operator=(const Category& other);
00194 };
00195 }
00196 #endif /* LOGGINGACSCATEGORY_H_ */

Generated on Thu Jan 12 2012 23:13:51 for ACS-10.0 C++ API by  doxygen 1.7.0