00001 /* Copyright (c) 2007, Gennady Bystritsky <bystr@mac.com> 00002 * 00003 * Distributed under the MIT Licence. 00004 * This is free software. See 'LICENSE' for details. 00005 * You must read and accept the license prior to use. 00006 */ 00007 00008 #ifndef _SK_RT_LOGGER_LEVEL_ 00009 #define _SK_RT_LOGGER_LEVEL_ 00010 00011 #include <sk/util/Object.h> 00012 #include <vector> 00013 00014 namespace sk { 00015 namespace rt { 00016 namespace logger { 00017 class Level 00018 : public virtual sk::util::Object 00019 { 00020 public: 00021 virtual ~Level(); 00022 00023 static const Level& valueOf(const sk::util::String& name); 00024 int toInt() const; 00025 const sk::util::String& getName() const; 00026 00027 // sk::util::Object re-implementation. 00028 const sk::util::Class getClass() const; 00029 const sk::util::String toString() const; 00030 00031 bool operator==(const Level& other) const; 00032 00033 static const Level SK_L_NONE; 00034 static const Level SK_L_ERROR; 00035 static const Level SK_L_STAT; 00036 static const Level SK_L_WARNING; 00037 static const Level SK_L_INFO; 00038 static const Level SK_L_NOTICE; 00039 static const Level SK_L_DETAIL; 00040 static const Level SK_L_DEBUG; 00041 00042 private: 00043 Level(const sk::util::String& name); 00044 Level(const Level& other); 00045 Level& operator = (const Level& other); 00046 00047 static std::vector<Level*> _levels; 00048 00049 int _value; 00050 const sk::util::String _name; 00051 }; 00052 } 00053 } 00054 } 00055 00056 #endif /* _SK_RT_LOGGER_LEVEL_ */