Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Help/guide/tutorial/Step6/MathFunctions/MathLogger/MathFormatting.h
5022 views
1
#pragma once
2
3
#include <string>
4
5
namespace mathlogger {
6
7
enum LogLevel
8
{
9
INFO,
10
WARN,
11
ERROR,
12
};
13
14
inline std::string FormatLog(LogLevel level, std::string const& message)
15
{
16
switch (level) {
17
case INFO:
18
return "INFO: " + message;
19
case WARN:
20
return "WARN: " + message;
21
case ERROR:
22
return "ERROR: " + message;
23
}
24
return "UNKNOWN: " + message;
25
}
26
27
}
28
29