3 #include <spdlog/details/os.h>
4 #include <spdlog/spdlog.h>
7 #include <unordered_map>
15 static std::mutex
mtx;
16 static std::unordered_map<std::string, std::string>
map;
18 std::string
getEnv(
const std::string& var) {
22 std::string
getEnv(
const std::string& var, spdlog::logger& logger) {
23 std::unique_lock<std::mutex> lock(
mtx);
25 if(
map.count(var) > 0) {
28 auto value = spdlog::details::os::getenv(var.c_str());
33 logger.debug(
"Environment '{}' set to '{}'", var, value);