-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathLogLevel.h
More file actions
48 lines (37 loc) · 768 Bytes
/
LogLevel.h
File metadata and controls
48 lines (37 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// Created by Pavel Akhtyamov on 2019-04-09.
//
#pragma once
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <memory>
#include <stdexcept>
#include <iostream>
#include <functional>
#include <utility>
class LogLevel {
public:
enum Value {
INFO,
ERROR,
WARNING,
DEBUG
};
LogLevel() = default;
constexpr LogLevel(Value log_level_);
bool operator ==(const LogLevel& a) const;
size_t GetValue() const;
static std::initializer_list<LogLevel> All();
private:
Value value_;
};
std::ostream& operator << (std::ostream& ostream, const LogLevel& level);
namespace std {
template <>
struct hash<LogLevel> {
size_t operator()(const LogLevel& log_level) const {
return log_level.GetValue();
}
};
}