You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
spdlog/example/example.cpp

25 lines
539 B
C++

7 years ago
//
// Copyright(c) 2015 Gabi Melman.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
7 years ago
// spdlog usage example
6 years ago
6 years ago
#include <spdlog/spdlog.h>
#include <spdlog/cfg/env.h>
6 years ago
6 years ago
int main(int, char *[]) {
6 years ago
try {
6 years ago
auto cfg = spdlog::cfg::from_env();
6 years ago
for(auto &item:cfg)
6 years ago
{
6 years ago
spdlog::info("['{}'] level: {} pattern: {}", item.first, spdlog::level::to_string_view(item.second.level), item.second.pattern);
}
}catch(spdlog::spdlog_ex& ex){
spdlog::info("spdlog_ex: {}", ex.what());
6 years ago
}
}