spdlog/example/example.cpp

40 lines
987 B
C++
Raw Normal View History

2024-12-04 06:33:42 +08:00
//
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
2021-09-04 01:53:29 +08:00
#include <chrono>
2023-09-29 05:20:26 +08:00
#include <cstdio>
2019-12-13 22:17:09 +08:00
2020-03-06 21:21:21 +08:00
void load_levels_example();
2019-12-13 22:17:09 +08:00
void stdout_logger_example();
void basic_example();
void rotating_example();
void daily_example();
void callback_example();
2019-12-13 22:17:09 +08:00
void async_example();
void binary_example();
void vector_example();
2020-08-29 07:48:43 +08:00
void stopwatch_example();
2019-12-13 22:17:09 +08:00
void trace_example();
void multi_sink_example();
void user_defined_example();
void err_handler_example();
void syslog_example();
void udp_example();
2021-09-04 01:53:29 +08:00
void custom_flags_example();
2021-11-15 20:32:34 +08:00
void file_events_example();
void replace_default_logger_example();
2023-09-25 21:40:05 +08:00
#include "spdlog/cfg/env.h" // support for loading levels from the environment variable
2023-09-29 05:20:26 +08:00
#include "spdlog/spdlog.h"
2024-11-29 22:15:13 +08:00
#include "spdlog/version.h"
2019-08-23 00:58:49 +08:00
2024-12-04 07:03:52 +08:00
#include "fmt/xchar.h"
int main(int, char *[]) {
std::wstring wideStr = L"Hello, Wide World!";
2020-09-26 20:30:45 +08:00
2024-12-04 07:03:52 +08:00
// Print directly to the console
fmt::print(L"{}\n", wideStr);
2024-12-04 06:40:10 +08:00
}