00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
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