Molecular Dynamics  v0.4
Project for the Practical hosted by the Scientific Computing Chair
Logging.h
Go to the documentation of this file.
1 //
2 // Created by daniel on 05.05.24.
3 //
4 
5 #pragma once
6 #include <string>
7 #include "spdlog/spdlog.h"
8 
15 inline bool setLogLevel(const std::string& logLevel) {
16  static const std::unordered_map<std::string, spdlog::level::level_enum> levelMap = {
17  {"off", spdlog::level::off},
18  {"critical", spdlog::level::critical},
19  {"error", spdlog::level::err},
20  {"warn", spdlog::level::warn},
21  {"info", spdlog::level::info},
22  {"debug", spdlog::level::debug},
23  {"trace", spdlog::level::trace}
24  };
25 
26  auto it = levelMap.find(logLevel);
27  if (it != levelMap.end()) {
28  spdlog::set_level(it->second);
29  return true;
30  }
31  return false;
32 }
33 
bool setLogLevel(const std::string &logLevel)
Sets the log level which is specified in the string.
Definition: Logging.h:15
::xsd::cxx::tree::string< char, simple_type > string
C++ type corresponding to the string XML Schema built-in type.
Definition: vtk-unstructured.h:270