#include <farm_ng/core/logging/backtrace.h>
#include <farm_pp/preprocessor/comparison/equal.hpp>
#include <farm_pp/preprocessor/control/if.hpp>
#include <farm_pp/preprocessor/variadic/size.hpp>
#include <fmt/core.h>
#include <fmt/format.h>
#include <fmt/ostream.h>
#include <functional>
#include <iostream>
Go to the source code of this file.
|
#define | FARM_STRING(x) x |
|
#define | FARM_IMPL_LOG_PRINTLN_ZERO() |
|
#define | FARM_IMPL_LOG_PRINTLN_ONE(cstr) farm_ng::logLine(FARM_STRING(cstr)) |
|
#define | FARM_IMPL_LOG_PRINTLN_ARGS(cstr, ...) farm_ng::logLine(::fmt::format(FMT_STRING(cstr), __VA_ARGS__)) |
|
#define | FARM_IMPL_LOG_PRINTLN_VARG(cstr, ...) |
|
#define | FARM_IMPL_LOG_PRINTLN(...) |
|
#define | FARM_IMPL_ABORT() |
|
#define | FARM_RUNTIME_FORMAT(str, ...) ::farm_ng::details::runtimeFormatImpl(__FILE__, __LINE__, str, __VA_ARGS__) |
| Formats the cstr using the libfmt library. More...
|
|
#define | FARM_IMPL_FORMAT_ARGS(cstr, ...) FARM_RUNTIME_FORMAT(cstr, __VA_ARGS__) |
|
#define | FARM_IMPL_FORMAT_VARG(cstr, ...) |
|
#define | FARM_FORMAT(...) |
| Formats the cstr using the libfmt library. More...
|
|
◆ FARM_FORMAT
#define FARM_FORMAT |
( |
|
... | ) |
|
Value: FARM_PP_IF( \
FARM_PP_EQUAL(FARM_PP_VARIADIC_SIZE(dummy, ##__VA_ARGS__), 1), \
std::string(), \
Formats the cstr
using the libfmt library.
See here for details: https://fmt.dev/latest/syntax.html
Note that compile-time format check is performed, and hence cstr needs to be a string literal. If no compile-time check is required, and/or the string is a variable, call FARM_RUNTIME_FORMAT(fmt, ...)
instead.
FARM_COMPILE_TIME_FMT is not defined, the runtime version will be used, to speed up compile times.
◆ FARM_IMPL_ABORT
#define FARM_IMPL_ABORT |
( |
| ) |
|
Value:
::std::abort(); \
} while (false)
◆ FARM_IMPL_FORMAT_ARGS
◆ FARM_IMPL_FORMAT_VARG
#define FARM_IMPL_FORMAT_VARG |
( |
|
cstr, |
|
|
|
... |
|
) |
| |
Value: FARM_PP_IF( \
FARM_PP_EQUAL(FARM_PP_VARIADIC_SIZE(cstr, ##__VA_ARGS__), 1), \
std::string(cstr), \
◆ FARM_IMPL_LOG_PRINTLN
#define FARM_IMPL_LOG_PRINTLN |
( |
|
... | ) |
|
Value: FARM_PP_IF( \
FARM_PP_EQUAL(FARM_PP_VARIADIC_SIZE(dummy, ##__VA_ARGS__), 1), \
◆ FARM_IMPL_LOG_PRINTLN_ARGS
#define FARM_IMPL_LOG_PRINTLN_ARGS |
( |
|
cstr, |
|
|
|
... |
|
) |
| farm_ng::logLine(::fmt::format(FMT_STRING(cstr), __VA_ARGS__)) |
◆ FARM_IMPL_LOG_PRINTLN_ONE
◆ FARM_IMPL_LOG_PRINTLN_VARG
#define FARM_IMPL_LOG_PRINTLN_VARG |
( |
|
cstr, |
|
|
|
... |
|
) |
| |
Value: FARM_PP_IF( \
FARM_PP_EQUAL(FARM_PP_VARIADIC_SIZE(cstr, ##__VA_ARGS__), 1), \
◆ FARM_IMPL_LOG_PRINTLN_ZERO
#define FARM_IMPL_LOG_PRINTLN_ZERO |
( |
| ) |
|
◆ FARM_RUNTIME_FORMAT
Formats the cstr
using the libfmt library.
See here for details: https://fmt.dev/latest/syntax.html
If str
is cstring literal, call FARM_FORMAT instead, and the format will be checked at compile time.
◆ FARM_STRING
#define FARM_STRING |
( |
|
x | ) |
x |