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

26 lines
588 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
#include <spdlog/spdlog.h>
#include <spdlog/cfg/env.h>
6 years ago
6 years ago
int main(int, char *[])
{
spdlog::set_pattern("%v");
6 years ago
try
6 years ago
{
6 years ago
auto cfg = spdlog::cfg::from_env();
for (auto &item : cfg)
{
spdlog::info("logger: '{}' level: '{}' pattern: '{}'", item.first, item.second.level_name, item.second.pattern);
6 years ago
}
6 years ago
}
6 years ago
catch (spdlog::spdlog_ex &ex)
{
6 years ago
spdlog::info("spdlog_ex: {}", ex.what());
6 years ago
}
}