Browse Source

refactoring for design changes

main
Ludovic 'Archivist' Lagouardette 1 year ago
parent
commit
3038b3de6b
4 changed files with 74 additions and 421 deletions
  1. +12
    -1
      LibSnugLog/CMakeLists.txt
  2. +8
    -6
      LibSnugLog/include/disruptor.h
  3. +4
    -195
      LibSnugLog/public_include/sl/register.h
  4. +50
    -219
      LibSnugLog/source/registry.cpp

+ 12
- 1
LibSnugLog/CMakeLists.txt View File

@ -2,7 +2,18 @@
include_directories(./public_include)
include_directories(./include)
Include(FetchContent)
FetchContent_Declare(
NlohmannJson
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_TAG v3.11.2
OVERRIDE_FIND_PACKAGE
)
FetchContent_MakeAvailable(NlohmannJson)
add_library(SnugLog
include/disruptor.h
source/disruptor.cpp include/sink.h include/registry.h include/source.h public_include/sl/strategies.h public_include/sl/register.h public_include/sl/transaction.h source/registry.cpp public_include/sl/logger.h source/logger.cpp)
source/disruptor.cpp include/sink.h include/registry.h include/source.h public_include/sl/strategies.h public_include/sl/register.h public_include/sl/transaction.h source/registry.cpp public_include/sl/logger.h source/logger.cpp)
target_link_libraries(SnugLog PRIVATE nlohmann_json )

+ 8
- 6
LibSnugLog/include/disruptor.h View File

