spdlog/example/example.cpp

35 lines
821 B
C++
Raw Normal View History

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-13 22:17:09 +08:00
#include <cstdio>
void stdout_logger_example();
void basic_example();
void rotating_example();
void daily_example();
void async_example();
void binary_example();
void trace_example();
void multi_sink_example();
void user_defined_example();
void err_handler_example();
void syslog_example();
#include <spdlog/spdlog.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/cfg/env.h>
#include <spdlog/cfg/argv_loader.h>
2019-08-23 00:58:49 +08:00
int main(int args, char *argv[])
2019-12-08 23:08:20 +08:00
{
spdlog::cfg::init_from_env();
spdlog::cfg::init_from_argv(args, argv);
spdlog::debug("HELLO DEBUG");
spdlog::info("HELLO INFO");
2019-12-13 22:17:09 +08:00
auto l1 = spdlog::stderr_color_st("l1");
l1->trace("L1 TRACE");
}