relative includes wip

This commit is contained in:
gabime 2023-09-28 00:42:16 +03:00
parent 967554e4c5
commit 4bb3b56102
42 changed files with 163 additions and 131 deletions

View File

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

View File

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

View File

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

View File

@ -3,7 +3,7 @@
#pragma once
#include <spdlog/common.h>
#include "../common.h"
#include <string>
namespace spdlog {

View File

@ -3,7 +3,7 @@
#pragma once
#include <spdlog/details/log_msg.h>
#include "log_msg.h"
namespace spdlog {
namespace details {

View File

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

View File

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

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 <spdlog/common.h>
namespace spdlog {
namespace details {

View File

@ -8,8 +8,8 @@
// If user requests a non existing logger, nullptr will be returned
// This class is thread safe
#include <spdlog/common.h>
#include <spdlog/details/periodic_worker.h>
#include "../common.h"
#include "periodic_worker.h"
#include <chrono>
#include <functional>

View File

@ -5,8 +5,8 @@
#define WIN32_LEAN_AND_MEAN
// tcp client helper
#include <spdlog/common.h>
#include <spdlog/details/os.h>
#include "../common.h"
#include "os.h"
#include <stdio.h>
#include <stdlib.h>

View File

@ -8,8 +8,8 @@
#endif
// tcp client helper
#include <spdlog/common.h>
#include <spdlog/details/os.h>
#include "../common.h"
#include "os.h"
#include <arpa/inet.h>
#include <netdb.h>

View File

@ -3,10 +3,10 @@
#pragma once
#include <spdlog/async.h>
#include <spdlog/details/log_msg_buffer.h>
#include <spdlog/details/mpmc_blocking_q.h>
#include <spdlog/details/os.h>
#include "../async.h"
#include "log_msg_buffer.h"
#include "mpmc_blocking_q.h"
#include "os.h"
#include <chrono>
#include <functional>

View File

@ -6,8 +6,9 @@
// Helper RAII over winsock udp client socket.
// Will throw on construction if socket creation failed.
#include <spdlog/common.h>
#include <spdlog/details/os.h>
#include "../common.h"
#include "os.h"
#include <spdlog/details/windows_include.h>
#include <stdio.h>
#include <stdlib.h>

View File

@ -6,6 +6,10 @@
// Helper RAII over unix udp client socket.
// Will throw on construction if the socket creation failed.
#include "../common.h"
#include "os.h"
#ifdef _WIN32
#error "include udp_client-windows.h instead"
#endif
@ -15,11 +19,8 @@
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/udp.h>
#include <spdlog/common.h>
#include <spdlog/details/os.h>
#include <sys/socket.h>
#include <unistd.h>
#include <string>
namespace spdlog {

View File

@ -5,11 +5,11 @@
#ifdef __ANDROID__
#include <spdlog/details/fmt_helper.h>
#include <spdlog/details/null_mutex.h>
#include <spdlog/details/os.h>
#include <spdlog/details/synchronous_factory.h>
#include <spdlog/sinks/base_sink.h>
#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>

View File

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

View File

@ -9,9 +9,9 @@
// implementers..
//
#include <spdlog/common.h>
#include <spdlog/details/log_msg.h>
#include <spdlog/sinks/sink.h>
#include "../common.h"
#include "../details/log_msg.h"
#include "sink.h"
namespace spdlog {
namespace sinks {

View File

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

View File

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

View File

@ -3,15 +3,15 @@
#pragma once
#include <spdlog/common.h>
#include <spdlog/details/circular_q.h>
#include <spdlog/details/file_helper.h>
#include <spdlog/details/null_mutex.h>
#include <spdlog/details/os.h>
#include <spdlog/details/synchronous_factory.h>
#include <spdlog/fmt/chrono.h>
#include <spdlog/fmt/fmt.h>
#include <spdlog/sinks/base_sink.h>
#include "../common.h"
#include "../details/circular_q.h"
#include "../details/file_helper.h"
#include "../details/null_mutex.h"
#include "../details/os.h"
#include "../details/synchronous_factory.h"
#include "../fmt/chrono.h"
#include "../fmt/fmt.h"
#include "base_sink.h"
#include <chrono>
#include <cstdio>

View File

@ -4,9 +4,9 @@
#pragma once
#include "base_sink.h"
#include <spdlog/details/log_msg.h>
#include <spdlog/details/null_mutex.h>
#include <spdlog/pattern_formatter.h>
#include "../details/log_msg.h"
#include "../details/null_mutex.h"
#include "../pattern_formatter.h"
#include <algorithm>
#include <memory>

View File

@ -4,8 +4,8 @@
#pragma once
#include "dist_sink.h"
#include <spdlog/details/log_msg.h>
#include <spdlog/details/null_mutex.h>
#include "../details/log_msg.h"
#include "../details/null_mutex.h"
#include <chrono>
#include <cstdio>

View File

@ -3,14 +3,14 @@
#pragma once
#include <spdlog/common.h>
#include <spdlog/details/circular_q.h>
#include <spdlog/details/file_helper.h>
#include <spdlog/details/null_mutex.h>
#include <spdlog/details/os.h>
#include <spdlog/details/synchronous_factory.h>
#include <spdlog/fmt/fmt.h>
#include <spdlog/sinks/base_sink.h>
#include "../common.h"
#include "../details/circular_q.h"
#include "../details/file_helper.h"
#include "../details/null_mutex.h"
#include "../details/os.h"
#include "../details/synchronous_factory.h"
#include "../fmt/fmt.h"
#include "base_sink.h"
#include <chrono>
#include <cstdio>

View File

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

View File

@ -10,10 +10,10 @@
// http://mongocxx.org/mongocxx-v3/installation/
//
#include "spdlog/common.h"
#include "spdlog/details/log_msg.h"
#include "spdlog/sinks/base_sink.h"
#include <spdlog/details/synchronous_factory.h>
#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>
@ -78,7 +78,7 @@ private:
std::unique_ptr<mongocxx::client> client_ = nullptr;
};
#include "spdlog/details/null_mutex.h"
#include "../details/null_mutex.h"
#include <mutex>
using mongo_sink_mt = mongo_sink<std::mutex>;
using mongo_sink_st = mongo_sink<spdlog::details::null_mutex>;

View File

@ -5,8 +5,8 @@
#if defined(_WIN32)
#include <spdlog/details/null_mutex.h>
#include <spdlog/sinks/base_sink.h>
#include "../details/null_mutex.h"
#include "base_sink.h"
#include <mutex>
#include <string>

View File

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

View File

@ -3,8 +3,8 @@
#pragma once
#include <spdlog/details/null_mutex.h>
#include <spdlog/sinks/base_sink.h>
#include "../details/null_mutex.h"
#include "base_sink.h"
#include <mutex>
#include <ostream>

View File

@ -12,10 +12,10 @@
// QObject, and then use a standard signal/slot.
//
#include "spdlog/common.h"
#include "spdlog/details/log_msg.h"
#include "spdlog/details/synchronous_factory.h"
#include "spdlog/sinks/base_sink.h"
#include "../common.h"
#include "../details/log_msg.h"
#include "../details/synchronous_factory.h"
#include "base_sink.h"
#include <array>
#include <QPlainTextEdit>
@ -225,7 +225,7 @@ protected:
std::array<QTextCharFormat, level::n_levels> colors_;
};
#include "spdlog/details/null_mutex.h"
#include "../details/null_mutex.h"
#include <mutex>
using qt_sink_mt = qt_sink<std::mutex>;

View File

@ -3,10 +3,10 @@
#pragma once
#include "spdlog/details/circular_q.h"
#include "spdlog/details/log_msg_buffer.h"
#include "spdlog/details/null_mutex.h"
#include "spdlog/sinks/base_sink.h"
#include "base_sink.h"
#include "../details/circular_q.h"
#include "../details/log_msg_buffer.h"
#include "../details/null_mutex.h"
#include <functional>
#include <mutex>

View File

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

View File

@ -3,8 +3,8 @@
#pragma once
#include <spdlog/details/log_msg.h>
#include <spdlog/formatter.h>
#include "../details/log_msg.h"
#include "../formatter.h"
namespace spdlog {
namespace sinks {

View File

@ -4,13 +4,13 @@
#pragma once
#ifdef _WIN32
#include <spdlog/sinks/wincolor_sink.h>
#include "wincolor_sink.h"
#else
#include <spdlog/sinks/ansicolor_sink.h>
#include "ansicolor_sink.h"
#endif
#include <spdlog/async.h>
#include <spdlog/details/synchronous_factory.h>
#include "../async.h"
#include "../details/synchronous_factory.h"
namespace spdlog {
namespace sinks {

View File

@ -3,13 +3,14 @@
#pragma once
#include "../details/console_globals.h"
#include "../details/synchronous_factory.h"
#include "sink.h"
#include <cstdio>
#include <spdlog/details/console_globals.h>
#include <spdlog/details/synchronous_factory.h>
#include <spdlog/sinks/sink.h>
#ifdef _WIN32
#include <spdlog/details/windows_include.h>
#include "../details/windows_include.h"
#endif
namespace spdlog {

View File

@ -3,9 +3,9 @@
#pragma once
#include <spdlog/details/null_mutex.h>
#include <spdlog/details/synchronous_factory.h>
#include <spdlog/sinks/base_sink.h>
#include "../details/null_mutex.h"
#include "../details/synchronous_factory.h"
#include "base_sink.h"
#include <array>
#include <string>

View File

@ -3,10 +3,10 @@
#pragma once
#include <spdlog/details/null_mutex.h>
#include <spdlog/details/os.h>
#include <spdlog/details/synchronous_factory.h>
#include <spdlog/sinks/base_sink.h>
#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

View File

@ -3,13 +3,13 @@
#pragma once
#include <spdlog/common.h>
#include <spdlog/details/null_mutex.h>
#include <spdlog/sinks/base_sink.h>
#include "../common.h"
#include "../details/null_mutex.h"
#include "base_sink.h"
#ifdef _WIN32
#include <spdlog/details/tcp_client-windows.h>
#include "../details/tcp_client-windows.h"
#else
#include <spdlog/details/tcp_client.h>
#include "../details/tcp_client.h"
#endif
#include <chrono>

View File

@ -3,13 +3,13 @@
#pragma once
#include <spdlog/common.h>
#include <spdlog/details/null_mutex.h>
#include <spdlog/sinks/base_sink.h>
#include "../common.h"
#include "../details/null_mutex.h"
#include "base_sink.h"
#ifdef _WIN32
#include <spdlog/details/udp_client-windows.h>
#include "../details/udp_client-windows.h"
#else
#include <spdlog/details/udp_client.h>
#include "../details/udp_client.h"
#endif
#include <chrono>

View File

@ -32,11 +32,12 @@ Windows Registry Editor Version 5.00
-----------------------------------------------------------------------------------------*/
#pragma once
#ifdef _WIN32
#include <spdlog/details/null_mutex.h>
#include <spdlog/sinks/base_sink.h>
#include "../details/null_mutex.h"
#include "base_sink.h"
#include <spdlog/details/windows_include.h>
#include "../details/windows_include.h"
#include <winbase.h>
#include <mutex>
@ -249,3 +250,5 @@ using win_eventlog_sink_st = win_eventlog::win_eventlog_sink<details::null_mutex
} // namespace sinks
} // namespace spdlog
#endif

View File

@ -3,10 +3,10 @@
#pragma once
#include <spdlog/common.h>
#include <spdlog/details/console_globals.h>
#include <spdlog/details/null_mutex.h>
#include <spdlog/sinks/sink.h>
#include "../common.h"
#include "../details/console_globals.h"
#include "../details/null_mutex.h"
#include "sink.h"
#include <array>
#include <cstdint>

View File

@ -47,7 +47,9 @@ set(SPDLOG_UTESTS_SOURCES
test_circular_q.cpp
test_ringbuffer_sink.cpp
test_source_location.cpp
test_log_level.cpp)
test_log_level.cpp
test_include_sinks.cpp
)
if(NOT SPDLOG_NO_EXCEPTIONS)
list(APPEND SPDLOG_UTESTS_SOURCES test_errors.cpp)

View File

@ -0,0 +1,22 @@
#include <spdlog/sinks/android_sink.h>
#include <spdlog/sinks/ansicolor_sink.h>
#include <spdlog/sinks/base_sink.h>
#include <spdlog/sinks/basic_file_sink.h>
#include <spdlog/sinks/callback_sink.h>
#include <spdlog/sinks/daily_file_sink.h>
#include <spdlog/sinks/dist_sink.h>
#include <spdlog/sinks/dup_filter_sink.h>
#include <spdlog/sinks/hourly_file_sink.h>
#include <spdlog/sinks/msvc_sink.h>
#include <spdlog/sinks/null_sink.h>
#include <spdlog/sinks/ostream_sink.h>
#include <spdlog/sinks/ringbuffer_sink.h>
#include <spdlog/sinks/rotating_file_sink.h>
#include <spdlog/sinks/sink.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/sinks/stdout_sinks.h>
#include <spdlog/sinks/syslog_sink.h>
#include <spdlog/sinks/tcp_sink.h>
#include <spdlog/sinks/udp_sink.h>
#include <spdlog/sinks/wincolor_sink.h>
#include <spdlog/sinks/win_eventlog_sink.h>