Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gabime/spdlog.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgabime <gmelman1@gmail.com>2019-05-11 13:52:46 +0300
committergabime <gmelman1@gmail.com>2019-05-11 13:52:46 +0300
commit005450ff13b268ab5e78a15dfd5d0b342327e91a (patch)
treeec910cdf0ff95f5d95493f04518c497c8dc2c08a
parentf809427575aa0acb63853904a6679f693d17300c (diff)
wip
-rw-r--r--CMakeLists.txt3
-rw-r--r--include/spdlog/async_logger.h7
-rw-r--r--include/spdlog/logger.h2
-rw-r--r--src/spdlog.cpp7
4 files changed, 7 insertions, 12 deletions
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 "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>")
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 <mutex>
+#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<spdlog::details::async_msg>;
#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<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_stderr, spdlog::details::console_mutex>;