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-05-12 05:34:55 +08:00
|
|
|
#include <cstdio>
|
|
|
|
|
2019-08-23 00:58:49 +08:00
|
|
|
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();
|
|
|
|
void clone_example();
|
|
|
|
|
2019-05-12 05:32:57 +08:00
|
|
|
#include "spdlog/spdlog.h"
|
2019-08-23 00:58:49 +08:00
|
|
|
|
|
|
|
int main(int, char *[])
|
|
|
|
{
|
|
|
|
|
2019-08-26 05:56:05 +08:00
|
|
|
// Backtrace support of latest debug/trace messages
|
2019-08-25 22:25:06 +08:00
|
|
|
spdlog::enable_backtrace(16);
|
2019-08-27 00:59:16 +08:00
|
|
|
|
2019-08-23 07:45:35 +08:00
|
|
|
spdlog::trace("Backtrace message 1");
|
|
|
|
spdlog::debug("Backtrace message 2");
|
2019-08-27 00:59:16 +08:00
|
|
|
spdlog::info("Hello");
|
2019-08-25 22:27:21 +08:00
|
|
|
spdlog::dump_backtrace();
|
2019-08-27 00:59:16 +08:00
|
|
|
}
|