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
#ifndef SPDLOG_HEADER_ONLY
#include "spdlog/async_logger.h"
#endif
#include "spdlog/sinks/sink.h"
#include "spdlog/details/thread_pool.h"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,72 +8,48 @@
#include <mutex>
#include <chrono>
#include "spdlog/spdlog.h"
#include "spdlog/spdlog-inl.h"
#include "spdlog/details/null_mutex.h"
#include "spdlog/async.h"
#include "spdlog/common.h"
#include "spdlog/spdlog-inl.h"
#include "spdlog/common-inl.h"
#include "spdlog/details/null_mutex.h"
#include "spdlog/logger.h"
#include "spdlog/logger-inl.h"
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/details/log_msg.h"
#include "spdlog/details/log_msg-inl.h"
#include "spdlog/sinks/sink.h"
#include "spdlog/sinks/sink-inl.h"
#include "spdlog/sinks/base_sink.h"
#include "spdlog/sinks/base_sink-inl.h"
template class spdlog::sinks::base_sink<std::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"
template class spdlog::sinks::basic_file_sink<std::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"
template class spdlog::sinks::rotating_file_sink<std::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/os.h"
#include "spdlog/details/os-inl.h"
#include "spdlog/details/periodic_worker.h"
#include "spdlog/details/periodic_worker-inl.h"
#include "spdlog/details/file_helper.h"
#include "spdlog/details/file_helper-inl.h"
#include "spdlog/details/pattern_formatter.h"
#include "spdlog/details/pattern_formatter-inl.h"
#include "spdlog/details/thread_pool.h"
#include "spdlog/details/thread_pool-inl.h"
template class spdlog::details::mpmc_blocking_queue<spdlog::details::async_msg>;
#ifdef _WIN32
#include "spdlog/sinks/wincolor_sink.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_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_nullmutex>;
#else
#include "spdlog/sinks/ansicolor_sink.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_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>;
#endif
#include "spdlog/sinks/stdout_color_sinks.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_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_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.
// Copyright (c) 2012 - 2016, Victor Zverovich
// All rights reserved.

View File

@ -20,4 +20,4 @@
#include "spdlog/sinks/ostream_sink.h"
#include "spdlog/sinks/rotating_file_sink.h"
#include "spdlog/sinks/stdout_color_sinks.h"
#include "spdlog/details/pattern_formatter.h"
#include "spdlog/details/pattern_formatter.h"

View File

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