mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 08:25:43 +08:00
Clang format sort includes
This commit is contained in:
parent
a0e631802c
commit
463af69d41
@ -14,6 +14,6 @@ AlwaysBreakTemplateDeclarations: Yes
|
|||||||
PackConstructorInitializers: Never
|
PackConstructorInitializers: Never
|
||||||
BreakConstructorInitializersBeforeComma: false
|
BreakConstructorInitializersBeforeComma: false
|
||||||
IndentPPDirectives: BeforeHash
|
IndentPPDirectives: BeforeHash
|
||||||
SortIncludes: Never
|
SortIncludes: CaseInsensitive
|
||||||
...
|
...
|
||||||
|
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
//
|
//
|
||||||
// bench.cpp : spdlog benchmarks
|
// bench.cpp : spdlog benchmarks
|
||||||
//
|
//
|
||||||
#include "spdlog/spdlog.h"
|
|
||||||
#include "spdlog/async.h"
|
#include "spdlog/async.h"
|
||||||
#include "spdlog/sinks/basic_file_sink.h"
|
#include "spdlog/sinks/basic_file_sink.h"
|
||||||
|
#include "spdlog/spdlog.h"
|
||||||
|
|
||||||
#if defined(SPDLOG_USE_STD_FORMAT)
|
#if defined(SPDLOG_USE_STD_FORMAT)
|
||||||
#include <format>
|
#include <format>
|
||||||
@ -18,13 +18,14 @@
|
|||||||
#include "spdlog/fmt/bundled/format.h"
|
#include "spdlog/fmt/bundled/format.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "utils.h"
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
using namespace spdlog;
|
using namespace spdlog;
|
||||||
|
@ -6,11 +6,11 @@
|
|||||||
//
|
//
|
||||||
// bench.cpp : spdlog benchmarks
|
// bench.cpp : spdlog benchmarks
|
||||||
//
|
//
|
||||||
#include "spdlog/spdlog.h"
|
|
||||||
#include "spdlog/sinks/basic_file_sink.h"
|
#include "spdlog/sinks/basic_file_sink.h"
|
||||||
#include "spdlog/sinks/daily_file_sink.h"
|
#include "spdlog/sinks/daily_file_sink.h"
|
||||||
#include "spdlog/sinks/null_sink.h"
|
#include "spdlog/sinks/null_sink.h"
|
||||||
#include "spdlog/sinks/rotating_file_sink.h"
|
#include "spdlog/sinks/rotating_file_sink.h"
|
||||||
|
#include "spdlog/spdlog.h"
|
||||||
|
|
||||||
#if defined(SPDLOG_USE_STD_FORMAT)
|
#if defined(SPDLOG_USE_STD_FORMAT)
|
||||||
#include <format>
|
#include <format>
|
||||||
@ -20,13 +20,14 @@
|
|||||||
#include "spdlog/fmt/bundled/format.h"
|
#include "spdlog/fmt/bundled/format.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "utils.h"
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <cstdlib> // EXIT_FAILURE
|
#include <cstdlib> // EXIT_FAILURE
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
void bench(int howmany, std::shared_ptr<spdlog::logger> log);
|
void bench(int howmany, std::shared_ptr<spdlog::logger> log);
|
||||||
void bench_mt(int howmany, std::shared_ptr<spdlog::logger> log, size_t thread_count);
|
void bench_mt(int howmany, std::shared_ptr<spdlog::logger> log, size_t thread_count);
|
||||||
|
|
||||||
|
@ -4,9 +4,8 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include "benchmark/benchmark.h"
|
#include "benchmark/benchmark.h"
|
||||||
|
|
||||||
#include "spdlog/spdlog.h"
|
|
||||||
#include "spdlog/pattern_formatter.h"
|
#include "spdlog/pattern_formatter.h"
|
||||||
|
#include "spdlog/spdlog.h"
|
||||||
|
|
||||||
void bench_formatter(benchmark::State &state, std::string pattern) {
|
void bench_formatter(benchmark::State &state, std::string pattern) {
|
||||||
auto formatter = std::make_unique<spdlog::pattern_formatter>(pattern);
|
auto formatter = std::make_unique<spdlog::pattern_formatter>(pattern);
|
||||||
|
@ -8,13 +8,12 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include "benchmark/benchmark.h"
|
#include "benchmark/benchmark.h"
|
||||||
|
|
||||||
#include "spdlog/spdlog.h"
|
|
||||||
#include "spdlog/async.h"
|
#include "spdlog/async.h"
|
||||||
#include "spdlog/sinks/basic_file_sink.h"
|
#include "spdlog/sinks/basic_file_sink.h"
|
||||||
#include "spdlog/sinks/daily_file_sink.h"
|
#include "spdlog/sinks/daily_file_sink.h"
|
||||||
#include "spdlog/sinks/null_sink.h"
|
#include "spdlog/sinks/null_sink.h"
|
||||||
#include "spdlog/sinks/rotating_file_sink.h"
|
#include "spdlog/sinks/rotating_file_sink.h"
|
||||||
|
#include "spdlog/spdlog.h"
|
||||||
|
|
||||||
void bench_c_string(benchmark::State &state, std::shared_ptr<spdlog::logger> logger) {
|
void bench_c_string(benchmark::State &state, std::shared_ptr<spdlog::logger> logger) {
|
||||||
const char *msg =
|
const char *msg =
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
// spdlog usage example
|
// spdlog usage example
|
||||||
|
|
||||||
#include <cstdio>
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
void load_levels_example();
|
void load_levels_example();
|
||||||
void stdout_logger_example();
|
void stdout_logger_example();
|
||||||
@ -31,8 +31,8 @@ void replace_default_logger_example();
|
|||||||
// This will add filename/line/column info to the log (and in to the resulting binary so take care).
|
// This will add filename/line/column info to the log (and in to the resulting binary so take care).
|
||||||
// #define SPDLOG_SOURCE_LOCATION
|
// #define SPDLOG_SOURCE_LOCATION
|
||||||
|
|
||||||
#include "spdlog/spdlog.h"
|
|
||||||
#include "spdlog/cfg/env.h" // support for loading levels from the environment variable
|
#include "spdlog/cfg/env.h" // support for loading levels from the environment variable
|
||||||
|
#include "spdlog/spdlog.h"
|
||||||
|
|
||||||
int main(int, char *[]) {
|
int main(int, char *[]) {
|
||||||
// Log levels can be loaded from argv/env using "SPDLOG_LEVEL"
|
// Log levels can be loaded from argv/env using "SPDLOG_LEVEL"
|
||||||
@ -220,8 +220,9 @@ void trace_example() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// stopwatch example
|
// stopwatch example
|
||||||
#include "spdlog/stopwatch.h"
|
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
|
#include "spdlog/stopwatch.h"
|
||||||
void stopwatch_example() {
|
void stopwatch_example() {
|
||||||
spdlog::stopwatch sw;
|
spdlog::stopwatch sw;
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(123));
|
std::this_thread::sleep_for(std::chrono::milliseconds(123));
|
||||||
|
@ -14,14 +14,14 @@
|
|||||||
// This is because each message in the queue holds a shared_ptr to the
|
// This is because each message in the queue holds a shared_ptr to the
|
||||||
// originating logger.
|
// originating logger.
|
||||||
|
|
||||||
#include "async_logger.h"
|
|
||||||
#include "details/registry.h"
|
|
||||||
#include "details/thread_pool.h"
|
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
|
#include "async_logger.h"
|
||||||
|
#include "details/registry.h"
|
||||||
|
#include "details/thread_pool.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
|
||||||
namespace details {
|
namespace details {
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "helpers.h"
|
|
||||||
#include "../details/registry.h"
|
#include "../details/registry.h"
|
||||||
|
#include "helpers.h"
|
||||||
|
|
||||||
//
|
//
|
||||||
// Init log levels using each argv entry that starts with "SPDLOG_LEVEL="
|
// Init log levels using each argv entry that starts with "SPDLOG_LEVEL="
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "helpers.h"
|
|
||||||
#include "../details/os.h"
|
#include "../details/os.h"
|
||||||
#include "../details/registry.h"
|
#include "../details/registry.h"
|
||||||
|
#include "helpers.h"
|
||||||
|
|
||||||
//
|
//
|
||||||
// Init levels and patterns from env variables SPDLOG_LEVEL
|
// Init levels and patterns from env variables SPDLOG_LEVEL
|
||||||
|
@ -3,9 +3,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../common.h"
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
|
#include "../common.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace cfg {
|
namespace cfg {
|
||||||
namespace helpers {
|
namespace helpers {
|
||||||
|
@ -2,9 +2,6 @@
|
|||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "details/null_mutex.h"
|
|
||||||
#include "tweakme.h"
|
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
@ -17,6 +14,9 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
|
#include "details/null_mutex.h"
|
||||||
|
#include "tweakme.h"
|
||||||
|
|
||||||
#if __has_include(<version>)
|
#if __has_include(<version>)
|
||||||
#include <version>
|
#include <version>
|
||||||
#endif
|
#endif
|
||||||
|
@ -3,9 +3,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "null_mutex.h"
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
|
#include "null_mutex.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace details {
|
namespace details {
|
||||||
|
|
||||||
|
@ -3,9 +3,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../common.h"
|
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
|
||||||
|
#include "../common.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace details {
|
namespace details {
|
||||||
|
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../common.h"
|
|
||||||
#include "../fmt/fmt.h"
|
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
|
#include "../common.h"
|
||||||
|
#include "../fmt/fmt.h"
|
||||||
|
|
||||||
#ifdef SPDLOG_USE_STD_FORMAT
|
#ifdef SPDLOG_USE_STD_FORMAT
|
||||||
#include <charconv>
|
#include <charconv>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
@ -3,9 +3,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../common.h"
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include "../common.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace details {
|
namespace details {
|
||||||
struct SPDLOG_API log_msg {
|
struct SPDLOG_API log_msg {
|
||||||
|
@ -10,12 +10,12 @@
|
|||||||
// dequeue_for(..) - will block until the queue is not empty or timeout have
|
// dequeue_for(..) - will block until the queue is not empty or timeout have
|
||||||
// passed.
|
// passed.
|
||||||
|
|
||||||
#include "circular_q.h"
|
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
|
#include "circular_q.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace details {
|
namespace details {
|
||||||
|
|
||||||
|
@ -3,9 +3,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../common.h"
|
|
||||||
#include <ctime> // std::time_t
|
#include <ctime> // std::time_t
|
||||||
|
|
||||||
|
#include "../common.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace details {
|
namespace details {
|
||||||
namespace os {
|
namespace os {
|
||||||
|
@ -10,14 +10,14 @@
|
|||||||
// stops and joins the thread on destruction (if the thread is executing a callback, wait for it
|
// stops and joins the thread on destruction (if the thread is executing a callback, wait for it
|
||||||
// to finish first).
|
// to finish first).
|
||||||
|
|
||||||
#include "../common.h"
|
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
|
#include "../common.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace details {
|
namespace details {
|
||||||
|
|
||||||
|
@ -8,9 +8,6 @@
|
|||||||
// If user requests a non existing logger, nullptr will be returned
|
// If user requests a non existing logger, nullptr will be returned
|
||||||
// This class is thread safe
|
// This class is thread safe
|
||||||
|
|
||||||
#include "../common.h"
|
|
||||||
#include "periodic_worker.h"
|
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -18,6 +15,9 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
|
#include "../common.h"
|
||||||
|
#include "periodic_worker.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
class logger;
|
class logger;
|
||||||
|
|
||||||
|
@ -5,16 +5,17 @@
|
|||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
// tcp client helper
|
// tcp client helper
|
||||||
#include "../common.h"
|
|
||||||
#include "os.h"
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string>
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <ws2tcpip.h>
|
#include <ws2tcpip.h>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "../common.h"
|
||||||
|
#include "os.h"
|
||||||
|
|
||||||
#pragma comment(lib, "Ws2_32.lib")
|
#pragma comment(lib, "Ws2_32.lib")
|
||||||
#pragma comment(lib, "Mswsock.lib")
|
#pragma comment(lib, "Mswsock.lib")
|
||||||
#pragma comment(lib, "AdvApi32.lib")
|
#pragma comment(lib, "AdvApi32.lib")
|
||||||
|
@ -8,9 +8,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// tcp client helper
|
// tcp client helper
|
||||||
#include "../common.h"
|
|
||||||
#include "os.h"
|
|
||||||
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
@ -20,6 +17,9 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include "../common.h"
|
||||||
|
#include "os.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace details {
|
namespace details {
|
||||||
class tcp_client {
|
class tcp_client {
|
||||||
|
@ -3,17 +3,17 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../async.h"
|
|
||||||
#include "log_msg_buffer.h"
|
|
||||||
#include "mpmc_blocking_q.h"
|
|
||||||
#include "os.h"
|
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "../async.h"
|
||||||
|
#include "log_msg_buffer.h"
|
||||||
|
#include "mpmc_blocking_q.h"
|
||||||
|
#include "os.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
class async_logger;
|
class async_logger;
|
||||||
|
|
||||||
|
@ -6,16 +6,17 @@
|
|||||||
// Helper RAII over winsock udp client socket.
|
// Helper RAII over winsock udp client socket.
|
||||||
// Will throw on construction if socket creation failed.
|
// Will throw on construction if socket creation failed.
|
||||||
|
|
||||||
#include "os.h"
|
|
||||||
#include "windows_include.h"
|
|
||||||
#include "../common.h"
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string>
|
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <ws2tcpip.h>
|
#include <ws2tcpip.h>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "../common.h"
|
||||||
|
#include "os.h"
|
||||||
|
#include "windows_include.h"
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
#pragma comment(lib, "Ws2_32.lib")
|
#pragma comment(lib, "Ws2_32.lib")
|
||||||
#pragma comment(lib, "Mswsock.lib")
|
#pragma comment(lib, "Mswsock.lib")
|
||||||
|
@ -9,18 +9,18 @@
|
|||||||
#include "../common.h"
|
#include "../common.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#error "include udp_client-windows.h instead"
|
#error "include udp_client-windows.h instead"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <cstring>
|
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <netinet/udp.h>
|
#include <netinet/udp.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
|
|
||||||
#include "../common.h"
|
#include "../common.h"
|
||||||
|
|
||||||
#if defined(__has_include)
|
#if defined(__has_include)
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
#if !defined(SPDLOG_USE_STD_FORMAT)
|
#if !defined(SPDLOG_USE_STD_FORMAT)
|
||||||
#if !defined(SPDLOG_FMT_EXTERNAL)
|
#if !defined(SPDLOG_FMT_EXTERNAL)
|
||||||
#include "../fmt/bundled/compile.h"
|
#include "../fmt/bundled/compile.h"
|
||||||
#else
|
#else
|
||||||
#include <fmt/compile.h>
|
#include <fmt/compile.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
#if !defined(SPDLOG_USE_STD_FORMAT)
|
#if !defined(SPDLOG_USE_STD_FORMAT)
|
||||||
#if !defined(SPDLOG_FMT_EXTERNAL)
|
#if !defined(SPDLOG_FMT_EXTERNAL)
|
||||||
#include "../fmt/bundled/ostream.h"
|
#include "../fmt/bundled/ostream.h"
|
||||||
#else
|
#else
|
||||||
#include <fmt/ostream.h>
|
#include <fmt/ostream.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -14,13 +14,13 @@
|
|||||||
// The use of private formatter per sink provides the opportunity to cache some
|
// The use of private formatter per sink provides the opportunity to cache some
|
||||||
// formatted data, and support for different format per sink.
|
// formatted data, and support for different format per sink.
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "details/log_msg.h"
|
#include "details/log_msg.h"
|
||||||
#include "sinks/sink.h"
|
#include "sinks/sink.h"
|
||||||
|
|
||||||
#include <cassert>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#ifndef SPDLOG_NO_EXCEPTIONS
|
#ifndef SPDLOG_NO_EXCEPTIONS
|
||||||
#define SPDLOG_LOGGER_CATCH(location) \
|
#define SPDLOG_LOGGER_CATCH(location) \
|
||||||
catch (const std::exception &ex) { \
|
catch (const std::exception &ex) { \
|
||||||
|
@ -3,19 +3,18 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
#include <ctime>
|
||||||
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
#include <unordered_map>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "details/log_msg.h"
|
#include "details/log_msg.h"
|
||||||
#include "details/os.h"
|
#include "details/os.h"
|
||||||
#include "formatter.h"
|
#include "formatter.h"
|
||||||
|
|
||||||
#include <chrono>
|
|
||||||
#include <ctime>
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <unordered_map>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace details {
|
namespace details {
|
||||||
|
|
||||||
|
@ -5,19 +5,20 @@
|
|||||||
|
|
||||||
#ifdef __ANDROID__
|
#ifdef __ANDROID__
|
||||||
|
|
||||||
#include "../details/fmt_helper.h"
|
|
||||||
#include "../details/null_mutex.h"
|
|
||||||
#include "os.h"
|
|
||||||
#include "../details/synchronous_factory.h"
|
|
||||||
#include "base_sink.h"
|
|
||||||
|
|
||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
|
#include "../details/fmt_helper.h"
|
||||||
|
#include "../details/null_mutex.h"
|
||||||
|
#include "../details/synchronous_factory.h"
|
||||||
|
#include "base_sink.h"
|
||||||
|
#include "os.h"
|
||||||
|
|
||||||
#if !defined(SPDLOG_ANDROID_RETRIES)
|
#if !defined(SPDLOG_ANDROID_RETRIES)
|
||||||
#define SPDLOG_ANDROID_RETRIES 2
|
#define SPDLOG_ANDROID_RETRIES 2
|
||||||
#endif
|
#endif
|
||||||
|
@ -6,10 +6,11 @@
|
|||||||
#include <array>
|
#include <array>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "../details/console_globals.h"
|
#include "../details/console_globals.h"
|
||||||
#include "../details/null_mutex.h"
|
#include "../details/null_mutex.h"
|
||||||
#include "sink.h"
|
#include "sink.h"
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace sinks {
|
namespace sinks {
|
||||||
|
@ -3,14 +3,14 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <mutex>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "../details/file_helper.h"
|
#include "../details/file_helper.h"
|
||||||
#include "../details/null_mutex.h"
|
#include "../details/null_mutex.h"
|
||||||
#include "../details/synchronous_factory.h"
|
#include "../details/synchronous_factory.h"
|
||||||
#include "base_sink.h"
|
#include "base_sink.h"
|
||||||
|
|
||||||
#include <mutex>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace sinks {
|
namespace sinks {
|
||||||
/*
|
/*
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <mutex>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "../details/null_mutex.h"
|
#include "../details/null_mutex.h"
|
||||||
#include "../details/synchronous_factory.h"
|
#include "../details/synchronous_factory.h"
|
||||||
#include "base_sink.h"
|
#include "base_sink.h"
|
||||||
|
|
||||||
#include <mutex>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
|
||||||
// callbacks type
|
// callbacks type
|
||||||
|
@ -3,6 +3,13 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
#include <cstdio>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <mutex>
|
||||||
|
#include <sstream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "../common.h"
|
#include "../common.h"
|
||||||
#include "../details/circular_q.h"
|
#include "../details/circular_q.h"
|
||||||
#include "../details/file_helper.h"
|
#include "../details/file_helper.h"
|
||||||
@ -13,13 +20,6 @@
|
|||||||
#include "../fmt/fmt.h"
|
#include "../fmt/fmt.h"
|
||||||
#include "base_sink.h"
|
#include "base_sink.h"
|
||||||
|
|
||||||
#include <chrono>
|
|
||||||
#include <cstdio>
|
|
||||||
#include <iomanip>
|
|
||||||
#include <mutex>
|
|
||||||
#include <sstream>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace sinks {
|
namespace sinks {
|
||||||
|
|
||||||
|
@ -3,16 +3,16 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "base_sink.h"
|
|
||||||
#include "../details/log_msg.h"
|
|
||||||
#include "../details/null_mutex.h"
|
|
||||||
#include "../pattern_formatter.h"
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "../details/log_msg.h"
|
||||||
|
#include "../details/null_mutex.h"
|
||||||
|
#include "../pattern_formatter.h"
|
||||||
|
#include "base_sink.h"
|
||||||
|
|
||||||
// Distribution sink (mux). Stores a vector of sinks which get called when log
|
// Distribution sink (mux). Stores a vector of sinks which get called when log
|
||||||
// is called
|
// is called
|
||||||
|
|
||||||
|
@ -3,15 +3,15 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "dist_sink.h"
|
|
||||||
#include "../details/log_msg.h"
|
|
||||||
#include "../details/null_mutex.h"
|
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include "../details/log_msg.h"
|
||||||
|
#include "../details/null_mutex.h"
|
||||||
|
#include "dist_sink.h"
|
||||||
|
|
||||||
// Duplicate message removal sink.
|
// Duplicate message removal sink.
|
||||||
// Skip the message if previous one is identical and less than "max_skip_duration" have passed
|
// Skip the message if previous one is identical and less than "max_skip_duration" have passed
|
||||||
//
|
//
|
||||||
|
@ -3,6 +3,12 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
#include <cstdio>
|
||||||
|
#include <ctime>
|
||||||
|
#include <mutex>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "../common.h"
|
#include "../common.h"
|
||||||
#include "../details/circular_q.h"
|
#include "../details/circular_q.h"
|
||||||
#include "../details/file_helper.h"
|
#include "../details/file_helper.h"
|
||||||
@ -12,12 +18,6 @@
|
|||||||
#include "../fmt/fmt.h"
|
#include "../fmt/fmt.h"
|
||||||
#include "base_sink.h"
|
#include "base_sink.h"
|
||||||
|
|
||||||
#include <chrono>
|
|
||||||
#include <cstdio>
|
|
||||||
#include <ctime>
|
|
||||||
#include <mutex>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace sinks {
|
namespace sinks {
|
||||||
|
|
||||||
|
@ -10,14 +10,14 @@
|
|||||||
// https://github.com/confluentinc/librdkafka
|
// https://github.com/confluentinc/librdkafka
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "base_sink.h"
|
#include <mutex>
|
||||||
|
|
||||||
#include "../async.h"
|
#include "../async.h"
|
||||||
|
#include "../common.h"
|
||||||
#include "../details/log_msg.h"
|
#include "../details/log_msg.h"
|
||||||
#include "../details/null_mutex.h"
|
#include "../details/null_mutex.h"
|
||||||
#include "../details/synchronous_factory.h"
|
#include "../details/synchronous_factory.h"
|
||||||
|
#include "base_sink.h"
|
||||||
#include <mutex>
|
|
||||||
#include "../common.h"
|
|
||||||
|
|
||||||
// kafka header
|
// kafka header
|
||||||
#include <librdkafka/rdkafkacpp.h>
|
#include <librdkafka/rdkafkacpp.h>
|
||||||
|
@ -10,19 +10,18 @@
|
|||||||
// http://mongocxx.org/mongocxx-v3/installation/
|
// http://mongocxx.org/mongocxx-v3/installation/
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "base_sink.h"
|
|
||||||
#include "../common.h"
|
|
||||||
#include "../details/log_msg.h"
|
|
||||||
#include "../details/synchronous_factory.h"
|
|
||||||
|
|
||||||
#include <bsoncxx/builder/stream/document.hpp>
|
#include <bsoncxx/builder/stream/document.hpp>
|
||||||
#include <bsoncxx/types.hpp>
|
#include <bsoncxx/types.hpp>
|
||||||
#include <bsoncxx/view_or_value.hpp>
|
#include <bsoncxx/view_or_value.hpp>
|
||||||
|
|
||||||
#include <mongocxx/client.hpp>
|
#include <mongocxx/client.hpp>
|
||||||
#include <mongocxx/instance.hpp>
|
#include <mongocxx/instance.hpp>
|
||||||
#include <mongocxx/uri.hpp>
|
#include <mongocxx/uri.hpp>
|
||||||
|
|
||||||
|
#include "../common.h"
|
||||||
|
#include "../details/log_msg.h"
|
||||||
|
#include "../details/synchronous_factory.h"
|
||||||
|
#include "base_sink.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace sinks {
|
namespace sinks {
|
||||||
template <typename Mutex>
|
template <typename Mutex>
|
||||||
@ -78,8 +77,9 @@ private:
|
|||||||
std::unique_ptr<mongocxx::client> client_ = nullptr;
|
std::unique_ptr<mongocxx::client> client_ = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
#include "../details/null_mutex.h"
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
|
#include "../details/null_mutex.h"
|
||||||
using mongo_sink_mt = mongo_sink<std::mutex>;
|
using mongo_sink_mt = mongo_sink<std::mutex>;
|
||||||
using mongo_sink_st = mongo_sink<spdlog::details::null_mutex>;
|
using mongo_sink_st = mongo_sink<spdlog::details::null_mutex>;
|
||||||
|
|
||||||
|
@ -4,12 +4,12 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
#include "../details/null_mutex.h"
|
|
||||||
#include "base_sink.h"
|
|
||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include "../details/null_mutex.h"
|
||||||
|
#include "base_sink.h"
|
||||||
|
|
||||||
// Avoid including windows.h (https://stackoverflow.com/a/30741042)
|
// Avoid including windows.h (https://stackoverflow.com/a/30741042)
|
||||||
extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA(const char *lpOutputString);
|
extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA(const char *lpOutputString);
|
||||||
extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();
|
extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();
|
||||||
|
@ -3,12 +3,12 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
#include "../details/null_mutex.h"
|
#include "../details/null_mutex.h"
|
||||||
#include "../details/synchronous_factory.h"
|
#include "../details/synchronous_factory.h"
|
||||||
#include "base_sink.h"
|
#include "base_sink.h"
|
||||||
|
|
||||||
#include <mutex>
|
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace sinks {
|
namespace sinks {
|
||||||
|
|
||||||
|
@ -3,12 +3,12 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../details/null_mutex.h"
|
|
||||||
#include "base_sink.h"
|
|
||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
|
||||||
|
#include "../details/null_mutex.h"
|
||||||
|
#include "base_sink.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace sinks {
|
namespace sinks {
|
||||||
template <typename Mutex>
|
template <typename Mutex>
|
||||||
|
@ -11,15 +11,15 @@
|
|||||||
// If the widget's lifetime can be shorter than the logger's one, you should provide some permanent
|
// If the widget's lifetime can be shorter than the logger's one, you should provide some permanent
|
||||||
// QObject, and then use a standard signal/slot.
|
// QObject, and then use a standard signal/slot.
|
||||||
//
|
//
|
||||||
#include "base_sink.h"
|
|
||||||
#include "../common.h"
|
|
||||||
#include "../details/log_msg.h"
|
|
||||||
#include "../details/synchronous_factory.h"
|
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <QPlainTextEdit>
|
#include <QPlainTextEdit>
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
|
|
||||||
|
#include "../common.h"
|
||||||
|
#include "../details/log_msg.h"
|
||||||
|
#include "../details/synchronous_factory.h"
|
||||||
|
#include "base_sink.h"
|
||||||
|
|
||||||
//
|
//
|
||||||
// qt_sink class
|
// qt_sink class
|
||||||
//
|
//
|
||||||
@ -224,9 +224,10 @@ protected:
|
|||||||
std::array<QTextCharFormat, level::n_levels> colors_;
|
std::array<QTextCharFormat, level::n_levels> colors_;
|
||||||
};
|
};
|
||||||
|
|
||||||
#include "../details/null_mutex.h"
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
|
#include "../details/null_mutex.h"
|
||||||
|
|
||||||
using qt_sink_mt = qt_sink<std::mutex>;
|
using qt_sink_mt = qt_sink<std::mutex>;
|
||||||
using qt_sink_st = qt_sink<details::null_mutex>;
|
using qt_sink_st = qt_sink<details::null_mutex>;
|
||||||
using qt_color_sink_mt = qt_color_sink<std::mutex>;
|
using qt_color_sink_mt = qt_color_sink<std::mutex>;
|
||||||
|
@ -3,16 +3,16 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "base_sink.h"
|
|
||||||
#include "../details/circular_q.h"
|
|
||||||
#include "../details/log_msg_buffer.h"
|
|
||||||
#include "../details/null_mutex.h"
|
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "../details/circular_q.h"
|
||||||
|
#include "../details/log_msg_buffer.h"
|
||||||
|
#include "../details/null_mutex.h"
|
||||||
|
#include "base_sink.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace sinks {
|
namespace sinks {
|
||||||
/*
|
/*
|
||||||
|
@ -3,15 +3,15 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
#include <mutex>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "../details/file_helper.h"
|
#include "../details/file_helper.h"
|
||||||
#include "../details/null_mutex.h"
|
#include "../details/null_mutex.h"
|
||||||
#include "../details/synchronous_factory.h"
|
#include "../details/synchronous_factory.h"
|
||||||
#include "base_sink.h"
|
#include "base_sink.h"
|
||||||
|
|
||||||
#include <chrono>
|
|
||||||
#include <mutex>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace sinks {
|
namespace sinks {
|
||||||
//
|
//
|
||||||
|
@ -3,12 +3,12 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
#include "../details/console_globals.h"
|
#include "../details/console_globals.h"
|
||||||
#include "../details/synchronous_factory.h"
|
#include "../details/synchronous_factory.h"
|
||||||
#include "sink.h"
|
#include "sink.h"
|
||||||
|
|
||||||
#include <cstdio>
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include "../details/windows_include.h"
|
#include "../details/windows_include.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -3,13 +3,14 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../details/null_mutex.h"
|
#include <syslog.h>
|
||||||
#include "../details/synchronous_factory.h"
|
|
||||||
#include "base_sink.h"
|
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <syslog.h>
|
|
||||||
|
#include "../details/null_mutex.h"
|
||||||
|
#include "../details/synchronous_factory.h"
|
||||||
|
#include "base_sink.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace sinks {
|
namespace sinks {
|
||||||
|
@ -3,12 +3,12 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <array>
|
||||||
|
|
||||||
#include "../details/null_mutex.h"
|
#include "../details/null_mutex.h"
|
||||||
#include "../details/os.h"
|
#include "../details/os.h"
|
||||||
#include "../details/synchronous_factory.h"
|
#include "../details/synchronous_factory.h"
|
||||||
#include "base_sink.h"
|
#include "base_sink.h"
|
||||||
|
|
||||||
#include <array>
|
|
||||||
#ifndef SD_JOURNAL_SUPPRESS_LOCATION
|
#ifndef SD_JOURNAL_SUPPRESS_LOCATION
|
||||||
#define SD_JOURNAL_SUPPRESS_LOCATION
|
#define SD_JOURNAL_SUPPRESS_LOCATION
|
||||||
#endif
|
#endif
|
||||||
|
@ -33,16 +33,16 @@ Windows Registry Editor Version 5.00
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../details/null_mutex.h"
|
|
||||||
#include "base_sink.h"
|
|
||||||
|
|
||||||
#include "../details/windows_include.h"
|
|
||||||
#include <winbase.h>
|
#include <winbase.h>
|
||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "../details/null_mutex.h"
|
||||||
|
#include "../details/windows_include.h"
|
||||||
|
#include "base_sink.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace sinks {
|
namespace sinks {
|
||||||
|
|
||||||
|
@ -3,17 +3,17 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../common.h"
|
|
||||||
#include "../details/console_globals.h"
|
|
||||||
#include "../details/null_mutex.h"
|
|
||||||
#include "sink.h"
|
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include "../common.h"
|
||||||
|
#include "../details/console_globals.h"
|
||||||
|
#include "../details/null_mutex.h"
|
||||||
|
#include "sink.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace sinks {
|
namespace sinks {
|
||||||
/*
|
/*
|
||||||
|
@ -9,17 +9,17 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "common.h"
|
|
||||||
#include "logger.h"
|
|
||||||
#include "version.h"
|
|
||||||
#include "details/registry.h"
|
|
||||||
#include "details/synchronous_factory.h"
|
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
#include "details/registry.h"
|
||||||
|
#include "details/synchronous_factory.h"
|
||||||
|
#include "logger.h"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
|
||||||
using default_factory = synchronous_factory;
|
using default_factory = synchronous_factory;
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|
||||||
#include "fmt/fmt.h"
|
#include "fmt/fmt.h"
|
||||||
|
|
||||||
// Stopwatch support for spdlog (using std::chrono::steady_clock).
|
// Stopwatch support for spdlog (using std::chrono::steady_clock).
|
||||||
|
@ -2,12 +2,13 @@
|
|||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
#include "spdlog/async_logger.h"
|
#include "spdlog/async_logger.h"
|
||||||
#include "spdlog/details/thread_pool.h"
|
|
||||||
#include "spdlog/sinks/sink.h"
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include "spdlog/details/thread_pool.h"
|
||||||
|
#include "spdlog/sinks/sink.h"
|
||||||
|
|
||||||
spdlog::async_logger::async_logger(std::string logger_name,
|
spdlog::async_logger::async_logger(std::string logger_name,
|
||||||
sinks_init_list sinks_list,
|
sinks_init_list sinks_list,
|
||||||
std::weak_ptr<details::thread_pool> tp,
|
std::weak_ptr<details::thread_pool> tp,
|
||||||
|
@ -2,14 +2,15 @@
|
|||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
#include "spdlog/cfg/helpers.h"
|
#include "spdlog/cfg/helpers.h"
|
||||||
#include "spdlog/details/registry.h"
|
|
||||||
#include "spdlog/spdlog.h"
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
#include "spdlog/details/registry.h"
|
||||||
|
#include "spdlog/spdlog.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace cfg {
|
namespace cfg {
|
||||||
namespace helpers {
|
namespace helpers {
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
|
||||||
#include "spdlog/details/file_helper.h"
|
#include "spdlog/details/file_helper.h"
|
||||||
#include "spdlog/details/os.h"
|
|
||||||
|
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
|
||||||
|
#include "spdlog/common.h"
|
||||||
|
#include "spdlog/details/os.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace details {
|
namespace details {
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
#include "spdlog/details/log_msg.h"
|
#include "spdlog/details/log_msg.h"
|
||||||
|
|
||||||
#include "spdlog/details/os.h"
|
#include "spdlog/details/os.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
|
||||||
#include "spdlog/details/os.h"
|
#include "spdlog/details/os.h"
|
||||||
|
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
@ -12,9 +13,11 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
|
#include "spdlog/common.h"
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include "spdlog/details/windows_include.h"
|
#include "spdlog/details/windows_include.h"
|
||||||
#include <fileapi.h> // for FlushFileBuffers
|
#include <fileapi.h> // for FlushFileBuffers
|
||||||
@ -63,6 +66,7 @@
|
|||||||
#define __has_feature(x) 0 // Compatibility with non-clang compilers.
|
#define __has_feature(x) 0 // Compatibility with non-clang compilers.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// clang-format on
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace details {
|
namespace details {
|
||||||
namespace os {
|
namespace os {
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
#include "spdlog/details/registry.h"
|
#include "spdlog/details/registry.h"
|
||||||
|
|
||||||
#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"
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
#include <cassert>
|
|
||||||
#include "spdlog/common.h"
|
|
||||||
#include "spdlog/details/thread_pool.h"
|
#include "spdlog/details/thread_pool.h"
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
#include "spdlog/common.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace details {
|
namespace details {
|
||||||
|
|
||||||
|
@ -2,12 +2,13 @@
|
|||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
#include "spdlog/logger.h"
|
#include "spdlog/logger.h"
|
||||||
#include "spdlog/pattern_formatter.h"
|
|
||||||
#include "spdlog/sinks/sink.h"
|
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
|
#include "spdlog/pattern_formatter.h"
|
||||||
|
#include "spdlog/sinks/sink.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
|
||||||
// public methods
|
// public methods
|
||||||
|
@ -1,13 +1,7 @@
|
|||||||
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
#include "spdlog/details/fmt_helper.h"
|
|
||||||
#include "spdlog/details/log_msg.h"
|
|
||||||
#include "spdlog/details/os.h"
|
|
||||||
#include "spdlog/fmt/fmt.h"
|
|
||||||
#include "spdlog/formatter.h"
|
|
||||||
#include "spdlog/pattern_formatter.h"
|
#include "spdlog/pattern_formatter.h"
|
||||||
#include "spdlog/common.h"
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <array>
|
#include <array>
|
||||||
@ -19,6 +13,13 @@
|
|||||||
#include <thread>
|
#include <thread>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
#include "spdlog/common.h"
|
||||||
|
#include "spdlog/details/fmt_helper.h"
|
||||||
|
#include "spdlog/details/log_msg.h"
|
||||||
|
#include "spdlog/details/os.h"
|
||||||
|
#include "spdlog/fmt/fmt.h"
|
||||||
|
#include "spdlog/formatter.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace details {
|
namespace details {
|
||||||
|
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
|
||||||
#include "spdlog/pattern_formatter.h"
|
|
||||||
#include "spdlog/sinks/base_sink.h"
|
#include "spdlog/sinks/base_sink.h"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
|
#include "spdlog/common.h"
|
||||||
|
#include "spdlog/pattern_formatter.h"
|
||||||
|
|
||||||
template <typename Mutex>
|
template <typename Mutex>
|
||||||
spdlog::sinks::base_sink<Mutex>::base_sink()
|
spdlog::sinks::base_sink<Mutex>::base_sink()
|
||||||
: formatter_{std::make_unique<spdlog::pattern_formatter>()} {}
|
: formatter_{std::make_unique<spdlog::pattern_formatter>()} {}
|
||||||
|
@ -3,16 +3,16 @@
|
|||||||
|
|
||||||
#include "spdlog/sinks/rotating_file_sink.h"
|
#include "spdlog/sinks/rotating_file_sink.h"
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
|
||||||
#include "spdlog/details/file_helper.h"
|
|
||||||
#include "spdlog/details/os.h"
|
|
||||||
#include "spdlog/fmt/fmt.h"
|
|
||||||
|
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
|
||||||
|
#include "spdlog/common.h"
|
||||||
|
#include "spdlog/details/file_helper.h"
|
||||||
|
#include "spdlog/details/os.h"
|
||||||
|
#include "spdlog/fmt/fmt.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace sinks {
|
namespace sinks {
|
||||||
|
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#include "spdlog/sinks/stdout_color_sinks.h"
|
||||||
|
|
||||||
#include "spdlog/async.h"
|
#include "spdlog/async.h"
|
||||||
#include "spdlog/common.h"
|
#include "spdlog/common.h"
|
||||||
#include "spdlog/details/synchronous_factory.h"
|
#include "spdlog/details/synchronous_factory.h"
|
||||||
#include "spdlog/logger.h"
|
#include "spdlog/logger.h"
|
||||||
#include "spdlog/sinks/stdout_color_sinks.h"
|
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
|
||||||
|
@ -1,10 +1,13 @@
|
|||||||
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include "spdlog/pattern_formatter.h"
|
|
||||||
#include "spdlog/sinks/stdout_sinks.h"
|
#include "spdlog/sinks/stdout_sinks.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#include "spdlog/pattern_formatter.h"
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// under windows using fwrite to non-binary stream results in \r\r\n (see issue #1675)
|
// under windows using fwrite to non-binary stream results in \r\r\n (see issue #1675)
|
||||||
// so instead we use ::FileWrite
|
// so instead we use ::FileWrite
|
||||||
@ -18,6 +21,7 @@
|
|||||||
#include <stdio.h> // _fileno(..)
|
#include <stdio.h> // _fileno(..)
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
|
// clang-format on
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
|
||||||
namespace sinks {
|
namespace sinks {
|
||||||
|
@ -2,13 +2,14 @@
|
|||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
|
||||||
#include "spdlog/details/windows_include.h"
|
|
||||||
#include "spdlog/pattern_formatter.h"
|
|
||||||
#include "spdlog/sinks/wincolor_sink.h"
|
#include "spdlog/sinks/wincolor_sink.h"
|
||||||
|
|
||||||
#include <wincon.h>
|
#include <wincon.h>
|
||||||
|
|
||||||
|
#include "spdlog/common.h"
|
||||||
|
#include "spdlog/details/windows_include.h"
|
||||||
|
#include "spdlog/pattern_formatter.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace sinks {
|
namespace sinks {
|
||||||
template <typename ConsoleMutex>
|
template <typename ConsoleMutex>
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#include "spdlog/spdlog.h"
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
#include "spdlog/common.h"
|
||||||
#include "spdlog/pattern_formatter.h"
|
#include "spdlog/pattern_formatter.h"
|
||||||
#include "spdlog/spdlog.h"
|
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
|
||||||
|
@ -47,8 +47,7 @@ set(SPDLOG_UTESTS_SOURCES
|
|||||||
test_ringbuffer_sink.cpp
|
test_ringbuffer_sink.cpp
|
||||||
test_source_location.cpp
|
test_source_location.cpp
|
||||||
test_log_level.cpp
|
test_log_level.cpp
|
||||||
test_include_sinks.cpp
|
test_include_sinks.cpp)
|
||||||
)
|
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
list(APPEND SPDLOG_UTESTS_SOURCES test_eventlog.cpp)
|
list(APPEND SPDLOG_UTESTS_SOURCES test_eventlog.cpp)
|
||||||
|
@ -9,28 +9,30 @@
|
|||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "utils.h"
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <iomanip>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iomanip>
|
|
||||||
#include <stdlib.h>
|
#include "utils.h"
|
||||||
|
|
||||||
#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_DEBUG
|
#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_DEBUG
|
||||||
|
|
||||||
#include "spdlog/spdlog.h"
|
|
||||||
#include "spdlog/async.h"
|
#include "spdlog/async.h"
|
||||||
#include "spdlog/details/fmt_helper.h"
|
#include "spdlog/details/fmt_helper.h"
|
||||||
|
#include "spdlog/pattern_formatter.h"
|
||||||
#include "spdlog/sinks/basic_file_sink.h"
|
#include "spdlog/sinks/basic_file_sink.h"
|
||||||
#include "spdlog/sinks/daily_file_sink.h"
|
#include "spdlog/sinks/daily_file_sink.h"
|
||||||
|
#include "spdlog/sinks/msvc_sink.h"
|
||||||
#include "spdlog/sinks/null_sink.h"
|
#include "spdlog/sinks/null_sink.h"
|
||||||
#include "spdlog/sinks/ostream_sink.h"
|
#include "spdlog/sinks/ostream_sink.h"
|
||||||
#include "spdlog/sinks/rotating_file_sink.h"
|
#include "spdlog/sinks/rotating_file_sink.h"
|
||||||
#include "spdlog/sinks/stdout_color_sinks.h"
|
#include "spdlog/sinks/stdout_color_sinks.h"
|
||||||
#include "spdlog/sinks/msvc_sink.h"
|
#include "spdlog/spdlog.h"
|
||||||
#include "spdlog/pattern_formatter.h"
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
#include "test_sink.h"
|
|
||||||
#include "spdlog/fmt/bin_to_hex.h"
|
#include "spdlog/fmt/bin_to_hex.h"
|
||||||
|
#include "test_sink.h"
|
||||||
|
|
||||||
TEST_CASE("to_hex", "[to_hex]") {
|
TEST_CASE("to_hex", "[to_hex]") {
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
#include "test_sink.h"
|
|
||||||
|
|
||||||
#include "spdlog/cfg/env.h"
|
|
||||||
#include "spdlog/cfg/argv.h"
|
#include "spdlog/cfg/argv.h"
|
||||||
|
#include "spdlog/cfg/env.h"
|
||||||
|
#include "test_sink.h"
|
||||||
|
|
||||||
using spdlog::cfg::load_argv_levels;
|
using spdlog::cfg::load_argv_levels;
|
||||||
using spdlog::cfg::load_env_levels;
|
using spdlog::cfg::load_env_levels;
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
* https://raw.githubusercontent.com/gabime/spdlog/master/LICENSE
|
* https://raw.githubusercontent.com/gabime/spdlog/master/LICENSE
|
||||||
*/
|
*/
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
#include "test_sink.h"
|
|
||||||
#include "spdlog/sinks/callback_sink.h"
|
|
||||||
#include "spdlog/async.h"
|
#include "spdlog/async.h"
|
||||||
#include "spdlog/common.h"
|
#include "spdlog/common.h"
|
||||||
|
#include "spdlog/sinks/callback_sink.h"
|
||||||
|
#include "test_sink.h"
|
||||||
|
|
||||||
TEST_CASE("custom_callback_logger", "[custom_callback_logger]") {
|
TEST_CASE("custom_callback_logger", "[custom_callback_logger]") {
|
||||||
std::vector<std::string> lines;
|
std::vector<std::string> lines;
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
* This content is released under the MIT License as specified in
|
* This content is released under the MIT License as specified in
|
||||||
* https://raw.githubusercontent.com/gabime/spdlog/master/LICENSE
|
* https://raw.githubusercontent.com/gabime/spdlog/master/LICENSE
|
||||||
*/
|
*/
|
||||||
#include "includes.h"
|
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#include "includes.h"
|
||||||
|
|
||||||
#define SIMPLE_LOG "test_logs/simple_log.txt"
|
#define SIMPLE_LOG "test_logs/simple_log.txt"
|
||||||
#define SIMPLE_ASYNC_LOG "test_logs/simple_async_log.txt"
|
#define SIMPLE_ASYNC_LOG "test_logs/simple_async_log.txt"
|
||||||
|
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
#include "test_sink.h"
|
|
||||||
|
|
||||||
#include "spdlog/sinks/win_eventlog_sink.h"
|
#include "spdlog/sinks/win_eventlog_sink.h"
|
||||||
|
#include "test_sink.h"
|
||||||
|
|
||||||
static const LPCSTR TEST_SOURCE = "spdlog_test";
|
static const LPCSTR TEST_SOURCE = "spdlog_test";
|
||||||
|
|
||||||
@ -70,5 +69,3 @@ TEST_CASE("eventlog", "[eventlog]") {
|
|||||||
test_single_print([&test_logger](std::string const &msg) { test_logger.critical(msg); },
|
test_single_print([&test_logger](std::string const &msg) { test_logger.critical(msg); },
|
||||||
"my critical message", EVENTLOG_ERROR_TYPE);
|
"my critical message", EVENTLOG_ERROR_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,6 +20,6 @@
|
|||||||
#include "spdlog/sinks/udp_sink.h"
|
#include "spdlog/sinks/udp_sink.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include "spdlog/sinks/wincolor_sink.h"
|
#include "spdlog/sinks/win_eventlog_sink.h"
|
||||||
#include "spdlog/sinks/win_eventlog_sink.h"
|
#include "spdlog/sinks/wincolor_sink.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
#include "includes.h"
|
|
||||||
#include "test_sink.h"
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "includes.h"
|
||||||
|
#include "test_sink.h"
|
||||||
|
|
||||||
TEST_CASE("test_default_level", "[log_level]") {
|
TEST_CASE("test_default_level", "[log_level]") {
|
||||||
auto test_sink = std::make_shared<spdlog::sinks::test_sink_st>();
|
auto test_sink = std::make_shared<spdlog::sinks::test_sink_st>();
|
||||||
REQUIRE(test_sink->log_level() == spdlog::level::trace);
|
REQUIRE(test_sink->log_level() == spdlog::level::trace);
|
||||||
|
@ -5,13 +5,14 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "spdlog/details/null_mutex.h"
|
|
||||||
#include "spdlog/sinks/base_sink.h"
|
|
||||||
#include "spdlog/fmt/fmt.h"
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
|
#include "spdlog/details/null_mutex.h"
|
||||||
|
#include "spdlog/fmt/fmt.h"
|
||||||
|
#include "spdlog/sinks/base_sink.h"
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace sinks {
|
namespace sinks {
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* https://raw.githubusercontent.com/gabime/spdlog/master/LICENSE
|
* https://raw.githubusercontent.com/gabime/spdlog/master/LICENSE
|
||||||
*/
|
*/
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
#include "spdlog/sinks/stdout_sinks.h"
|
|
||||||
#include "spdlog/sinks/stdout_color_sinks.h"
|
#include "spdlog/sinks/stdout_color_sinks.h"
|
||||||
|
#include "spdlog/sinks/stdout_sinks.h"
|
||||||
TEST_CASE("stdout_st", "[stdout]") {
|
TEST_CASE("stdout_st", "[stdout]") {
|
||||||
auto l = spdlog::stdout_logger_st("test");
|
auto l = spdlog::stdout_logger_st("test");
|
||||||
l->set_pattern("%+");
|
l->set_pattern("%+");
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
#include "test_sink.h"
|
|
||||||
#include "spdlog/stopwatch.h"
|
#include "spdlog/stopwatch.h"
|
||||||
|
#include "test_sink.h"
|
||||||
|
|
||||||
TEST_CASE("stopwatch1", "[stopwatch]") {
|
TEST_CASE("stopwatch1", "[stopwatch]") {
|
||||||
using std::chrono::milliseconds;
|
using std::chrono::milliseconds;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
#include "test_sink.h"
|
|
||||||
#include "spdlog/async.h"
|
#include "spdlog/async.h"
|
||||||
|
#include "test_sink.h"
|
||||||
|
|
||||||
TEST_CASE("time_point1", "[time_point log_msg]") {
|
TEST_CASE("time_point1", "[time_point log_msg]") {
|
||||||
std::shared_ptr<spdlog::sinks::test_sink_st> test_sink(new spdlog::sinks::test_sink_st);
|
std::shared_ptr<spdlog::sinks::test_sink_st> test_sink(new spdlog::sinks::test_sink_st);
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/types.h>
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
#include <sys/types.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void prepare_logdir() {
|
void prepare_logdir() {
|
||||||
|
Loading…
Reference in New Issue
Block a user