diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ebb465e..775e236f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,7 +59,8 @@ message(STATUS "Static lib: " ${SPDLOG_STATIC_LIB}) if(SPDLOG_STATIC_LIB) add_definitions(-DSPDLOG_STATIC_LIB) - file(GLOB SRC_FILES ${HEADER_BASE}/impl/*.cpp) + set(SRC_BASE "${CMAKE_CURRENT_SOURCE_DIR}/src") + set(SRC_FILES "${SRC_BASE}/spdlog.cpp" "${SRC_BASE}/format.cc") add_library(spdlog STATIC ${SRC_FILES}) target_include_directories(spdlog PUBLIC "$") target_link_libraries(spdlog -Wl,--as-needed) diff --git a/include/spdlog/async_logger.h b/include/spdlog/async_logger.h index 6056ee07..71c628e5 100644 --- a/include/spdlog/async_logger.h +++ b/include/spdlog/async_logger.h @@ -5,17 +5,14 @@ #pragma once -// Very fast asynchronous logger (millions of logs per second on an average -// desktop) -// Uses pre allocated lockfree queue for maximum throughput even under large -// number of threads. +// Fast asynchronous logger. +// Uses pre allocated queue. // Creates a single back thread to pop messages from the queue and log them. // // Upon each log write the logger: // 1. Checks if its log level is enough to log the message // 2. Push a new copy of the message to a queue (or block the caller until // space is available in the queue) -// 3. will throw spdlog_ex upon log exceptions // Upon destruction, logs all remaining messages in the queue before // destructing.. diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index 17a70150..0c152e2d 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -341,5 +341,5 @@ protected: } // namespace spdlog #ifndef SPDLOG_STATIC_LIB -#include "logger-inl.h +#include "logger-inl.h" #endif diff --git a/src/spdlog.cpp b/src/spdlog.cpp index a09dd9a1..6b1cb5f4 100644 --- a/src/spdlog.cpp +++ b/src/spdlog.cpp @@ -1,4 +1,5 @@ -#include +#include "spdlog/spdlog.h" + #include "spdlog/details/null_mutex.h" #include "spdlog/logger.h" @@ -7,9 +8,6 @@ #include "spdlog/async_logger.h" #include "spdlog/async_logger-inl.h" -#include "spdlog/async_logger.h" -#include "spdlog/async_logger-inl.h" - #include "spdlog/details/log_msg.h" #include "spdlog/details/log_msg-inl.h" @@ -42,7 +40,6 @@ template class spdlog::details::mpmc_blocking_queue; #include "spdlog/sinks/ansicolor_sink.h" #include "spdlog/sinks/ansicolor_sink-inl.h" -// template instantiate stdout_mt, stdout_st, stderr_mt, stderr_st template class spdlog::sinks::ansicolor_sink; template class spdlog::sinks::ansicolor_sink; template class spdlog::sinks::ansicolor_sink;