|
activemq-cpp-3.3.0
|
00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one or more 00003 * contributor license agreements. See the NOTICE file distributed with 00004 * this work for additional information regarding copyright ownership. 00005 * The ASF licenses this file to You under the Apache License, Version 2.0 00006 * (the "License"); you may not use this file except in compliance with 00007 * the License. You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 */ 00017 00018 #ifndef _DECAF_UTIL_LOGGING_LEVEL_H_ 00019 #define _DECAF_UTIL_LOGGING_LEVEL_H_ 00020 00021 #include <decaf/util/Config.h> 00022 00023 #include <decaf/lang/Comparable.h> 00024 #include <decaf/lang/exceptions/IllegalArgumentException.h> 00025 00026 namespace decaf { 00027 namespace util { 00028 namespace logging { 00029 00056 class DECAF_API Level : public decaf::lang::Comparable<Level> { 00057 private: 00058 00059 std::string name; 00060 int value; 00061 00062 public: 00063 00068 static const Level INHERIT; 00069 00074 static const Level OFF; 00075 00083 static const Level SEVERE; 00084 00091 static const Level WARNING; 00092 00100 static const Level INFO; 00101 00110 static const Level DEBUG; 00111 00120 static const Level CONFIG; 00121 00137 static const Level FINE; 00138 00144 static const Level FINER; 00145 00149 static const Level FINEST; 00150 00155 static const Level ALL; 00156 00157 protected: 00158 00167 Level( const std::string& name, int value ); 00168 00169 public: 00170 00171 virtual ~Level(); 00172 00176 int intValue() const { 00177 return this->value; 00178 } 00179 00183 std::string getName() const { 00184 return this->name; 00185 } 00186 00190 std::string toString() const { 00191 return this->name; 00192 } 00193 00194 public: // Comparable 00195 00196 virtual int compareTo( const Level& value ) const; 00197 00198 virtual bool equals( const Level& value ) const; 00199 00200 virtual bool operator==( const Level& value ) const; 00201 00202 virtual bool operator<( const Level& value ) const; 00203 00204 public: 00205 00226 static Level parse( const std::string& name ); 00227 00228 }; 00229 00230 }}} 00231 00232 #endif /* _DECAF_UTIL_LOGGING_LEVEL_H_ */