mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-16 00:45:48 +08:00
25 lines
573 B
C++
25 lines
573 B
C++
//
|
|
// Copyright(c) 2015 Gabi Melman.
|
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
|
|
|
// spdlog usage example
|
|
|
|
#include <spdlog/spdlog.h>
|
|
#include <spdlog/cfg/env.h>
|
|
|
|
int main(int, char *[])
|
|
{
|
|
try
|
|
{
|
|
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);
|
|
}
|
|
}
|
|
catch (spdlog::spdlog_ex &ex)
|
|
{
|
|
spdlog::info("spdlog_ex: {}", ex.what());
|
|
}
|
|
}
|