Clang format sort includes

This commit is contained in:
gabime 2023-09-29 00:20:26 +03:00
parent a0e631802c
commit 463af69d41
81 changed files with 256 additions and 223 deletions

View File

@ -14,6 +14,6 @@ AlwaysBreakTemplateDeclarations: Yes
PackConstructorInitializers: Never
BreakConstructorInitializersBeforeComma: false
IndentPPDirectives: BeforeHash
SortIncludes: Never
SortIncludes: CaseInsensitive
...

View File

@ -6,9 +6,9 @@
//
// bench.cpp : spdlog benchmarks
//
#include "spdlog/spdlog.h"
#include "spdlog/async.h"
#include "spdlog/sinks/basic_file_sink.h"
#include "spdlog/spdlog.h"
#if defined(SPDLOG_USE_STD_FORMAT)
#include <format>
@ -18,13 +18,14 @@
#include "spdlog/fmt/bundled/format.h"
#endif
#include "utils.h"
#include <atomic>
#include <iostream>
#include <memory>
#include <string>
#include <thread>
#include "utils.h"
using namespace std;
using namespace std::chrono;
using namespace spdlog;

View File

@ -6,11 +6,11 @@
//
// bench.cpp : spdlog benchmarks
//
#include "spdlog/spdlog.h"
#include "spdlog/sinks/basic_file_sink.h"
#include "spdlog/sinks/daily_file_sink.h"
#include "spdlog/sinks/null_sink.h"
#include "spdlog/sinks/rotating_file_sink.h"
#include "spdlog/spdlog.h"
#if defined(SPDLOG_USE_STD_FORMAT)
#include <format>
@ -20,13 +20,14 @@
#include "spdlog/fmt/bundled/format.h"
#endif
#include "utils.h"
#include <atomic>
#include <cstdlib> // EXIT_FAILURE
#include <memory>
#include <string>
#include <thread>
#include "utils.h"
void bench(int howmany, std::shared_ptr<spdlog::logger> log);
void bench_mt(int howmany, std::shared_ptr<spdlog::logger> log, size_t thread_count);

View File

