forked from ct-Open-Source/Basecamp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.hpp
35 lines (30 loc) · 817 Bytes
/
log.hpp
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
#ifndef BASECAMP_LOG_HPP
#define BASECAMP_LOG_HPP
#include <functional>
#include <string>
#include <map>
// Header-Only definition of log functionality for reuse.
namespace basecampLog
{
/// Severity of log messages.
enum class Severity
{
trace,
debug,
info,
warning,
error,
fatal,
};
const std::map<Severity, std::string> SeverityText {
{Severity::trace, "TRACE"},
{Severity::debug, "DEBUG"},
{Severity::info, "INFO"},
{Severity::warning, "WARNING"},
{Severity::error, "ERROR"},
{Severity::fatal, "FATAL"},
};
/// Definition of a generic log callback.
using LogCallback = std::function<void(basecampLog::Severity severity, const std::string& message)>;
}
#endif // BASECAMP_LOG_HPP