2019-03-24 06:40:27 +08:00
|
|
|
//
|
|
|
|
// Copyright(c) 2015 Gabi Melman.
|
|
|
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
2019-05-12 22:05:14 +08:00
|
|
|
|
2019-03-24 06:40:27 +08:00
|
|
|
// spdlog usage example
|
|
|
|
|
2019-12-08 19:35:15 +08:00
|
|
|
#include <spdlog/spdlog.h>
|
|
|
|
#include <spdlog/cfg/env.h>
|
2019-08-23 00:58:49 +08:00
|
|
|
|
2019-12-08 23:08:20 +08:00
|
|
|
int main(int, char *[])
|
|
|
|
{
|
|
|
|
try
|
2019-09-05 23:32:54 +08:00
|
|
|
{
|
2019-12-08 23:08:20 +08:00
|
|
|
auto cfg = spdlog::cfg::from_env();
|
|
|
|
for (auto &item : cfg)
|
|
|
|
{
|
|
|
|
spdlog::info("['{}'] level: {} pattern: {}", item.first, spdlog::level::to_string_view(item.second.level), item.second.pattern);
|
|
|
|
}
|
2019-12-08 23:07:52 +08:00
|
|
|
}
|
2019-12-08 23:08:20 +08:00
|
|
|
catch (spdlog::spdlog_ex &ex)
|
|
|
|
{
|
2019-12-08 23:07:52 +08:00
|
|
|
spdlog::info("spdlog_ex: {}", ex.what());
|
2019-09-05 23:32:54 +08:00
|
|
|
}
|
|
|
|
}
|