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

38 lines
965 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 <cstdio>
6 years ago
void load_levels_example();
6 years ago
void stdout_logger_example();
void basic_example();
void rotating_example();
void daily_example();
void async_example();
void binary_example();
void stopwatch_example();
6 years ago
void trace_example();
void multi_sink_example();
void user_defined_example();
void err_handler_example();
void syslog_example();
void custom_flags_example();
6 years ago
#include "spdlog/spdlog.h"
6 years ago
#include "spdlog/cfg/env.h" // for loading levels from the environment variable
#include "spdlog/sinks/stdout_color_sinks.h"
6 years ago
6 years ago
int main(int, char *[])
6 years ago
{
6 years ago
// Log levels can be loaded from argv/env using "SPDLOG_LEVEL"
spdlog::cfg::load_env_levels();
spdlog::info("Default logger");
auto l1 = spdlog::stdout_color_mt("l1");
auto l2 = spdlog::stdout_color_mt("l2");
6 years ago
l1->debug("L1");
l2->trace("L2");
}