@ -10,13 +10,15 @@
#include "sl/strategies.h"
#ifdef __cpp_lib_hardware_interference_size
static constexpr size_t max_interference_size = std::max(std::hardware_constructive_interference_size, std::hardware_destructive_interference_size);
static constexpr size_t line_length = std::hardware_constructive_interference_size;
#else
static constexpr size_t max_interference_size = 128;
static constexpr size_t line_length = 64;
#if not defined(FORCE_HW_INTERFERENCE)
#define FORCE_HW_INTERFERENCE 64
#endif
#if not defined(FORCE_LINE_LENGTH)
#define FORCE_LINE_LENGTH 128
#endif
static constexpr size_t max_interference_size = FORCE_HW_INTERFERENCE;
static constexpr size_t line_length = FORCE_LINE_LENGTH;
template<typename T>
struct alignas(max_interference_size) padded_atomic final {

+ 4
- 195
LibSnugLog/public_include/sl/register.h View File

@ -1,209 +1,18 @@
#pragma once
#ifdef __cplusplus
#include <cstdint>
#include <cstddef>
#include <string_view>
#include <string>
#include <functional>
#include <any>
#else
#include <stdint.h>
#include <stddef.h>
#endif
#include "sl/strategies.h"
/**
* @brief represents a buffer strategy, generally as an obscure pointer
*/
struct sl_buffer_strategy;
/**
* @brief represents a sink strategy, generally as an obscure pointer
*/
struct sl_sink_strategy;
/**
* @brief represents an overflow strategy, generally as an obscure pointer
*/
struct sl_overflow_strategy;
/**
* @brief represents an output strategy, generally as an obscure pointer
*/
struct sl_output_strategy;
#ifdef __cplusplus
namespace sl {
/**
* @brief represents a c-style buffer strategy
*/
using buffer_strategy = sl_buffer_strategy;
/**
* @brief represents a c-style sink strategy
*/
using sink_strategy = sl_sink_strategy;
/**
* @brief represents a c-style overflow strategy
*/
using overflow_strategy = sl_overflow_strategy;
template<BufferStrategy b_strategy_t, SinkStrategy s_strategy_t, OverflowStrategy over_strategy_t, OutputStrategy out_strategy_t>
void register_log(int log_id, std::string_view log_name, std::string_view buffer_filename, uint64_t buffer_size,
uint64_t out_strategy_parameter, std::string_view output_directory);
/**
* @brief represents a c-style output strategy
*/
using output_strategy = sl_output_strategy;
void process_log_config(const std::string_view& filename);
}
template<BufferStrategy b_strategy_t, SinkStrategy s_strategy_t, OverflowStrategy over_strategy_t, OutputStrategy out_strategy_t >
void register_log(int log_id, std::string_view log_name, std::string_view buffer_filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory);
template<> void register_log<BufferStrategyInternal, SinkStrategyDirect, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyInternal, SinkStrategyDirect, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyInternal, SinkStrategyDirect, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyInternal, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyInternal, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyInternal, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyInternal, SinkStrategyFastest, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyInternal, SinkStrategyFastest, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyInternal, SinkStrategyFastest, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyInternal, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyInternal, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyInternal, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyInternal, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyInternal, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyInternal, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyInternal, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyInternal, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyInternal, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyInternal, SinkStrategyExternal, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyInternal, SinkStrategyExternal, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyInternal, SinkStrategyExternal, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyInternal, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyInternal, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyInternal, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyDirect, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyDirect, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyDirect, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyFastest, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyFastest, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyFastest, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyExternal, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyExternal, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyExternal, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyShared, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyDirect, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyDirect, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyDirect, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyFastest, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyFastest, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyFastest, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyExternal, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyExternal, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyExternal, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
template<> void register_log<BufferStrategyExternal, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view, std::string_view, uint64_t, uint64_t, std::string_view);
#else
typedef struct sl_buffer_strategy sl_buffer_strategy;
typedef struct sl_sink_strategy sl_sink_strategy;
typedef struct sl_overflow_strategy sl_overflow_strategy;
typedef struct sl_output_strategy sl_output_strategy;
#endif
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Constructs a buffer strategy from C
* @param strategy The type of strategy
* @param filename A file describing the strategy, ignored if SL_BUFFER_TYPE is SL_INTERNAL, optional if SL_BUFFER_TYPE is SL_SHARED
* @return a strategy token for building a logger
*/
sl_buffer_strategy* sl_create_buffer_strategy(SL_BUFFER_TYPE strategy, char *filename);
/**
* @brief Constructs a sink strategy for how to handle IO in the logger
* @param strategy The type of strategy
* @return a strategy token to build a logger
*/
sl_sink_strategy* sl_create_sink_strategy(SL_SINK_IO_TYPE strategy);
/**
* @brief Constructs an overflow strategy for how to handle the edge case of a full buffer
* @param strategy The type of strategy
* @return a strategy token to build a logger
*/
sl_overflow_strategy* sl_create_overflow_strategy(SL_ON_SINK_FULL strategy);
/**
* @brief Constructs a strategy that will direct where data is logged and how it will be split
* @param strategy The strategy to use
* @param strategy_parameter Either the amount of hours to keep in the same file, or the file size in kilobytes
* @param output_directory The directory where the logs will be written
* @return a strategy token to build a logger
*/
sl_output_strategy* sl_create_output_strategy(SL_ROLL_LOGS strategy, uint64_t strategy_parameter, char* output_directory);
/**
* @brief Constructs and registers a logger, readily available immediately
* @param internal_id The ID with which you want to refer to the logger to access it as fast as possible
* @param external_id The ID which will be part of the logs filename
* @param strategies Collect the 4 tokens and reunite them into the hero's sword that will slay every other logger
*/
void sl_register_logger(int internal_id, char* external_id, sl_buffer_strategy*, sl_sink_strategy*, sl_overflow_strategy*, sl_output_strategy*);
#ifdef __cplusplus
}
#endif

+ 50
- 219
LibSnugLog/source/registry.cpp View File