@ -4,9 +4,8 @@
//
#include "benchmark/benchmark.h"
#include "spdlog/spdlog.h"
#include "spdlog/pattern_formatter.h"
#include "spdlog/spdlog.h"
void bench_formatter(benchmark::State &state, std::string pattern) {
auto formatter = std::make_unique<spdlog::pattern_formatter>(pattern);

View File

@ -8,13 +8,12 @@
//
#include "benchmark/benchmark.h"
#include "spdlog/spdlog.h"
#include "spdlog/async.h"
#include "spdlog/sinks/basic_file_sink.h"
#include "spdlog/sinks/daily_file_sink.h"
#include "spdlog/sinks/null_sink.h"
#include "spdlog/sinks/rotating_file_sink.h"
#include "spdlog/spdlog.h"
void bench_c_string(benchmark::State &state, std::shared_ptr<spdlog::logger> logger) {
const char *msg =

View File

@ -4,8 +4,8 @@
// spdlog usage example
#include <cstdio>
#include <chrono>
#include <cstdio>
void load_levels_example();
void stdout_logger_example();
@ -31,8 +31,8 @@ void replace_default_logger_example();
// This will add filename/line/column info to the log (and in to the resulting binary so take care).
// #define SPDLOG_SOURCE_LOCATION
#include "spdlog/spdlog.h"
#include "spdlog/cfg/env.h" // support for loading levels from the environment variable
#include "spdlog/spdlog.h"
int main(int, char *[]) {
// Log levels can be loaded from argv/env using "SPDLOG_LEVEL"
@ -220,8 +220,9 @@ void trace_example() {
}
// stopwatch example
#include "spdlog/stopwatch.h"
#include <thread>
#include "spdlog/stopwatch.h"
void stopwatch_example() {
spdlog::stopwatch sw;
std::this_thread::sleep_for(std::chrono::milliseconds(123));

View File

@ -14,14 +14,14 @@
// This is because each message in the queue holds a shared_ptr to the
// originating logger.
#include "async_logger.h"
#include "details/registry.h"
#include "details/thread_pool.h"
#include <functional>
#include <memory>
#include <mutex>
#include "async_logger.h"
#include "details/registry.h"
#include "details/thread_pool.h"
namespace spdlog {
namespace details {

View File

@ -2,8 +2,8 @@
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once
#include "helpers.h"
#include "../details/registry.h"
#include "helpers.h"
//
// Init log levels using each argv entry that starts with "SPDLOG_LEVEL="

View File

@ -2,9 +2,9 @@
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once
#include "helpers.h"
#include "../details/os.h"
#include "../details/registry.h"
#include "helpers.h"
//
// Init levels and patterns from env variables SPDLOG_LEVEL

View File

@ -3,9 +3,10 @@
#pragma once
#include "../common.h"
#include <unordered_map>
#include "../common.h"
namespace spdlog {
namespace cfg {
namespace helpers {

View File

@ -2,9 +2,6 @@
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once
#include "details/null_mutex.h"
#include "tweakme.h"
#include <array>
#include <atomic>
#include <chrono>
@ -17,6 +14,9 @@
#include <string>
#include <type_traits>
#include "details/null_mutex.h"
#include "tweakme.h"
#if __has_include(<version>)
#include <version>
#endif

View File

@ -3,9 +3,10 @@
#pragma once
#include "null_mutex.h"
#include <mutex>
#include "null_mutex.h"
namespace spdlog {
namespace details {

View File

@ -3,9 +3,10 @@
#pragma once
#include "../common.h"
#include <tuple>
#include "../common.h"
namespace spdlog {
namespace details {

View File

@ -2,13 +2,13 @@
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once
#include "../common.h"
#include "../fmt/fmt.h"
#include <chrono>
#include <iterator>
#include <type_traits>
#include "../common.h"
#include "../fmt/fmt.h"
#ifdef SPDLOG_USE_STD_FORMAT
#include <charconv>
#include <limits>

View File

@ -3,9 +3,10 @@
#pragma once
#include "../common.h"
#include <string>
#include "../common.h"
namespace spdlog {
namespace details {
struct SPDLOG_API log_msg {

View File

@ -10,12 +10,12 @@
// dequeue_for(..) - will block until the queue is not empty or timeout have
// passed.
#include "circular_q.h"
#include <atomic>
#include <condition_variable>
#include <mutex>
#include "circular_q.h"
namespace spdlog {
namespace details {

View File

@ -3,9 +3,10 @@
#pragma once
#include "../common.h"
#include <ctime> // std::time_t
#include "../common.h"
namespace spdlog {
namespace details {
namespace os {

View File

@ -10,14 +10,14 @@
// stops and joins the thread on destruction (if the thread is executing a callback, wait for it
// to finish first).
#include "../common.h"
#include <chrono>
#include <condition_variable>
#include <functional>
#include <mutex>
#include <thread>
#include "../common.h"
namespace spdlog {
namespace details {

View File

@ -8,9 +8,6 @@
// If user requests a non existing logger, nullptr will be returned
// This class is thread safe
#include "../common.h"
#include "periodic_worker.h"
#include <chrono>
#include <functional>
#include <memory>
@ -18,6 +15,9 @@
#include <string>
#include <unordered_map>
#include "../common.h"
#include "periodic_worker.h"
namespace spdlog {
class logger;

View File

@ -5,16 +5,17 @@
#define WIN32_LEAN_AND_MEAN
// tcp client helper
#include "../common.h"
#include "os.h"
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <string>
#include "../common.h"
#include "os.h"
#pragma comment(lib, "Ws2_32.lib")
#pragma comment(lib, "Mswsock.lib")
#pragma comment(lib, "AdvApi32.lib")

View File

@ -8,9 +8,6 @@
#endif
// tcp client helper
#include "../common.h"
#include "os.h"
#include <arpa/inet.h>
#include <netdb.h>
#include <netinet/in.h>
@ -20,6 +17,9 @@
#include <string>
#include "../common.h"
#include "os.h"
namespace spdlog {
namespace details {
class tcp_client {

View File

@ -3,17 +3,17 @@
#pragma once
#include "../async.h"
#include "log_msg_buffer.h"
#include "mpmc_blocking_q.h"
#include "os.h"
#include <chrono>
#include <functional>
#include <memory>
#include <thread>
#include <vector>
#include "../async.h"
#include "log_msg_buffer.h"
#include "mpmc_blocking_q.h"
#include "os.h"
namespace spdlog {
class async_logger;

View File

@ -6,16 +6,17 @@
// Helper RAII over winsock udp client socket.
// Will throw on construction if socket creation failed.
#include "os.h"
#include "windows_include.h"
#include "../common.h"
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <string>
#include "../common.h"
#include "os.h"
#include "windows_include.h"
#if defined(_MSC_VER)
#pragma comment(lib, "Ws2_32.lib")
#pragma comment(lib, "Mswsock.lib")

View File

@ -9,18 +9,18 @@
#include "../common.h"
#include "os.h"
#ifdef _WIN32
#error "include udp_client-windows.h instead"
#endif
#include <arpa/inet.h>
#include <cstring>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/udp.h>
#include <sys/socket.h>
#include <unistd.h>
#include <cstring>
#include <string>
namespace spdlog {

View File

@ -6,6 +6,7 @@
#pragma once
#include <cctype>
#include "../common.h"
#if defined(__has_include)

View File

@ -10,7 +10,7 @@
#if !defined(SPDLOG_USE_STD_FORMAT)
#if !defined(SPDLOG_FMT_EXTERNAL)
#include "../fmt/bundled/compile.h"
#include "../fmt/bundled/compile.h"
#else
#include <fmt/compile.h>
#endif

View File

@ -10,7 +10,7 @@
#if !defined(SPDLOG_USE_STD_FORMAT)
#if !defined(SPDLOG_FMT_EXTERNAL)
#include "../fmt/bundled/ostream.h"
#include "../fmt/bundled/ostream.h"
#else
#include <fmt/ostream.h>
#endif

View File

@ -14,13 +14,13 @@
// The use of private formatter per sink provides the opportunity to cache some
// formatted data, and support for different format per sink.
#include <cassert>
#include <vector>
#include "common.h"
#include "details/log_msg.h"
#include "sinks/sink.h"
#include <cassert>
#include <vector>
#ifndef SPDLOG_NO_EXCEPTIONS
#define SPDLOG_LOGGER_CATCH(location) \
catch (const std::exception &ex) { \

View File

@ -3,19 +3,18 @@
#pragma once
#include <chrono>
#include <ctime>
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
#include "common.h"
#include "details/log_msg.h"
#include "details/os.h"
#include "formatter.h"
#include <chrono>
#include <ctime>
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
namespace spdlog {
namespace details {

View File

@ -5,19 +5,20 @@
#ifdef __ANDROID__
#include "../details/fmt_helper.h"
#include "../details/null_mutex.h"
#include "os.h"
#include "../details/synchronous_factory.h"
#include "base_sink.h"
#include <android/log.h>
#include <chrono>
#include <mutex>
#include <string>
#include <thread>
#include <type_traits>
#include "../details/fmt_helper.h"
#include "../details/null_mutex.h"
#include "../details/synchronous_factory.h"
#include "base_sink.h"
#include "os.h"
#if !defined(SPDLOG_ANDROID_RETRIES)
#define SPDLOG_ANDROID_RETRIES 2
#endif

View File

@ -6,10 +6,11 @@
#include <array>
#include <memory>
#include <mutex>
#include <string>
#include "../details/console_globals.h"
#include "../details/null_mutex.h"
#include "sink.h"
#include <string>
namespace spdlog {
namespace sinks {

View File

@ -3,14 +3,14 @@
#pragma once
#include <mutex>
#include <string>
#include "../details/file_helper.h"
#include "../details/null_mutex.h"
#include "../details/synchronous_factory.h"
#include "base_sink.h"
#include <mutex>
#include <string>
namespace spdlog {
namespace sinks {
/*

View File

@ -3,13 +3,13 @@
#pragma once
#include <mutex>
#include <string>
#include "../details/null_mutex.h"
#include "../details/synchronous_factory.h"
#include "base_sink.h"
#include <mutex>
#include <string>
namespace spdlog {
// callbacks type

View File

@ -3,6 +3,13 @@
#pragma once
#include <chrono>
#include <cstdio>
#include <iomanip>
#include <mutex>
#include <sstream>
#include <string>
#include "../common.h"
#include "../details/circular_q.h"
#include "../details/file_helper.h"
@ -13,13 +20,6 @@
#include "../fmt/fmt.h"
#include "base_sink.h"
#include <chrono>
#include <cstdio>
#include <iomanip>
#include <mutex>
#include <sstream>
#include <string>
namespace spdlog {
namespace sinks {

View File

@ -3,16 +3,16 @@
#pragma once
#include "base_sink.h"
#include "../details/log_msg.h"
#include "../details/null_mutex.h"
#include "../pattern_formatter.h"
#include <algorithm>
#include <memory>
#include <mutex>
#include <vector>
#include "../details/log_msg.h"
#include "../details/null_mutex.h"
#include "../pattern_formatter.h"
#include "base_sink.h"
// Distribution sink (mux). Stores a vector of sinks which get called when log
// is called

View File

@ -3,15 +3,15 @@
#pragma once
#include "dist_sink.h"
#include "../details/log_msg.h"
#include "../details/null_mutex.h"
#include <chrono>
#include <cstdio>
#include <mutex>
#include <string>
#include "../details/log_msg.h"
#include "../details/null_mutex.h"
#include "dist_sink.h"
// Duplicate message removal sink.
// Skip the message if previous one is identical and less than "max_skip_duration" have passed
//

View File

@ -3,6 +3,12 @@
#pragma once
#include <chrono>
#include <cstdio>
#include <ctime>
#include <mutex>
#include <string>
#include "../common.h"
#include "../details/circular_q.h"
#include "../details/file_helper.h"
@ -12,12 +18,6 @@
#include "../fmt/fmt.h"
#include "base_sink.h"
#include <chrono>
#include <cstdio>
#include <ctime>
#include <mutex>
#include <string>
namespace spdlog {
namespace sinks {

View File

@ -10,14 +10,14 @@
// https://github.com/confluentinc/librdkafka
//
#include "base_sink.h"
#include <mutex>
#include "../async.h"
#include "../common.h"
#include "../details/log_msg.h"
#include "../details/null_mutex.h"
#include "../details/synchronous_factory.h"
#include <mutex>
#include "../common.h"
#include "base_sink.h"
// kafka header
#include <librdkafka/rdkafkacpp.h>

View File

@ -10,19 +10,18 @@
// http://mongocxx.org/mongocxx-v3/installation/
//
#include "base_sink.h"
#include "../common.h"
#include "../details/log_msg.h"
#include "../details/synchronous_factory.h"
#include <bsoncxx/builder/stream/document.hpp>
#include <bsoncxx/types.hpp>
#include <bsoncxx/view_or_value.hpp>
#include <mongocxx/client.hpp>
#include <mongocxx/instance.hpp>
#include <mongocxx/uri.hpp>
#include "../common.h"
#include "../details/log_msg.h"
#include "../details/synchronous_factory.h"
#include "base_sink.h"
namespace spdlog {
namespace sinks {
template <typename Mutex>
@ -78,8 +77,9 @@ private:
std::unique_ptr<mongocxx::client> client_ = nullptr;
};
#include "../details/null_mutex.h"
#include <mutex>
#include "../details/null_mutex.h"
using mongo_sink_mt = mongo_sink<std::mutex>;
using mongo_sink_st = mongo_sink<spdlog::details::null_mutex>;

View File

@ -4,12 +4,12 @@
#pragma once
#if defined(_WIN32)
#include "../details/null_mutex.h"
#include "base_sink.h"
#include <mutex>
#include <string>
#include "../details/null_mutex.h"
#include "base_sink.h"
// Avoid including windows.h (https://stackoverflow.com/a/30741042)
extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA(const char *lpOutputString);
extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();

View File

@ -3,12 +3,12 @@
#pragma once
#include <mutex>
#include "../details/null_mutex.h"
#include "../details/synchronous_factory.h"
#include "base_sink.h"
#include <mutex>
namespace spdlog {
namespace sinks {

View File

@ -3,12 +3,12 @@
#pragma once
#include "../details/null_mutex.h"
#include "base_sink.h"
#include <mutex>
#include <ostream>
#include "../details/null_mutex.h"
#include "base_sink.h"
namespace spdlog {
namespace sinks {
template <typename Mutex>

View File

@ -11,15 +11,15 @@
// If the widget's lifetime can be shorter than the logger's one, you should provide some permanent
// QObject, and then use a standard signal/slot.
//
#include "base_sink.h"
#include "../common.h"
#include "../details/log_msg.h"
#include "../details/synchronous_factory.h"
#include <array>
#include <QPlainTextEdit>
#include <QTextEdit>
#include "../common.h"
#include "../details/log_msg.h"
#include "../details/synchronous_factory.h"
#include "base_sink.h"
//
// qt_sink class
//
@ -224,9 +224,10 @@ protected:
std::array<QTextCharFormat, level::n_levels> colors_;
};
#include "../details/null_mutex.h"
#include <mutex>
#include "../details/null_mutex.h"
using qt_sink_mt = qt_sink<std::mutex>;
using qt_sink_st = qt_sink<details::null_mutex>;
using qt_color_sink_mt = qt_color_sink<std::mutex>;

View File

@ -3,16 +3,16 @@
#pragma once
#include "base_sink.h"
#include "../details/circular_q.h"
#include "../details/log_msg_buffer.h"
#include "../details/null_mutex.h"
#include <functional>
#include <mutex>
#include <string>
#include <vector>
#include "../details/circular_q.h"
#include "../details/log_msg_buffer.h"
#include "../details/null_mutex.h"
#include "base_sink.h"
namespace spdlog {
namespace sinks {
/*

View File

@ -3,15 +3,15 @@
#pragma once
#include <chrono>
#include <mutex>
#include <string>
#include "../details/file_helper.h"
#include "../details/null_mutex.h"
#include "../details/synchronous_factory.h"
#include "base_sink.h"
#include <chrono>
#include <mutex>
#include <string>
namespace spdlog {
namespace sinks {
//

View File

@ -3,12 +3,12 @@
#pragma once
#include <cstdio>
#include "../details/console_globals.h"
#include "../details/synchronous_factory.h"
#include "sink.h"
#include <cstdio>
#ifdef _WIN32
#include "../details/windows_include.h"
#endif

View File

@ -3,13 +3,14 @@
#pragma once
#include "../details/null_mutex.h"
#include "../details/synchronous_factory.h"
#include "base_sink.h"
#include <syslog.h>
#include <array>
#include <string>
#include <syslog.h>
#include "../details/null_mutex.h"
#include "../details/synchronous_factory.h"
#include "base_sink.h"
namespace spdlog {
namespace sinks {

View File

@ -3,12 +3,12 @@
#pragma once
#include <array>
#include "../details/null_mutex.h"
#include "../details/os.h"
#include "../details/synchronous_factory.h"
#include "base_sink.h"
#include <array>
#ifndef SD_JOURNAL_SUPPRESS_LOCATION
#define SD_JOURNAL_SUPPRESS_LOCATION
#endif

View File

@ -33,16 +33,16 @@ Windows Registry Editor Version 5.00
#pragma once
#include "../details/null_mutex.h"
#include "base_sink.h"
#include "../details/windows_include.h"
#include <winbase.h>
#include <mutex>
#include <string>
#include <vector>
#include "../details/null_mutex.h"
#include "../details/windows_include.h"
#include "base_sink.h"
namespace spdlog {
namespace sinks {

View File

@ -3,17 +3,17 @@
#pragma once
#include "../common.h"
#include "../details/console_globals.h"
#include "../details/null_mutex.h"
#include "sink.h"
#include <array>
#include <cstdint>
#include <memory>
#include <mutex>
#include <string>
#include "../common.h"
#include "../details/console_globals.h"
#include "../details/null_mutex.h"
#include "sink.h"
namespace spdlog {
namespace sinks {
/*

View File

@ -9,17 +9,17 @@
#pragma once
#include "common.h"
#include "logger.h"
#include "version.h"
#include "details/registry.h"
#include "details/synchronous_factory.h"
#include <chrono>
#include <functional>
#include <memory>
#include <string>
#include "common.h"
#include "details/registry.h"
#include "details/synchronous_factory.h"
#include "logger.h"
#include "version.h"
namespace spdlog {
using default_factory = synchronous_factory;

View File

@ -4,6 +4,7 @@
#pragma once
#include <chrono>
#include "fmt/fmt.h"
// Stopwatch support for spdlog (using std::chrono::steady_clock).

View File

@ -2,12 +2,13 @@
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#include "spdlog/async_logger.h"
#include "spdlog/details/thread_pool.h"
#include "spdlog/sinks/sink.h"
#include <memory>
#include <string>
#include "spdlog/details/thread_pool.h"
#include "spdlog/sinks/sink.h"
spdlog::async_logger::async_logger(std::string logger_name,
sinks_init_list sinks_list,
std::weak_ptr<details::thread_pool> tp,

View File

@ -2,14 +2,15 @@
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#include "spdlog/cfg/helpers.h"
#include "spdlog/details/registry.h"
#include "spdlog/spdlog.h"
#include <algorithm>
#include <sstream>
#include <string>
#include <utility>
#include "spdlog/details/registry.h"
#include "spdlog/spdlog.h"
namespace spdlog {
namespace cfg {
namespace helpers {

View File

@ -1,15 +1,16 @@
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#include "spdlog/common.h"
#include "spdlog/details/file_helper.h"
#include "spdlog/details/os.h"
#include <cerrno>
#include <cstdio>
#include <string>
#include <tuple>
#include "spdlog/common.h"
#include "spdlog/details/os.h"
namespace spdlog {
namespace details {

View File

@ -2,6 +2,7 @@
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#include "spdlog/details/log_msg.h"
#include "spdlog/details/os.h"
namespace spdlog {

View File

@ -1,9 +1,10 @@
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#include "spdlog/common.h"
#include "spdlog/details/os.h"
#include <sys/stat.h>
#include <algorithm>
#include <array>
#include <chrono>
@ -12,9 +13,11 @@
#include <cstring>
#include <ctime>
#include <string>
#include <sys/stat.h>
#include <thread>
#include "spdlog/common.h"
// clang-format off
#ifdef _WIN32
#include "spdlog/details/windows_include.h"
#include <fileapi.h> // for FlushFileBuffers
@ -63,6 +66,7 @@
#define __has_feature(x) 0 // Compatibility with non-clang compilers.
#endif
// clang-format on
namespace spdlog {
namespace details {
namespace os {

View File

@ -2,6 +2,7 @@
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#include "spdlog/details/registry.h"
#include "spdlog/common.h"
#include "spdlog/details/periodic_worker.h"
#include "spdlog/logger.h"

View File

@ -1,10 +1,12 @@
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#include <cassert>
#include "spdlog/common.h"
#include "spdlog/details/thread_pool.h"
#include <cassert>
#include "spdlog/common.h"
namespace spdlog {
namespace details {

View File

@ -2,12 +2,13 @@
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#include "spdlog/logger.h"
#include "spdlog/pattern_formatter.h"
#include "spdlog/sinks/sink.h"
#include <cstdio>
#include <mutex>
#include "spdlog/pattern_formatter.h"
#include "spdlog/sinks/sink.h"
namespace spdlog {
// public methods

View File

@ -1,13 +1,7 @@
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#include "spdlog/details/fmt_helper.h"
#include "spdlog/details/log_msg.h"
#include "spdlog/details/os.h"
#include "spdlog/fmt/fmt.h"
#include "spdlog/formatter.h"
#include "spdlog/pattern_formatter.h"
#include "spdlog/common.h"
#include <algorithm>
#include <array>
@ -19,6 +13,13 @@
#include <thread>
#include <utility>
#include "spdlog/common.h"
#include "spdlog/details/fmt_helper.h"
#include "spdlog/details/log_msg.h"
#include "spdlog/details/os.h"
#include "spdlog/fmt/fmt.h"
#include "spdlog/formatter.h"
namespace spdlog {
namespace details {

View File

@ -1,13 +1,14 @@
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#include "spdlog/common.h"
#include "spdlog/pattern_formatter.h"
#include "spdlog/sinks/base_sink.h"
#include <memory>
#include <mutex>
#include "spdlog/common.h"
#include "spdlog/pattern_formatter.h"
template <typename Mutex>
spdlog::sinks::base_sink<Mutex>::base_sink()
: formatter_{std::make_unique<spdlog::pattern_formatter>()} {}

View File

@ -3,16 +3,16 @@
#include "spdlog/sinks/rotating_file_sink.h"
#include "spdlog/common.h"
#include "spdlog/details/file_helper.h"
#include "spdlog/details/os.h"
#include "spdlog/fmt/fmt.h"
#include <cerrno>
#include <mutex>
#include <string>
#include <tuple>
#include "spdlog/common.h"
#include "spdlog/details/file_helper.h"
#include "spdlog/details/os.h"
#include "spdlog/fmt/fmt.h"
namespace spdlog {
namespace sinks {

View File

@ -1,11 +1,12 @@
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#include "spdlog/sinks/stdout_color_sinks.h"
#include "spdlog/async.h"
#include "spdlog/common.h"
#include "spdlog/details/synchronous_factory.h"
#include "spdlog/logger.h"
#include "spdlog/sinks/stdout_color_sinks.h"
namespace spdlog {

View File

@ -1,10 +1,13 @@
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#include <memory>
#include "spdlog/pattern_formatter.h"
#include "spdlog/sinks/stdout_sinks.h"
#include <memory>
#include "spdlog/pattern_formatter.h"
// clang-format off
#ifdef _WIN32
// under windows using fwrite to non-binary stream results in \r\r\n (see issue #1675)
// so instead we use ::FileWrite
@ -18,6 +21,7 @@
#include <stdio.h> // _fileno(..)
#endif // _WIN32
// clang-format on
namespace spdlog {
namespace sinks {

View File

@ -2,13 +2,14 @@
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#ifdef _WIN32
#include "spdlog/common.h"
#include "spdlog/details/windows_include.h"
#include "spdlog/pattern_formatter.h"
#include "spdlog/sinks/wincolor_sink.h"
#include <wincon.h>
#include "spdlog/common.h"
#include "spdlog/details/windows_include.h"
#include "spdlog/pattern_formatter.h"
namespace spdlog {
namespace sinks {
template <typename ConsoleMutex>

View File

@ -1,9 +1,10 @@
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#include "spdlog/spdlog.h"
#include "spdlog/common.h"
#include "spdlog/pattern_formatter.h"
#include "spdlog/spdlog.h"
namespace spdlog {

View File

@ -47,8 +47,7 @@ set(SPDLOG_UTESTS_SOURCES
test_ringbuffer_sink.cpp
test_source_location.cpp
test_log_level.cpp
test_include_sinks.cpp
)
test_include_sinks.cpp)
if(WIN32)
list(APPEND SPDLOG_UTESTS_SOURCES test_eventlog.cpp)

View File

@ -9,28 +9,30 @@
#pragma GCC diagnostic pop
#endif
#include "utils.h"
#include <stdlib.h>
#include <chrono>
#include <cstdio>
#include <exception>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <ostream>
#include <sstream>
#include <string>
#include <iomanip>
#include <stdlib.h>
#include "utils.h"
#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_DEBUG
#include "spdlog/spdlog.h"
#include "spdlog/async.h"
#include "spdlog/details/fmt_helper.h"
#include "spdlog/pattern_formatter.h"
#include "spdlog/sinks/basic_file_sink.h"
#include "spdlog/sinks/daily_file_sink.h"
#include "spdlog/sinks/msvc_sink.h"
#include "spdlog/sinks/null_sink.h"
#include "spdlog/sinks/ostream_sink.h"
#include "spdlog/sinks/rotating_file_sink.h"
#include "spdlog/sinks/stdout_color_sinks.h"
#include "spdlog/sinks/msvc_sink.h"
#include "spdlog/pattern_formatter.h"
#include "spdlog/spdlog.h"

View File

@ -1,6 +1,6 @@
#include "includes.h"
#include "test_sink.h"
#include "spdlog/fmt/bin_to_hex.h"
#include "test_sink.h"
TEST_CASE("to_hex", "[to_hex]") {
std::ostringstream oss;

View File

@ -1,9 +1,8 @@
#include "includes.h"
#include "test_sink.h"
#include "spdlog/cfg/env.h"
#include "spdlog/cfg/argv.h"
#include "spdlog/cfg/env.h"
#include "test_sink.h"
using spdlog::cfg::load_argv_levels;
using spdlog::cfg::load_env_levels;

View File

@ -3,10 +3,10 @@
* https://raw.githubusercontent.com/gabime/spdlog/master/LICENSE
*/
#include "includes.h"
#include "test_sink.h"
#include "spdlog/sinks/callback_sink.h"
#include "spdlog/async.h"
#include "spdlog/common.h"
#include "spdlog/sinks/callback_sink.h"
#include "test_sink.h"
TEST_CASE("custom_callback_logger", "[custom_callback_logger]") {
std::vector<std::string> lines;

View File

@ -2,10 +2,10 @@
* This content is released under the MIT License as specified in
* https://raw.githubusercontent.com/gabime/spdlog/master/LICENSE
*/
#include "includes.h"
#include <iostream>
#include "includes.h"
#define SIMPLE_LOG "test_logs/simple_log.txt"
#define SIMPLE_ASYNC_LOG "test_logs/simple_async_log.txt"

View File

@ -1,8 +1,7 @@
#include "includes.h"
#include "test_sink.h"
#include "spdlog/sinks/win_eventlog_sink.h"
#include "test_sink.h"
static const LPCSTR TEST_SOURCE = "spdlog_test";
@ -70,5 +69,3 @@ TEST_CASE("eventlog", "[eventlog]") {
test_single_print([&test_logger](std::string const &msg) { test_logger.critical(msg); },
"my critical message", EVENTLOG_ERROR_TYPE);
}

View File

@ -20,6 +20,6 @@
#include "spdlog/sinks/udp_sink.h"
#ifdef _WIN32
#include "spdlog/sinks/wincolor_sink.h"
#include "spdlog/sinks/win_eventlog_sink.h"
#include "spdlog/sinks/win_eventlog_sink.h"
#include "spdlog/sinks/wincolor_sink.h"
#endif

View File

@ -1,8 +1,9 @@
#include "includes.h"
#include "test_sink.h"
#include <map>
#include <vector>
#include "includes.h"
#include "test_sink.h"
TEST_CASE("test_default_level", "[log_level]") {
auto test_sink = std::make_shared<spdlog::sinks::test_sink_st>();
REQUIRE(test_sink->log_level() == spdlog::level::trace);

View File

@ -5,13 +5,14 @@
#pragma once
#include "spdlog/details/null_mutex.h"
#include "spdlog/sinks/base_sink.h"
#include "spdlog/fmt/fmt.h"
#include <chrono>
#include <mutex>
#include <thread>
#include "spdlog/details/null_mutex.h"
#include "spdlog/fmt/fmt.h"
#include "spdlog/sinks/base_sink.h"
namespace spdlog {
namespace sinks {

View File

@ -3,8 +3,8 @@
* https://raw.githubusercontent.com/gabime/spdlog/master/LICENSE
*/
#include "includes.h"
#include "spdlog/sinks/stdout_sinks.h"
#include "spdlog/sinks/stdout_color_sinks.h"
#include "spdlog/sinks/stdout_sinks.h"
TEST_CASE("stdout_st", "[stdout]") {
auto l = spdlog::stdout_logger_st("test");
l->set_pattern("%+");

View File

@ -1,6 +1,6 @@
#include "includes.h"
#include "test_sink.h"
#include "spdlog/stopwatch.h"
#include "test_sink.h"
TEST_CASE("stopwatch1", "[stopwatch]") {
using std::chrono::milliseconds;

View File

@ -1,6 +1,6 @@
#include "includes.h"
#include "test_sink.h"
#include "spdlog/async.h"
#include "test_sink.h"
TEST_CASE("time_point1", "[time_point log_msg]") {
std::shared_ptr<spdlog::sinks::test_sink_st> test_sink(new spdlog::sinks::test_sink_st);

View File

@ -3,8 +3,8 @@
#ifdef _WIN32
#include <windows.h>
#else
#include <sys/types.h>
#include <dirent.h>
#include <sys/types.h>
#endif
void prepare_logdir() {