wip static-lib

This commit is contained in:
gabime 2019-05-13 00:09:00 +03:00
parent 61e4597488
commit ce637440bb
21 changed files with 82 additions and 33 deletions

View File

@ -3,6 +3,10 @@
#pragma once #pragma once
#ifndef SPDLOG_HEADER_ONLY
#include "spdlog/async_logger.h"
#endif
#include "spdlog/sinks/sink.h" #include "spdlog/sinks/sink.h"
#include "spdlog/details/thread_pool.h" #include "spdlog/details/thread_pool.h"

View File

@ -3,6 +3,10 @@
#pragma once #pragma once
#ifndef SPDLOG_HEADER_ONLY
#include "spdlog/common.h"
#endif
namespace spdlog { namespace spdlog {
namespace level { namespace level {
static string_view_t level_string_views[] SPDLOG_LEVEL_NAMES; static string_view_t level_string_views[] SPDLOG_LEVEL_NAMES;

View File

@ -3,6 +3,10 @@
#pragma once #pragma once
#ifndef SPDLOG_HEADER_ONLY
#include "spdlog/details/file_helper.h"
#endif
#include "spdlog/details/os.h" #include "spdlog/details/os.h"
#include <cerrno> #include <cerrno>

View File

@ -3,6 +3,10 @@
#pragma once #pragma once
#ifndef SPDLOG_HEADER_ONLY
#include "spdlog/details/log_msg.h"
#endif
#include "spdlog/details/os.h" #include "spdlog/details/os.h"
#include "spdlog/sinks/sink.h" #include "spdlog/sinks/sink.h"

View File

@ -2,6 +2,11 @@
// Distributed under the MIT License (http://opensource.org/licenses/MIT) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
#ifndef SPDLOG_HEADER_ONLY
#include "spdlog/details/os.h"
#endif
#include <algorithm> #include <algorithm>
#include <chrono> #include <chrono>
#include <cstdio> #include <cstdio>

View File

@ -3,6 +3,10 @@
#pragma once #pragma once
#ifndef SPDLOG_HEADER_ONLY
#include "spdlog/details/pattern_formatter.h"
#endif
#include "spdlog/details/fmt_helper.h" #include "spdlog/details/fmt_helper.h"
#include "spdlog/details/log_msg.h" #include "spdlog/details/log_msg.h"
#include "spdlog/details/os.h" #include "spdlog/details/os.h"

View File

@ -2,8 +2,14 @@
// Distributed under the MIT License (http://opensource.org/licenses/MIT) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
#ifndef SPDLOG_HEADER_ONLY
#include "spdlog/details/periodic_worker.h"
#endif
namespace spdlog { namespace spdlog {
namespace details { namespace details {
SPDLOG_INLINE periodic_worker::periodic_worker(const std::function<void()> &callback_fun, std::chrono::seconds interval) SPDLOG_INLINE periodic_worker::periodic_worker(const std::function<void()> &callback_fun, std::chrono::seconds interval)
{ {
active_ = (interval > std::chrono::seconds::zero()); active_ = (interval > std::chrono::seconds::zero());

View File

@ -3,6 +3,10 @@
#pragma once #pragma once
#ifndef SPDLOG_HEADER_ONLY
#include "spdlog/details/registry.h"
#endif
#include "spdlog/common.h" #include "spdlog/common.h"
#include "spdlog/details/periodic_worker.h" #include "spdlog/details/periodic_worker.h"
#include "spdlog/logger.h" #include "spdlog/logger.h"

View File

@ -3,6 +3,10 @@
#pragma once #pragma once
#ifndef SPDLOG_HEADER_ONLY
#include "spdlog/details/thread_pool.h"
#endif
#include "spdlog/common.h" #include "spdlog/common.h"
namespace spdlog { namespace spdlog {

View File

@ -3,6 +3,10 @@
#pragma once #pragma once
#ifndef SPDLOG_HEADER_ONLY
#include "spdlog/logger.h"
#endif
#include "spdlog/sinks/sink.h" #include "spdlog/sinks/sink.h"
#include "spdlog/details/pattern_formatter.h" #include "spdlog/details/pattern_formatter.h"

View File

@ -3,6 +3,10 @@
#pragma once #pragma once
#ifndef SPDLOG_HEADER_ONLY
#include "spdlog/sinks/ansicolor_sink.h"
#endif
#include "spdlog/details/os.h" #include "spdlog/details/os.h"
template<typename TargetStream, typename ConsoleMutex> template<typename TargetStream, typename ConsoleMutex>

View File

@ -3,6 +3,10 @@
#pragma once #pragma once
#ifndef SPDLOG_HEADER_ONLY
#include "spdlog/sinks/base_sink.h"
#endif
#include "spdlog/common.h" #include "spdlog/common.h"
#include "spdlog/details/pattern_formatter.h" #include "spdlog/details/pattern_formatter.h"

View File

@ -3,6 +3,10 @@
#pragma once #pragma once
#ifndef SPDLOG_HEADER_ONLY
#include "spdlog/sinks/basic_file_sink.h"
#endif
#include "spdlog/common.h" #include "spdlog/common.h"
#include "spdlog/details/os.h" #include "spdlog/details/os.h"

View File

@ -3,6 +3,10 @@
#pragma once #pragma once
#ifndef SPDLOG_HEADER_ONLY
#include "spdlog/sinks/rotating_file_sink.h"
#endif
#include "spdlog/common.h" #include "spdlog/common.h"
#include "spdlog/details/file_helper.h" #include "spdlog/details/file_helper.h"

View File

@ -3,6 +3,10 @@
#pragma once #pragma once
#ifndef SPDLOG_HEADER_ONLY
#include "spdlog/sinks/sink.h"
#endif
#include "spdlog/common.h" #include "spdlog/common.h"
#include "spdlog/details/pattern_formatter.h" #include "spdlog/details/pattern_formatter.h"

View File

@ -3,6 +3,10 @@
#pragma once #pragma once
#ifndef SPDLOG_HEADER_ONLY
#include "spdlog/sinks/stdout_color_sinks.h"
#endif
#include "spdlog/logger.h" #include "spdlog/logger.h"
#include "spdlog/common.h" #include "spdlog/common.h"

View File

@ -3,8 +3,15 @@
#pragma once #pragma once
#ifndef SPDLOG_HEADER_ONLY
#include "spdlog/sinks/wincolor_sink.h"
#endif
#include "spdlog/common.h"
namespace spdlog { namespace spdlog {
namespace sinks { namespace sinks {
template<typename TargetStream, typename ConsoleMutex> template<typename TargetStream, typename ConsoleMutex>
SPDLOG_INLINE wincolor_sink<TargetStream, ConsoleMutex>::wincolor_sink() SPDLOG_INLINE wincolor_sink<TargetStream, ConsoleMutex>::wincolor_sink()
: out_handle_(TargetStream::handle()) : out_handle_(TargetStream::handle())

View File

@ -3,6 +3,10 @@
#pragma once #pragma once
#ifndef SPDLOG_HEADER_ONLY
#include "spdlog/spdlog.h"
#endif
#include "spdlog/common.h" #include "spdlog/common.h"
#include "spdlog/details/pattern_formatter.h" #include "spdlog/details/pattern_formatter.h"

View File

@ -8,72 +8,48 @@
#include <mutex> #include <mutex>
#include <chrono> #include <chrono>
#include "spdlog/spdlog.h" #include "spdlog/details/null_mutex.h"
#include "spdlog/spdlog-inl.h"
#include "spdlog/async.h" #include "spdlog/async.h"
#include "spdlog/common.h" #include "spdlog/spdlog-inl.h"
#include "spdlog/common-inl.h" #include "spdlog/common-inl.h"
#include "spdlog/details/null_mutex.h"
#include "spdlog/logger.h"
#include "spdlog/logger-inl.h" #include "spdlog/logger-inl.h"
template spdlog::logger::logger(std::string name, sinks_init_list::iterator begin, sinks_init_list::iterator end); template spdlog::logger::logger(std::string name, sinks_init_list::iterator begin, sinks_init_list::iterator end);
#include "spdlog/async_logger.h"
#include "spdlog/async_logger-inl.h" #include "spdlog/async_logger-inl.h"
#include "spdlog/details/log_msg.h"
#include "spdlog/details/log_msg-inl.h" #include "spdlog/details/log_msg-inl.h"
#include "spdlog/sinks/sink.h"
#include "spdlog/sinks/sink-inl.h" #include "spdlog/sinks/sink-inl.h"
#include "spdlog/sinks/base_sink.h"
#include "spdlog/sinks/base_sink-inl.h" #include "spdlog/sinks/base_sink-inl.h"
template class spdlog::sinks::base_sink<std::mutex>; template class spdlog::sinks::base_sink<std::mutex>;
template class spdlog::sinks::base_sink<spdlog::details::null_mutex>; template class spdlog::sinks::base_sink<spdlog::details::null_mutex>;
#include "spdlog/sinks/basic_file_sink.h"
#include "spdlog/sinks/basic_file_sink-inl.h" #include "spdlog/sinks/basic_file_sink-inl.h"
template class spdlog::sinks::basic_file_sink<std::mutex>; template class spdlog::sinks::basic_file_sink<std::mutex>;
template class spdlog::sinks::basic_file_sink<spdlog::details::null_mutex>; template class spdlog::sinks::basic_file_sink<spdlog::details::null_mutex>;
#include "spdlog/sinks/rotating_file_sink.h"
#include "spdlog/sinks/rotating_file_sink-inl.h" #include "spdlog/sinks/rotating_file_sink-inl.h"
template class spdlog::sinks::rotating_file_sink<std::mutex>; template class spdlog::sinks::rotating_file_sink<std::mutex>;
template class spdlog::sinks::rotating_file_sink<spdlog::details::null_mutex>; template class spdlog::sinks::rotating_file_sink<spdlog::details::null_mutex>;
#include "spdlog/details/registry.h"
#include "spdlog/details/registry-inl.h" #include "spdlog/details/registry-inl.h"
#include "spdlog/details/os.h"
#include "spdlog/details/os-inl.h" #include "spdlog/details/os-inl.h"
#include "spdlog/details/periodic_worker.h"
#include "spdlog/details/periodic_worker-inl.h" #include "spdlog/details/periodic_worker-inl.h"
#include "spdlog/details/file_helper.h"
#include "spdlog/details/file_helper-inl.h" #include "spdlog/details/file_helper-inl.h"
#include "spdlog/details/pattern_formatter.h"
#include "spdlog/details/pattern_formatter-inl.h" #include "spdlog/details/pattern_formatter-inl.h"
#include "spdlog/details/thread_pool.h"
#include "spdlog/details/thread_pool-inl.h" #include "spdlog/details/thread_pool-inl.h"
template class spdlog::details::mpmc_blocking_queue<spdlog::details::async_msg>; template class spdlog::details::mpmc_blocking_queue<spdlog::details::async_msg>;
#ifdef _WIN32 #ifdef _WIN32
#include "spdlog/sinks/wincolor_sink.h"
#include "spdlog/sinks/wincolor_sink-inl.h" #include "spdlog/sinks/wincolor_sink-inl.h"
template class spdlog::sinks::wincolor_sink<spdlog::details::console_stdout, spdlog::details::console_mutex>; template class spdlog::sinks::wincolor_sink<spdlog::details::console_stdout, spdlog::details::console_mutex>;
template class spdlog::sinks::wincolor_sink<spdlog::details::console_stdout, spdlog::details::console_nullmutex>; template class spdlog::sinks::wincolor_sink<spdlog::details::console_stdout, spdlog::details::console_nullmutex>;
template class spdlog::sinks::wincolor_sink<spdlog::details::console_stderr, spdlog::details::console_mutex>; template class spdlog::sinks::wincolor_sink<spdlog::details::console_stderr, spdlog::details::console_mutex>;
template class spdlog::sinks::wincolor_sink<spdlog::details::console_stderr, spdlog::details::console_nullmutex>; template class spdlog::sinks::wincolor_sink<spdlog::details::console_stderr, spdlog::details::console_nullmutex>;
#else #else
#include "spdlog/sinks/ansicolor_sink.h"
#include "spdlog/sinks/ansicolor_sink-inl.h" #include "spdlog/sinks/ansicolor_sink-inl.h"
template class spdlog::sinks::ansicolor_sink<spdlog::details::console_stdout, spdlog::details::console_mutex>; template class spdlog::sinks::ansicolor_sink<spdlog::details::console_stdout, spdlog::details::console_mutex>;
template class spdlog::sinks::ansicolor_sink<spdlog::details::console_stdout, spdlog::details::console_nullmutex>; template class spdlog::sinks::ansicolor_sink<spdlog::details::console_stdout, spdlog::details::console_nullmutex>;
@ -81,7 +57,6 @@ template class spdlog::sinks::ansicolor_sink<spdlog::details::console_stderr, sp
template class spdlog::sinks::ansicolor_sink<spdlog::details::console_stderr, spdlog::details::console_nullmutex>; template class spdlog::sinks::ansicolor_sink<spdlog::details::console_stderr, spdlog::details::console_nullmutex>;
#endif #endif
#include "spdlog/sinks/stdout_color_sinks.h"
#include "spdlog/sinks/stdout_color_sinks-inl.h" #include "spdlog/sinks/stdout_color_sinks-inl.h"
template std::shared_ptr<spdlog::logger> spdlog::stdout_color_mt<spdlog::synchronous_factory>(const std::string &logger_name); template std::shared_ptr<spdlog::logger> spdlog::stdout_color_mt<spdlog::synchronous_factory>(const std::string &logger_name);
template std::shared_ptr<spdlog::logger> spdlog::stdout_color_st<spdlog::synchronous_factory>(const std::string &logger_name); template std::shared_ptr<spdlog::logger> spdlog::stdout_color_st<spdlog::synchronous_factory>(const std::string &logger_name);
@ -93,11 +68,6 @@ template std::shared_ptr<spdlog::logger> spdlog::stdout_color_st<spdlog::async_f
template std::shared_ptr<spdlog::logger> spdlog::stderr_color_mt<spdlog::async_factory>(const std::string &logger_name); template std::shared_ptr<spdlog::logger> spdlog::stderr_color_mt<spdlog::async_factory>(const std::string &logger_name);
template std::shared_ptr<spdlog::logger> spdlog::stderr_color_st<spdlog::async_factory>(const std::string &logger_name); template std::shared_ptr<spdlog::logger> spdlog::stderr_color_st<spdlog::async_factory>(const std::string &logger_name);
// fmt_helper templates
#include "spdlog/details/fmt_helper.h"
template void spdlog::details::fmt_helper::append_string_view(spdlog::string_view_t view, fmt::memory_buffer &dest);
template spdlog::string_view_t spdlog::details::fmt_helper::to_string_view(const fmt::memory_buffer &buf) SPDLOG_NOEXCEPT;
// Slightly modified version of fmt lib's format.cc source file. // Slightly modified version of fmt lib's format.cc source file.
// Copyright (c) 2012 - 2016, Victor Zverovich // Copyright (c) 2012 - 2016, Victor Zverovich
// All rights reserved. // All rights reserved.

View File

@ -1,5 +1,6 @@
#include "includes.h" #include "includes.h"
#include "spdlog/details/fmt_helper.h"
void test_pad2(int n, const char *expected) void test_pad2(int n, const char *expected)
{ {