@ -7,11 +7,15 @@
#include <unordered_map>
#include <functional>
#include <any>
#include "nlohmann/json.hpp"
#if defined(__linux__) || defined(__linux)
#include <sys/mman.h>
#include <fcntl.h>
#include <memory>
#include <thread>
#include <future>
#include <fstream>
#endif
@ -132,223 +136,6 @@ void register_log_impl(int log_id, std::string_view log_name, std::string_view f
};
}
template<> void register_log<BufferStrategyInternal, SinkStrategyDirect, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyDirect, OverflowStrategyWait, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyInternal, SinkStrategyDirect, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyDirect, OverflowStrategyWait, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyInternal, SinkStrategyDirect, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyDirect, OverflowStrategyWait, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyInternal, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyInternal, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyInternal, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyInternal, SinkStrategyFastest, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyFastest, OverflowStrategyWait, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyInternal, SinkStrategyFastest, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyFastest, OverflowStrategyWait, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyInternal, SinkStrategyFastest, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyFastest, OverflowStrategyWait, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyInternal, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyInternal, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyInternal, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyInternal, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyInternal, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyInternal, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyInternal, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyInternal, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyInternal, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyInternal, SinkStrategyExternal, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyExternal, OverflowStrategyWait, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyInternal, SinkStrategyExternal, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyExternal, OverflowStrategyWait, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyInternal, SinkStrategyExternal, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyExternal, OverflowStrategyWait, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyInternal, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyInternal, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyInternal, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyInternal, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyDirect, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyDirect, OverflowStrategyWait, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyDirect, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyDirect, OverflowStrategyWait, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyDirect, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyDirect, OverflowStrategyWait, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyFastest, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyFastest, OverflowStrategyWait, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyFastest, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyFastest, OverflowStrategyWait, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyFastest, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyFastest, OverflowStrategyWait, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyExternal, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyExternal, OverflowStrategyWait, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyExternal, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyExternal, OverflowStrategyWait, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyExternal, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyExternal, OverflowStrategyWait, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyShared, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyShared, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyDirect, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyDirect, OverflowStrategyWait, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyDirect, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyDirect, OverflowStrategyWait, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyDirect, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyDirect, OverflowStrategyWait, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyDirect, OverflowStrategyContinue, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyFastest, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyFastest, OverflowStrategyWait, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyFastest, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyFastest, OverflowStrategyWait, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyFastest, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyFastest, OverflowStrategyWait, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyFastest, OverflowStrategyContinue, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyMmaped, OverflowStrategyWait, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyMmaped, OverflowStrategyContinue, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyExternal, OverflowStrategyWait, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyExternal, OverflowStrategyWait, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyExternal, OverflowStrategyWait, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyExternal, OverflowStrategyWait, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyExternal, OverflowStrategyWait, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyExternal, OverflowStrategyWait, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategyTimed>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategyTimed>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategySized>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategySized>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
template<> void register_log<BufferStrategyExternal, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategySimple>(int log_id, std::string_view log_name, std::string_view filename, uint64_t buffer_size, uint64_t out_strategy_parameter, std::string_view output_directory) {
register_log_impl<BufferStrategyExternal, SinkStrategyExternal, OverflowStrategyContinue, OutputStrategySimple>(log_id, log_name, filename, buffer_size, out_strategy_parameter, output_directory);
}
BufferStrategyInternal::buffer_type BufferStrategyInternal::build_buffer(std::string_view, size_t sz) {
return std::vector<char>(sz, 0);
}
@ -379,7 +166,15 @@ BufferStrategyExternal::buffer_type BufferStrategyExternal::build_buffer(std::st
}
void SinkStrategyDirect::write(int fd, std::string_view data) {
do{
auto written = ::write(fd, data.data(), data.size());
if(written < 0) {
throw std::runtime_error("POSIX write failed");
} else if(written == 0) {
throw std::runtime_error("POSIX write made no progress");
}
data.substr(written);
} while(not data.empty());
}
void SinkStrategyFastest::write(int fd, std::string_view data) {
@ -395,7 +190,7 @@ void SinkStrategyExternal::write(int fd, std::string_view data) {
}
void OverflowStrategyWait::wait() {
std::this_thread::yield();
}
void OverflowStrategyContinue::wait() {
@ -425,3 +220,39 @@ std::pair OutputStrategySimple::chunk(std::s
int OutputStrategySimple::on_write_completed_event(std::string_view, int) {
return 0;
}
static nlohmann::json type_check_log_config(nlohmann::json&& data) {
if(not data.is_object()) return {};
if(not data.contains("on_overflow") and not data["on_overflow"].is_string()) return {};
if(not data.contains("buffer_type")) return {};
if(auto& type = data.at("buffer_type"); not (type.is_string() and type.get<std::string>() == "internal") and not data.contains("buffer_filename")) return {};
}
static void process_one(const nlohmann::json& data) {
}
void sl::process_log_config(const std::string_view &filename) {
std::ifstream config{std::string(filename)};
nlohmann::json data;
config >> data;
if(data.is_array()) {
for(auto& elem : data) {
elem = type_check_log_config(std::move(elem));
if(elem.empty()) {
// TODO: handle error
}
process_one(elem);
}
} else if (data.is_object()) {
data = type_check_log_config(std::move(data));
if(data.empty()) {
// TODO: handle error
}
process_one(data);
} else {
// TODO: handle error
}
}

Loading…
Cancel
Save