QuickCppLib 0.10
Eliminate all the tedious hassle when making state-of-the-art C++ 14 - 23 libraries!
|
#include "packed_backtrace.hpp"
#include "scope.hpp"
#include <array>
#include <atomic>
#include <chrono>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <iomanip>
#include <ostream>
#include <sstream>
#include <system_error>
#include <type_traits>
#include <vector>
#include <dlfcn.h>
#include <execinfo.h>
#include <fcntl.h>
#include <limits.h>
#include <signal.h>
#include <spawn.h>
#include <sys/wait.h>
#include <unistd.h>
Classes | |
struct | quickcpplib::_xxx::ringbuffer_log::default_ringbuffer_log_level_checker |
A default ringbuffer log_level checker which returns whatever the log instance's level is. More... | |
struct | quickcpplib::_xxx::ringbuffer_log::simple_ringbuffer_log_policy_detail::value_type |
struct | quickcpplib::_xxx::ringbuffer_log::simple_ringbuffer_log_policy< Bytes > |
A ring buffer log stored in a fixed QUICKCPPLIB_RINGBUFFER_LOG_DEFAULT_ENTRIES_NDEBUG/QUICKCPPLIB_RINGBUFFER_LOG_DEFAULT_ENTRIES_DEBUG std::array recording monotonic counter (8 bytes), high resolution clock time stamp (8 bytes), stack backtrace or func (40 bytes), level (1 byte), 191 bytes of char message. Each record is 256 bytes, therefore the ring buffer wraps after 256/4096 entries by default. More... | |
class | quickcpplib::_xxx::ringbuffer_log::ringbuffer_log< Policy, LogLevelChecker > |
Very fast threadsafe ring buffer log. More... | |
class | quickcpplib::_xxx::ringbuffer_log::ringbuffer_log< Policy, LogLevelChecker >::iterator_< Parent, Pointer, Reference > |
struct | quickcpplib::_xxx::ringbuffer_log::ringbuffer_log< Policy, LogLevelChecker >::unique_id |
Used to tag an index as being an absolute lookup of a unique counter value returned by push_back/emplace_back. More... | |
Namespaces | |
namespace | quickcpplib |
The QuickCppLib namespace. | |
namespace | quickcpplib::_xxx |
Per commit unique namespace to prevent different git submodule versions clashing. | |
namespace | quickcpplib::_xxx::ringbuffer_log |
namespace | quickcpplib::_xxx::ringbuffer_log::simple_ringbuffer_log_policy_detail |
Macros | |
#define | QUICKCPPLIB_RINGBUFFER_LOG_DEFAULT_ENTRIES_DEBUG 4096 |
#define | QUICKCPPLIB_RINGBUFFER_LOG_DEFAULT_ENTRIES_NDEBUG 256 |
#define | QUICKCPPLIB_RINGBUFFER_LOG_DEFAULT_ENTRIES QUICKCPPLIB_RINGBUFFER_LOG_DEFAULT_ENTRIES_DEBUG |
#define | QUICKCPPLIB_RINGBUFFERLOG_ITEM_FUNCTION(log, level, message, code1, code2) (log).emplace_back((level), (message), (code1), (code2), __func__, __LINE__) |
Logs an item to the log with calling function name. | |
#define | QUICKCPPLIB_RINGBUFFERLOG_ITEM_BACKTRACE(log, level, message, code1, code2) (log).emplace_back((level), (message), (code1), (code2), nullptr) |
Logs an item to the log with stack backtrace. | |
#define | QUICKCPPLIB_RINGBUFFERLOG_LEVEL 2 |
#define | QUICKCPPLIB_RINGBUFFERLOG_FATAL_FUNCTION(log, message, code1, code2) |
#define | QUICKCPPLIB_RINGBUFFERLOG_FATAL_BACKTRACE(log, message, code1, code2) |
#define | QUICKCPPLIB_RINGBUFFERLOG_ERROR_FUNCTION(log, message, code1, code2) |
#define | QUICKCPPLIB_RINGBUFFERLOG_ERROR_BACKTRACE(log, message, code1, code2) |
#define | QUICKCPPLIB_RINGBUFFERLOG_WARN_FUNCTION(log, message, code1, code2) |
#define | QUICKCPPLIB_RINGBUFFERLOG_WARN_BACKTRACE(log, message, code1, code2) |
#define | QUICKCPPLIB_RINGBUFFERLOG_INFO_FUNCTION(log, message, code1, code2) |
#define | QUICKCPPLIB_RINGBUFFERLOG_INFO_BACKTRACE(log, message, code1, code2) |
#define | QUICKCPPLIB_RINGBUFFERLOG_DEBUG_FUNCTION(log, message, code1, code2) |
#define | QUICKCPPLIB_RINGBUFFERLOG_DEBUG_BACKTRACE(log, message, code1, code2) |
#define | QUICKCPPLIB_RINGBUFFERLOG_ALL_FUNCTION(log, message, code1, code2) |
#define | QUICKCPPLIB_RINGBUFFERLOG_ALL_BACKTRACE(log, message, code1, code2) |
Typedefs | |
using | quickcpplib::_xxx::ringbuffer_log::simple_ringbuffer_log_policy_detail::level_ = level |
template<size_t Bytes = QUICKCPPLIB_RINGBUFFER_LOG_DEFAULT_ENTRIES * 256, class LogLevelChecker = default_ringbuffer_log_level_checker> | |
using | quickcpplib::_xxx::ringbuffer_log::simple_ringbuffer_log = ringbuffer_log< simple_ringbuffer_log_policy< Bytes >, LogLevelChecker > |
Alias for a simple ringbuffer log. | |
Enumerations | |
enum class | quickcpplib::_xxx::ringbuffer_log::level : unsigned char { quickcpplib::_xxx::ringbuffer_log::none = 0 , quickcpplib::_xxx::ringbuffer_log::fatal , quickcpplib::_xxx::ringbuffer_log::error , quickcpplib::_xxx::ringbuffer_log::warn , quickcpplib::_xxx::ringbuffer_log::info , quickcpplib::_xxx::ringbuffer_log::debug , quickcpplib::_xxx::ringbuffer_log::all } |
Level of logged item. More... | |
Functions | |
template<class T > | |
const char * | quickcpplib::_xxx::ringbuffer_log::last190 (const T &v) |
Returns a const char * no more than 190 chars from its end. | |
std::string | quickcpplib::_xxx::ringbuffer_log::simple_ringbuffer_log_policy_detail::location (const value_type &v) |
Location generator for simple_ringbuffer_log_policy's value_type. | |
std::ostream & | quickcpplib::_xxx::ringbuffer_log::simple_ringbuffer_log_policy_detail::operator<< (std::ostream &s, const value_type &v) |
std::ostream writer for simple_ringbuffer_log_policy's value_type | |
std::ostream & | quickcpplib::_xxx::ringbuffer_log::simple_ringbuffer_log_policy_detail::csv (std::ostream &s, const value_type &v) |
CSV std::ostream writer for simple_ringbuffer_log_policy's value_type. | |
template<class Policy , class LogLevelChecker > | |
std::ostream & | quickcpplib::_xxx::ringbuffer_log::operator<< (std::ostream &s, const ringbuffer_log< Policy, LogLevelChecker > &l) |
std::ostream writer for a log | |
template<class Policy , class LogLevelChecker > | |
std::string | quickcpplib::_xxx::ringbuffer_log::csv (const ringbuffer_log< Policy, LogLevelChecker > &l) |
CSV string writer for a log. | |
#define QUICKCPPLIB_RINGBUFFER_LOG_DEFAULT_ENTRIES_DEBUG 4096 |
#define QUICKCPPLIB_RINGBUFFER_LOG_DEFAULT_ENTRIES_NDEBUG 256 |
#define QUICKCPPLIB_RINGBUFFER_LOG_DEFAULT_ENTRIES QUICKCPPLIB_RINGBUFFER_LOG_DEFAULT_ENTRIES_DEBUG |
#define QUICKCPPLIB_RINGBUFFERLOG_ITEM_FUNCTION | ( | log, | |
level, | |||
message, | |||
code1, | |||
code2 | |||
) | (log).emplace_back((level), (message), (code1), (code2), __func__, __LINE__) |
Logs an item to the log with calling function name.
#define QUICKCPPLIB_RINGBUFFERLOG_ITEM_BACKTRACE | ( | log, | |
level, | |||
message, | |||
code1, | |||
code2 | |||
) | (log).emplace_back((level), (message), (code1), (code2), nullptr) |
Logs an item to the log with stack backtrace.
#define QUICKCPPLIB_RINGBUFFERLOG_LEVEL 2 |
#define QUICKCPPLIB_RINGBUFFERLOG_FATAL_FUNCTION | ( | log, | |
message, | |||
code1, | |||
code2 | |||
) |
#define QUICKCPPLIB_RINGBUFFERLOG_FATAL_BACKTRACE | ( | log, | |
message, | |||
code1, | |||
code2 | |||
) |
#define QUICKCPPLIB_RINGBUFFERLOG_ERROR_FUNCTION | ( | log, | |
message, | |||
code1, | |||
code2 | |||
) |
#define QUICKCPPLIB_RINGBUFFERLOG_ERROR_BACKTRACE | ( | log, | |
message, | |||
code1, | |||
code2 | |||
) |
#define QUICKCPPLIB_RINGBUFFERLOG_WARN_FUNCTION | ( | log, | |
message, | |||
code1, | |||
code2 | |||
) |
#define QUICKCPPLIB_RINGBUFFERLOG_WARN_BACKTRACE | ( | log, | |
message, | |||
code1, | |||
code2 | |||
) |
#define QUICKCPPLIB_RINGBUFFERLOG_INFO_FUNCTION | ( | log, | |
message, | |||
code1, | |||
code2 | |||
) |
#define QUICKCPPLIB_RINGBUFFERLOG_INFO_BACKTRACE | ( | log, | |
message, | |||
code1, | |||
code2 | |||
) |
#define QUICKCPPLIB_RINGBUFFERLOG_DEBUG_FUNCTION | ( | log, | |
message, | |||
code1, | |||
code2 | |||
) |
#define QUICKCPPLIB_RINGBUFFERLOG_DEBUG_BACKTRACE | ( | log, | |
message, | |||
code1, | |||
code2 | |||
) |
#define QUICKCPPLIB_RINGBUFFERLOG_ALL_FUNCTION | ( | log, | |
message, | |||
code1, | |||
code2 | |||
) |
#define QUICKCPPLIB_RINGBUFFERLOG_ALL_BACKTRACE | ( | log, | |
message, | |||
code1, | |||
code2 | |||
) |