Molecular Dynamics Simulation  1.0
Functions
Logger.cpp File Reference
#include "Logger.h"
#include <filesystem>
#include <iostream>
#include "spdlog/async.h"
#include "spdlog/sinks/rotating_file_sink.h"
#include "spdlog/sinks/stdout_color_sinks.h"
Include dependency graph for Logger.cpp:

Go to the source code of this file.

Functions

void createDirectory (const std::string &dir_name)
 

Function Documentation

◆ createDirectory()

void createDirectory ( const std::string &  dir_name)

Definition at line 12 of file Logger.cpp.

12  {
13  if (!std::filesystem::exists(dir_name)) {
14  try {
15  std::filesystem::create_directory(dir_name);
16  } catch (const std::filesystem::filesystem_error& e) {
17  std::cerr << "Error creating directory: " << e.what() << std::endl;
18  throw e;
19  }
20  }
21 }