feat(logger): add log level filtering
This commit is contained in:
@@ -63,8 +63,20 @@ public:
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Проверяет, является ли текущий уровень менее важным.
|
||||
*
|
||||
* Используется для фильтрации сообщений:
|
||||
* сообщения с уровнем ниже заданного уровня Logger
|
||||
* не должны записываться в журнал.
|
||||
*/
|
||||
[[nodiscard]]
|
||||
bool operator<(const LogLevel &other) const {
|
||||
return static_cast<int>(type_) < static_cast<int>(other.type_);
|
||||
}
|
||||
|
||||
private:
|
||||
enum class Type { Debug, Info, Error };
|
||||
enum class Type { Debug = 0, Info = 1, Error = 2 };
|
||||
|
||||
explicit LogLevel(Type type) : type_(type) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user