Molecular Dynamics Simulation  1.0
Logger.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <spdlog/spdlog.h>
4 
5 #include <memory>
6 #include <string>
7 
8 const std::string ansi_green_bold = "\e[32m\e[1m";
9 const std::string ansi_blue_bold = "\e[34m\e[1m";
10 const std::string ansi_orange_bold = "\e[38;5;208m\e[1m";
11 const std::string ansi_yellow_bold = "\e[33m\e[1m";
12 const std::string ansi_bright_white_bold = "\e[97m\e[1m";
13 const std::string ansi_end = "\e[0m";
14 
18 class Logger {
19  public:
23  enum class LogType { FILE, STD };
24 
28  static std::shared_ptr<spdlog::logger> init_logger(LogType log_type = LogType::STD);
29 
35  static std::shared_ptr<spdlog::logger> logger;
36 
42  static void update_level(std::string& log_level);
43 };
const std::string ansi_bright_white_bold
Definition: Logger.h:12
const std::string ansi_yellow_bold
Definition: Logger.h:11
const std::string ansi_end
Definition: Logger.h:13
const std::string ansi_orange_bold
Definition: Logger.h:10
const std::string ansi_green_bold
Definition: Logger.h:8
const std::string ansi_blue_bold
Definition: Logger.h:9
Class as wrapper and initializer for a globally usable logger.
Definition: Logger.h:18
static void update_level(std::string &log_level)
Sets the log level of the logger.
Definition: Logger.cpp:48
static std::shared_ptr< spdlog::logger > init_logger(LogType log_type=LogType::STD)
Initializes the logger.
Definition: Logger.cpp:23
static std::shared_ptr< spdlog::logger > logger
Publically accessible shared pointer to the logger.
Definition: Logger.h:35
LogType
Enum for the type of logger.
Definition: Logger.h:23