summaryrefslogtreecommitdiffstats
path: root/Help/guide/tutorial/Step6/MathFunctions/MathLogger/MathFormatting.h
blob: 3b6d61cfcaed9881dc684cfb52f93ce11da75f0c (plain)
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
#pragma once

#include <string>

namespace mathlogger {

enum LogLevel
{
  INFO,
  WARN,
  ERROR,
};

inline std::string FormatLog(LogLevel level, std::string const& message)
{
  switch (level) {
    case INFO:
      return "INFO: " + message;
    case WARN:
      return "WARN: " + message;
    case ERROR:
      return "ERROR: " + message;
  }
  return "UNKNOWN: " + message;
}

}