mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-29 09:59:33 +08:00
Compare commits
39 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
eb3220622e | ||
![]() |
8f26e819ad | ||
![]() |
b6b1c2f95d | ||
![]() |
9ce9804a88 | ||
![]() |
ddaa61ca9a | ||
![]() |
4646bd082a | ||
![]() |
53aca9c3d0 | ||
![]() |
aa1e794213 | ||
![]() |
45e3b678b0 | ||
![]() |
bd99496423 | ||
![]() |
e471ec884e | ||
![]() |
b400705a1c | ||
![]() |
cb35191fc1 | ||
![]() |
1945a93b33 | ||
![]() |
dfd12e6dac | ||
![]() |
ba29e1d75d | ||
![]() |
8f6d123586 | ||
![]() |
d368ed586c | ||
![]() |
87095a9f1f | ||
![]() |
dd6d203488 | ||
![]() |
f463ebf54a | ||
![]() |
3547d7e24f | ||
![]() |
a9c01aba78 | ||
![]() |
f237947bdc | ||
![]() |
890df3d90b | ||
![]() |
14783585b6 | ||
![]() |
243c4beac7 | ||
![]() |
fe9cb54e0d | ||
![]() |
dabec32748 | ||
![]() |
6faa5fc95b | ||
![]() |
dbbec6cdb4 | ||
![]() |
43923cf038 | ||
![]() |
2ccba49b01 | ||
![]() |
362fdc6ceb | ||
![]() |
7bb53541e4 | ||
![]() |
c07b3aeef9 | ||
![]() |
fb47935a7b | ||
![]() |
ec3538c2ee | ||
![]() |
84e15d1ee2 |
14
.travis.yml
14
.travis.yml
@@ -30,6 +30,14 @@ addons: &gcc9
|
|||||||
sources:
|
sources:
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
|
# gcc 11.0
|
||||||
|
addons: &gcc11
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- g++-11
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
|
|
||||||
# Clang 3.5
|
# Clang 3.5
|
||||||
addons: &clang35
|
addons: &clang35
|
||||||
@@ -79,6 +87,12 @@ matrix:
|
|||||||
os: linux
|
os: linux
|
||||||
addons: *gcc9
|
addons: *gcc9
|
||||||
|
|
||||||
|
# Test gcc-11.0: C++20, Build=Debug
|
||||||
|
- env: GCC_VERSION=11 BUILD_TYPE=Debug CPP=20 ASAN=Off
|
||||||
|
os: linux
|
||||||
|
dist: bionic
|
||||||
|
addons: *gcc11
|
||||||
|
|
||||||
# Test clang-3.5: C++11, Build=Release
|
# Test clang-3.5: C++11, Build=Release
|
||||||
- env: CLANG_VERSION=3.5 BUILD_TYPE=Release CPP=11
|
- env: CLANG_VERSION=3.5 BUILD_TYPE=Release CPP=11
|
||||||
os: linux
|
os: linux
|
||||||
|
@@ -307,7 +307,8 @@ if(SPDLOG_INSTALL)
|
|||||||
install(EXPORT spdlog DESTINATION ${export_dest_dir} NAMESPACE spdlog:: FILE ${config_targets_file})
|
install(EXPORT spdlog DESTINATION ${export_dest_dir} NAMESPACE spdlog:: FILE ${config_targets_file})
|
||||||
|
|
||||||
include(CMakePackageConfigHelpers)
|
include(CMakePackageConfigHelpers)
|
||||||
configure_file("${project_config_in}" "${project_config_out}" @ONLY)
|
configure_package_config_file("${project_config_in}" "${project_config_out}"
|
||||||
|
INSTALL_DESTINATION ${export_dest_dir})
|
||||||
|
|
||||||
write_basic_package_version_file("${version_config_file}" COMPATIBILITY SameMajorVersion)
|
write_basic_package_version_file("${version_config_file}" COMPATIBILITY SameMajorVersion)
|
||||||
install(FILES "${project_config_out}" "${version_config_file}" DESTINATION "${export_dest_dir}")
|
install(FILES "${project_config_out}" "${version_config_file}" DESTINATION "${export_dest_dir}")
|
||||||
|
@@ -4,7 +4,7 @@ Very fast, header-only/compiled, C++ logging library. [ to your build tree and use a C++11 compiler.
|
Copy the include [folder](https://github.com/gabime/spdlog/tree/v1.x/include/spdlog) to your build tree and use a C++11 compiler.
|
||||||
|
|
||||||
#### Static lib version (recommended - much faster compile times)
|
#### Static lib version (recommended - much faster compile times)
|
||||||
```console
|
```console
|
||||||
@@ -144,7 +144,7 @@ void daily_example()
|
|||||||
#### Backtrace support
|
#### Backtrace support
|
||||||
```c++
|
```c++
|
||||||
// Debug messages can be stored in a ring buffer instead of being logged immediately.
|
// Debug messages can be stored in a ring buffer instead of being logged immediately.
|
||||||
// This is useful in order to display debug logs only when really nededed (e.g. when error happens).
|
// This is useful in order to display debug logs only when really needed (e.g. when error happens).
|
||||||
// When needed, call dump_backtrace() to see them.
|
// When needed, call dump_backtrace() to see them.
|
||||||
|
|
||||||
spdlog::enable_backtrace(32); // Store the latest 32 messages in a buffer. Older messages will be dropped.
|
spdlog::enable_backtrace(32); // Store the latest 32 messages in a buffer. Older messages will be dropped.
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
# Copyright(c) 2019 spdlog authors
|
# Copyright(c) 2019 spdlog authors
|
||||||
# Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
# Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
@PACKAGE_INIT@
|
||||||
|
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
|
|
||||||
set(SPDLOG_FMT_EXTERNAL @SPDLOG_FMT_EXTERNAL@)
|
set(SPDLOG_FMT_EXTERNAL @SPDLOG_FMT_EXTERNAL@)
|
||||||
@@ -13,3 +15,5 @@ endif()
|
|||||||
|
|
||||||
|
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/${config_targets_file}")
|
include("${CMAKE_CURRENT_LIST_DIR}/${config_targets_file}")
|
||||||
|
|
||||||
|
check_required_components(spdlog)
|
@@ -34,7 +34,7 @@ SPDLOG_INLINE spdlog::level::level_enum from_str(const std::string &name) SPDLOG
|
|||||||
{
|
{
|
||||||
auto it = std::find(std::begin(level_string_views), std::end(level_string_views), name);
|
auto it = std::find(std::begin(level_string_views), std::end(level_string_views), name);
|
||||||
if (it != std::end(level_string_views))
|
if (it != std::end(level_string_views))
|
||||||
return static_cast<level::level_enum>(std::distance(std::begin(level_string_views), it));
|
return static_cast<level::level_enum>(it - std::begin(level_string_views));
|
||||||
|
|
||||||
// check also for "warn" and "err" before giving up..
|
// check also for "warn" and "err" before giving up..
|
||||||
if (name == "warn")
|
if (name == "warn")
|
||||||
|
@@ -116,29 +116,26 @@ using wstring_view_t = fmt::basic_string_view<wchar_t>;
|
|||||||
using memory_buf_t = fmt::basic_memory_buffer<char, 250>;
|
using memory_buf_t = fmt::basic_memory_buffer<char, 250>;
|
||||||
using wmemory_buf_t = fmt::basic_memory_buffer<wchar_t, 250>;
|
using wmemory_buf_t = fmt::basic_memory_buffer<wchar_t, 250>;
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
using remove_cvref_t = typename std::remove_cv<typename std::remove_reference<T>::type>::type;
|
||||||
|
|
||||||
|
// clang doesn't like SFINAE disabled constructor in std::is_convertible<> so have to repeat the condition from basic_format_string here,
|
||||||
|
// in addition, fmt::basic_runtime<Char> is only convertible to basic_format_string<Char> but not basic_string_view<Char>
|
||||||
|
template<class T, class Char = char>
|
||||||
|
struct is_convertible_to_basic_format_string
|
||||||
|
: std::integral_constant<bool,
|
||||||
|
std::is_convertible<T, fmt::basic_string_view<Char>>::value || std::is_same<remove_cvref_t<T>, fmt::basic_runtime<Char>>::value>
|
||||||
|
{};
|
||||||
|
|
||||||
#ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT
|
#ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT
|
||||||
# ifndef _WIN32
|
# ifndef _WIN32
|
||||||
# error SPDLOG_WCHAR_TO_UTF8_SUPPORT only supported on windows
|
# error SPDLOG_WCHAR_TO_UTF8_SUPPORT only supported on windows
|
||||||
# else
|
|
||||||
template<typename T>
|
|
||||||
struct is_convertible_to_wstring_view : std::is_convertible<T, wstring_view_t>
|
|
||||||
{};
|
|
||||||
template<class T>
|
|
||||||
struct is_convertible_to_wformat_string : std::is_convertible<T, fmt::wformat_string<>>
|
|
||||||
{};
|
|
||||||
# endif // _WIN32
|
# endif // _WIN32
|
||||||
#else
|
|
||||||
template<typename>
|
|
||||||
struct is_convertible_to_wstring_view : std::false_type
|
|
||||||
{};
|
|
||||||
template<class>
|
|
||||||
struct is_convertible_to_wformat_string : std::false_type
|
|
||||||
{};
|
|
||||||
#endif // SPDLOG_WCHAR_TO_UTF8_SUPPORT
|
#endif // SPDLOG_WCHAR_TO_UTF8_SUPPORT
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
struct is_convertible_to_basic_format_string
|
struct is_convertible_to_any_format_string : std::integral_constant<bool, is_convertible_to_basic_format_string<T, char>::value ||
|
||||||
: std::integral_constant<bool, std::is_convertible<const T &, fmt::format_string<>>::value || is_convertible_to_wformat_string<T>::value>
|
is_convertible_to_basic_format_string<T, wchar_t>::value>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
#if defined(SPDLOG_NO_ATOMIC_LEVELS)
|
#if defined(SPDLOG_NO_ATOMIC_LEVELS)
|
||||||
@@ -173,13 +170,13 @@ enum level_enum
|
|||||||
n_levels
|
n_levels
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SPDLOG_LEVEL_NAME_TRACE string_view_t("trace", 5)
|
#define SPDLOG_LEVEL_NAME_TRACE spdlog::string_view_t("trace", 5)
|
||||||
#define SPDLOG_LEVEL_NAME_DEBUG string_view_t("debug", 5)
|
#define SPDLOG_LEVEL_NAME_DEBUG spdlog::string_view_t("debug", 5)
|
||||||
#define SPDLOG_LEVEL_NAME_INFO string_view_t("info", 4)
|
#define SPDLOG_LEVEL_NAME_INFO spdlog::string_view_t("info", 4)
|
||||||
#define SPDLOG_LEVEL_NAME_WARNING string_view_t("warning", 7)
|
#define SPDLOG_LEVEL_NAME_WARNING spdlog::string_view_t("warning", 7)
|
||||||
#define SPDLOG_LEVEL_NAME_ERROR string_view_t("error", 5)
|
#define SPDLOG_LEVEL_NAME_ERROR spdlog::string_view_t("error", 5)
|
||||||
#define SPDLOG_LEVEL_NAME_CRITICAL string_view_t("critical", 8)
|
#define SPDLOG_LEVEL_NAME_CRITICAL spdlog::string_view_t("critical", 8)
|
||||||
#define SPDLOG_LEVEL_NAME_OFF string_view_t("off", 3)
|
#define SPDLOG_LEVEL_NAME_OFF spdlog::string_view_t("off", 3)
|
||||||
|
|
||||||
#if !defined(SPDLOG_LEVEL_NAMES)
|
#if !defined(SPDLOG_LEVEL_NAMES)
|
||||||
# define SPDLOG_LEVEL_NAMES \
|
# define SPDLOG_LEVEL_NAMES \
|
||||||
|
@@ -27,7 +27,6 @@ enum class async_msg_type
|
|||||||
terminate
|
terminate
|
||||||
};
|
};
|
||||||
|
|
||||||
#include <spdlog/details/log_msg_buffer.h>
|
|
||||||
// Async msg to move to/from the queue
|
// Async msg to move to/from the queue
|
||||||
// Movable only. should never be copied
|
// Movable only. should never be copied
|
||||||
struct async_msg : log_msg_buffer
|
struct async_msg : log_msg_buffer
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
|
#include <spdlog/common.h>
|
||||||
|
|
||||||
//
|
//
|
||||||
// Support for logging binary data as hex
|
// Support for logging binary data as hex
|
||||||
|
@@ -102,10 +102,8 @@ public:
|
|||||||
log(loc, lvl, string_view_t{msg});
|
log(loc, lvl, string_view_t{msg});
|
||||||
}
|
}
|
||||||
|
|
||||||
// T cannot be statically converted to neither string_view, nor wstring_view and nor format string
|
// T cannot be statically converted to format string (including string_view)
|
||||||
template<class T, typename std::enable_if<!std::is_convertible<const T &, spdlog::string_view_t>::value &&
|
template<class T, typename std::enable_if<!is_convertible_to_any_format_string<const T &>::value, int>::type = 0>
|
||||||
!is_convertible_to_basic_format_string<const T &>::value,
|
|
||||||
int>::type = 0>
|
|
||||||
void log(source_loc loc, level::level_enum lvl, const T &msg)
|
void log(source_loc loc, level::level_enum lvl, const T &msg)
|
||||||
{
|
{
|
||||||
log(loc, lvl, "{}", msg);
|
log(loc, lvl, "{}", msg);
|
||||||
|
@@ -33,7 +33,7 @@ public:
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
client_ = std::make_unique<mongocxx::client>(mongocxx::uri{uri});
|
client_ = spdlog::details::make_unique<mongocxx::client>(mongocxx::uri{uri});
|
||||||
db_name_ = db_name;
|
db_name_ = db_name;
|
||||||
coll_name_ = collection_name;
|
coll_name_ = collection_name;
|
||||||
}
|
}
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
//
|
//
|
||||||
// Custom sink for QPlainTextEdit or QTextEdit and its children(QTextBrowser...
|
// Custom sink for QPlainTextEdit or QTextEdit and its childs(QTextBrowser...
|
||||||
// etc) Building and using requires Qt library.
|
// etc) Building and using requires Qt library.
|
||||||
//
|
//
|
||||||
|
|
||||||
@@ -13,188 +13,81 @@
|
|||||||
#include "spdlog/details/synchronous_factory.h"
|
#include "spdlog/details/synchronous_factory.h"
|
||||||
#include "spdlog/sinks/base_sink.h"
|
#include "spdlog/sinks/base_sink.h"
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
#include <QPlainTextEdit>
|
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
|
#include <QPlainTextEdit>
|
||||||
namespace _spdlog_p {
|
|
||||||
namespace _sinks_p {
|
|
||||||
//
|
|
||||||
// Private class for QTextEdit and its derivatives
|
|
||||||
//
|
|
||||||
class qtextedit_sink_p : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
qtextedit_sink_p(QTextEdit *textedit = nullptr)
|
|
||||||
{
|
|
||||||
if (textedit != nullptr)
|
|
||||||
{
|
|
||||||
textedit_ = textedit;
|
|
||||||
connect(this, &qtextedit_sink_p::append_text, textedit_, &QTextEdit::append);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
~qtextedit_sink_p() {}
|
|
||||||
|
|
||||||
void append(const spdlog::string_view_t &str)
|
|
||||||
{
|
|
||||||
emit append_text(QString::fromUtf8(str.data(), static_cast<int>(str.size() - 2)));
|
|
||||||
}
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void append_text(const QString &);
|
|
||||||
|
|
||||||
private:
|
|
||||||
QTextEdit *textedit_ = nullptr;
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Private class for QPlainTextEdit
|
// qt_sink class
|
||||||
//
|
|
||||||
class qplaintextedit_sink_p : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
qplaintextedit_sink_p(QPlainTextEdit *textedit = nullptr)
|
|
||||||
{
|
|
||||||
if (textedit != nullptr)
|
|
||||||
{
|
|
||||||
textedit_ = textedit;
|
|
||||||
connect(this, &qplaintextedit_sink_p::append_text, textedit_, &QPlainTextEdit::appendPlainText);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
~qplaintextedit_sink_p() {}
|
|
||||||
|
|
||||||
void append(const spdlog::string_view_t &str)
|
|
||||||
{
|
|
||||||
emit append_text(QString::fromUtf8(str.data(), static_cast<int>(str.size() - 2)));
|
|
||||||
}
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void append_text(const QString &);
|
|
||||||
|
|
||||||
private:
|
|
||||||
QPlainTextEdit *textedit_ = nullptr;
|
|
||||||
};
|
|
||||||
} // namespace _sinks_p
|
|
||||||
} // namespace _spdlog_p
|
|
||||||
|
|
||||||
//
|
|
||||||
// qtextedit_sink class
|
|
||||||
//
|
//
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace sinks {
|
namespace sinks {
|
||||||
template<typename Mutex>
|
template <typename Mutex> class qt_sink : public base_sink<Mutex> {
|
||||||
class qtextedit_sink : public base_sink<Mutex>
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
qtextedit_sink(QTextEdit *textedit = nullptr)
|
qt_sink(QObject *qt_object = nullptr, const std::string &meta_method = "") {
|
||||||
{
|
qt_object_ = qt_object;
|
||||||
if (textedit != nullptr)
|
meta_method_ = meta_method;
|
||||||
{
|
|
||||||
textedit_p = std::make_shared<_spdlog_p::_sinks_p::qtextedit_sink_p>(textedit);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw spdlog_ex("Error opening QTextEdit");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~qtextedit_sink()
|
~qt_sink() { flush_(); }
|
||||||
{
|
|
||||||
flush_();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void sink_it_(const details::log_msg &msg) override
|
void sink_it_(const details::log_msg &msg) override {
|
||||||
{
|
|
||||||
memory_buf_t formatted;
|
memory_buf_t formatted;
|
||||||
base_sink<Mutex>::formatter_->format(msg, formatted);
|
base_sink<Mutex>::formatter_->format(msg, formatted);
|
||||||
string_view_t str_v = string_view_t(formatted.data(), formatted.size());
|
string_view_t str = string_view_t(formatted.data(), formatted.size());
|
||||||
textedit_p->append(str_v);
|
QMetaObject::invokeMethod(qt_object_, meta_method_.c_str(), Qt::AutoConnection,
|
||||||
|
Q_ARG(QString, QString::fromUtf8(str.data(), static_cast<int>(str.size())).trimmed()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void flush_() override {}
|
void flush_() override {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<_spdlog_p::_sinks_p::qtextedit_sink_p> textedit_p = nullptr;
|
QObject *qt_object_ = nullptr;
|
||||||
};
|
std::string meta_method_;
|
||||||
|
|
||||||
//
|
|
||||||
// qplaintextedit_sink class
|
|
||||||
//
|
|
||||||
template<typename Mutex>
|
|
||||||
class qplaintextedit_sink : public base_sink<Mutex>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
qplaintextedit_sink(QPlainTextEdit *textedit = nullptr)
|
|
||||||
{
|
|
||||||
if (textedit != nullptr)
|
|
||||||
{
|
|
||||||
textedit_p = std::make_shared<_spdlog_p::_sinks_p::qplaintextedit_sink_p>(textedit);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw spdlog_ex("Error opening QPlainTextEdit");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
~qplaintextedit_sink()
|
|
||||||
{
|
|
||||||
flush_();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void sink_it_(const details::log_msg &msg) override
|
|
||||||
{
|
|
||||||
memory_buf_t formatted;
|
|
||||||
base_sink<Mutex>::formatter_->format(msg, formatted);
|
|
||||||
string_view_t str_v = string_view_t(formatted.data(), formatted.size());
|
|
||||||
textedit_p->append(str_v);
|
|
||||||
}
|
|
||||||
|
|
||||||
void flush_() override {}
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::shared_ptr<_spdlog_p::_sinks_p::qplaintextedit_sink_p> textedit_p = nullptr;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#include "spdlog/details/null_mutex.h"
|
#include "spdlog/details/null_mutex.h"
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
using qtextedit_sink_mt = qtextedit_sink<std::mutex>;
|
using qt_sink_mt = qt_sink<std::mutex>;
|
||||||
using qtextedit_sink_st = qtextedit_sink<spdlog::details::null_mutex>;
|
using qt_sink_st = qt_sink<spdlog::details::null_mutex>;
|
||||||
|
|
||||||
using qplaintextedit_sink_mt = qplaintextedit_sink<std::mutex>;
|
|
||||||
using qplaintextedit_sink_st = qplaintextedit_sink<spdlog::details::null_mutex>;
|
|
||||||
|
|
||||||
} // namespace sinks
|
} // namespace sinks
|
||||||
|
|
||||||
//
|
//
|
||||||
// Factory functions
|
// Factory functions
|
||||||
//
|
//
|
||||||
template <typename Factory = spdlog::synchronous_factory>
|
template <typename Factory = spdlog::synchronous_factory>
|
||||||
inline std::shared_ptr<logger> qtextedit_logger_mt(const std::string &logger_name, QTextEdit *qtextedit = nullptr)
|
inline std::shared_ptr<logger>
|
||||||
{
|
qt_logger_mt(const std::string &logger_name, QTextEdit* qt_object, const std::string &meta_method = "append") {
|
||||||
return Factory::template create<sinks::qtextedit_sink_mt>(logger_name, qtextedit);
|
return Factory::template create<sinks::qt_sink_mt>(logger_name, qt_object, meta_method);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Factory = spdlog::synchronous_factory>
|
template <typename Factory = spdlog::synchronous_factory>
|
||||||
inline std::shared_ptr<logger> qtextedit_logger_st(const std::string &logger_name, QTextEdit *qtextedit = nullptr)
|
inline std::shared_ptr<logger>
|
||||||
{
|
qt_logger_st(const std::string &logger_name, QTextEdit* qt_object, const std::string &meta_method = "append") {
|
||||||
return Factory::template create<sinks::qtextedit_sink_st>(logger_name, qtextedit);
|
return Factory::template create<sinks::qt_sink_st>(logger_name, qt_object, meta_method);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Factory = spdlog::synchronous_factory>
|
template <typename Factory = spdlog::synchronous_factory>
|
||||||
inline std::shared_ptr<logger> qplaintextedit_logger_mt(const std::string &logger_name, QPlainTextEdit *qplaintextedit = nullptr)
|
inline std::shared_ptr<logger>
|
||||||
{
|
qt_logger_mt(const std::string &logger_name, QPlainTextEdit* qt_object , const std::string &meta_method = "appendPlainText") {
|
||||||
return Factory::template create<sinks::qplaintextedit_sink_mt>(logger_name, qplaintextedit);
|
return Factory::template create<sinks::qt_sink_mt>(logger_name, qt_object, meta_method);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Factory = spdlog::synchronous_factory>
|
template <typename Factory = spdlog::synchronous_factory>
|
||||||
inline std::shared_ptr<logger> qplaintextedit_logger_st(const std::string &logger_name, QPlainTextEdit *qplaintextedit = nullptr)
|
inline std::shared_ptr<logger>
|
||||||
{
|
qt_logger_st(const std::string &logger_name, QPlainTextEdit* qt_object, const std::string &meta_method = "appendPlainText") {
|
||||||
return Factory::template create<sinks::qplaintextedit_sink_st>(logger_name, qplaintextedit);
|
return Factory::template create<sinks::qt_sink_st>(logger_name, qt_object, meta_method);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Factory = spdlog::synchronous_factory>
|
||||||
|
inline std::shared_ptr<logger>
|
||||||
|
qt_logger_mt(const std::string &logger_name, QObject* qt_object, const std::string &meta_method) {
|
||||||
|
return Factory::template create<sinks::qt_sink_mt>(logger_name, qt_object, meta_method);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Factory = spdlog::synchronous_factory>
|
||||||
|
inline std::shared_ptr<logger>
|
||||||
|
qt_logger_st(const std::string &logger_name, QObject* qt_object, const std::string &meta_method) {
|
||||||
|
return Factory::template create<sinks::qt_sink_st>(logger_name, qt_object, meta_method);
|
||||||
}
|
}
|
||||||
} // namespace spdlog
|
} // namespace spdlog
|
||||||
|
@@ -5,6 +5,6 @@
|
|||||||
|
|
||||||
#define SPDLOG_VER_MAJOR 1
|
#define SPDLOG_VER_MAJOR 1
|
||||||
#define SPDLOG_VER_MINOR 9
|
#define SPDLOG_VER_MINOR 9
|
||||||
#define SPDLOG_VER_PATCH 0
|
#define SPDLOG_VER_PATCH 2
|
||||||
|
|
||||||
#define SPDLOG_VERSION (SPDLOG_VER_MAJOR * 10000 + SPDLOG_VER_MINOR * 100 + SPDLOG_VER_PATCH)
|
#define SPDLOG_VERSION (SPDLOG_VER_MAJOR * 10000 + SPDLOG_VER_MINOR * 100 + SPDLOG_VER_PATCH)
|
||||||
|
Reference in New Issue
Block a user