numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
|
Definition of macros for logging. More...
#include <concepts>
#include <iterator>
#include <string_view>
#include <utility>
#include <fmt/base.h>
#include <fmt/format.h>
#include "num_collect/logging/log_level.h"
#include "num_collect/logging/logger.h"
#include "num_collect/util/source_info_view.h"
Go to the source code of this file.
Namespaces | |
namespace | num_collect |
Namespace of num_collect source codes. | |
namespace | num_collect::logging |
Namespace of logging. | |
namespace | num_collect::logging::impl |
Namespace of internal implementations. | |
Macros | |
#define | INTERNAL_NUM_COLLECT_LOG_IMPL(LOGGER, LEVEL, ...) |
Write a log. | |
#define | NUM_COLLECT_LOG_AND_THROW(EXCEPTION_TYPE, ...) |
Write an error log and throw an exception for an error. | |
#define | NUM_COLLECT_LOG_CRITICAL(LOGGER, ...) |
Write a critical log. | |
#define | NUM_COLLECT_LOG_DEBUG(LOGGER, ...) |
Write a debug log. | |
#define | NUM_COLLECT_LOG_ERROR(LOGGER, ...) |
Write an error log. | |
#define | NUM_COLLECT_LOG_INFO(LOGGER, ...) |
Write an information log. | |
#define | NUM_COLLECT_LOG_ITERATION(LOGGER, ...) |
Write a log of an iteration. | |
#define | NUM_COLLECT_LOG_ITERATION_LABEL(LOGGER, ...) |
Write a log of a label of iterations. | |
#define | NUM_COLLECT_LOG_SUMMARY(LOGGER, ...) |
Write a summary log. | |
#define | NUM_COLLECT_LOG_TRACE(LOGGER, ...) |
Write a trace log. | |
#define | NUM_COLLECT_LOG_WARNING(LOGGER, ...) |
Write a warning log. | |
Functions | |
template<std::constructible_from< std::string_view, util::source_info_view > Exception, typename... MessageArgs> requires (sizeof...(MessageArgs) > 0) | |
void | num_collect::logging::log_and_throw (util::source_info_view source, const logger &l, fmt::format_string< MessageArgs... > message_format, MessageArgs &&... message_args) |
Write an error log and throw an exception for an error. | |
template<std::constructible_from< std::string_view, util::source_info_view > Exception> | |
void | num_collect::logging::log_and_throw (util::source_info_view source, const logger &l, std::string_view message) |
Write an error log and throw an exception for an error. | |
template<std::constructible_from< std::string_view, util::source_info_view > Exception, typename... MessageArgs> requires (sizeof...(MessageArgs) > 0) | |
void | num_collect::logging::log_and_throw (util::source_info_view source, fmt::format_string< MessageArgs... > message_format, MessageArgs &&... message_args) |
Write an error log and throw an exception for an error. | |
template<std::constructible_from< std::string_view, util::source_info_view > Exception> | |
void | num_collect::logging::log_and_throw (util::source_info_view source, std::string_view message) |
Write an error log and throw an exception for an error. | |
template<typename... Args> requires (sizeof...(Args) > 0) | |
void | num_collect::logging::impl::log_without_condition_check (util::source_info_view source, const logger &l, log_level level, fmt::format_string< Args... > format, Args &&... args) |
Write a log without check of the condition to write logs. | |
void | num_collect::logging::impl::log_without_condition_check (util::source_info_view source, const logger &l, log_level level, std::string_view body) |
Write a log without check of the condition to write logs. | |
Definition of macros for logging.
Definition in file logging_macros.h.
#define INTERNAL_NUM_COLLECT_LOG_IMPL | ( | LOGGER, | |
LEVEL, | |||
... ) |
Write a log.
Arguments:
LOGGER
: Logger.LEVEL
: Log level.Definition at line 163 of file logging_macros.h.
#define NUM_COLLECT_LOG_AND_THROW | ( | EXCEPTION_TYPE, | |
... ) |
Write an error log and throw an exception for an error.
This macro can be usable as following signature:
NUM_COLLECT_LOG_AND_THROW(EXCEPTION_TYPE, LOGGER, MESSAGE_FORMAT,
MESSAGE_ARGS...)
NUM_COLLECT_LOG_AND_THROW(EXCEPTION_TYPE, MESSAGE_FORMAT,
MESSAGE_ARGS...)
Here arguments are as follows:
EXCEPTION_TYPE
: Type of the exception.LOGGER
: num_collect::logging::logger object to write the log.MESSAGE_FORMAT
: Format of the error message.MESSAGE_ARGS...
: Arguments for formatting of the error message. Definition at line 333 of file logging_macros.h.
#define NUM_COLLECT_LOG_CRITICAL | ( | LOGGER, | |
... ) |
Write a critical log.
Arguments:
LOGGER
: Logger.For log levels, see num_collect::logging::log_level.
Definition at line 312 of file logging_macros.h.
#define NUM_COLLECT_LOG_DEBUG | ( | LOGGER, | |
... ) |
Write a debug log.
Arguments:
LOGGER
: Logger.For log levels, see num_collect::logging::log_level.
Definition at line 200 of file logging_macros.h.
#define NUM_COLLECT_LOG_ERROR | ( | LOGGER, | |
... ) |
Write an error log.
Arguments:
LOGGER
: Logger.For log levels, see num_collect::logging::log_level.
Definition at line 296 of file logging_macros.h.
#define NUM_COLLECT_LOG_INFO | ( | LOGGER, | |
... ) |
Write an information log.
Arguments:
LOGGER
: Logger.For log levels, see num_collect::logging::log_level.
Definition at line 264 of file logging_macros.h.
#define NUM_COLLECT_LOG_ITERATION | ( | LOGGER, | |
... ) |
Write a log of an iteration.
Arguments:
LOGGER
: Logger.For log levels, see num_collect::logging::log_level.
Definition at line 216 of file logging_macros.h.
#define NUM_COLLECT_LOG_ITERATION_LABEL | ( | LOGGER, | |
... ) |
Write a log of a label of iterations.
Arguments:
LOGGER
: Logger.For log levels, see num_collect::logging::log_level.
Definition at line 232 of file logging_macros.h.
#define NUM_COLLECT_LOG_SUMMARY | ( | LOGGER, | |
... ) |
Write a summary log.
Arguments:
LOGGER
: Logger.For log levels, see num_collect::logging::log_level.
Definition at line 248 of file logging_macros.h.
#define NUM_COLLECT_LOG_TRACE | ( | LOGGER, | |
... ) |
Write a trace log.
Arguments:
LOGGER
: Logger.For log levels, see num_collect::logging::log_level.
Definition at line 184 of file logging_macros.h.
#define NUM_COLLECT_LOG_WARNING | ( | LOGGER, | |
... ) |
Write a warning log.
Arguments:
LOGGER
: Logger.For log levels, see num_collect::logging::log_level.
Definition at line 280 of file logging_macros.h.