📄 loglevel.h
字号:
/*============================================================================. | Copyright (C) 2006 Gareth Buxton | |----------------------------------------------------------------------------| | LogPlusPlus is free software; you can redistribute it and/or | | modify it under the terms of the GNU Lesser General Public | | License as published by the Free Software Foundation; either | | version 2.1 of the License, or (at your option) any later version. | | | | LogPlusPlus is distributed in the hope that it will be useful, | | but WITHOUT ANY WARRANTY; without even the implied warranty of | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | | Lesser General Public License for more details. | | | | You should have received a copy of the GNU Lesser General Public | | License along with this library; if not, write to the Free Software | | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | '============================================================================*/#ifndef _LPP_LOG_LEVEL_H_#define _LPP_LOG_LEVEL_H_//#include <bitset>#include <liblpp/Types.h>//#include <liblpp/LogMask.h>//#include <liblpp/LogFlag.h>#include <ostream>//=============================================================================LPP_NAMESPACE_BEGIN//=============================================================================/** * LogStream objects are set to a specific LogLevel. * The LogLevel is used with the LogMask to determine * weather or not to output the LogStream. **/class LogLevel{private: unsigned int level; public: LogLevel() {} LogLevel(unsigned int level) : level(level) {} LogLevel(const LogLevel& logLevel) : level(logLevel.level) {} virtual ~LogLevel() {} inline LogLevel& operator=(const LogLevel& logLevel) { level = logLevel.level; return *this; } inline operator unsigned int() const { return level; } inline operator int() const { return static_cast<int>(level); } inline bool operator<(const LogLevel& logLevel) const { return level < logLevel.level; } inline bool operator<=(const LogLevel& logLevel) const { return level <= logLevel.level; } inline bool operator>(const LogLevel& logLevel) const { return level > logLevel.level; } inline bool operator>=(const LogLevel& logLevel) const { return level >= logLevel.level; } inline bool operator==(const LogLevel& logLevel) const { return level == logLevel.level; } inline std::ostream& operator<<(std::ostream& os) const { return os << level; }};//=============================================================================LPP_NAMESPACE_END//=============================================================================#endif /*_LPP_LOG_LEVEL_H_*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -