#include <ctime>
#include <chrono>
#include <vector>
#include <map>
#include <sstream>
#include <fstream>
#include <optional>
#include <variant>
#include <functional>
#include <algorithm>
#include <future>
#include <limits>
#include <iomanip>
#include <any>
#include <string_view>
Go to the source code of this file.
|
#define | gempyre_utils_assert(b) (b || GempyreUtils::do_fatal("Panic!", nullptr, __FILE__, __LINE__)) |
| Release build assert.
|
|
#define | gempyre_utils_assert_x(b, x) (b || GempyreUtils::do_fatal(x, nullptr, __FILE__, __LINE__)) |
| Release build assert with a message.
|
|
#define | gempyre_utils_assert_x_f(b, x, f) (b || GempyreUtils::do_fatal(x, f, __FILE__, __LINE__)) |
| Release build assert with a message and a function executed before forced exit.
|
|
#define | gempyre_utils_fatal(x) GempyreUtils::do_fatal(x, nullptr, __FILE__, __LINE__) |
| Forced exit with a message.
|
|
#define | gempyre_utils_fatal_f(x, f) GempyreUtils::do_fatal(x, f, __FILE__, __LINE__) |
| Forced exit with a message and a function executed before forced exit.
|
|
#define | gempyre_utils_auto_clean(p, f) std::unique_ptr<std::remove_pointer<decltype(p)>::type, decltype(&f)> _ ## p (p, &f) |
| RAII helper for pointer.
|
|
#define | gempyre_utils_auto_close(p, f) GempyreUtils::_Close<std::decay_t<decltype(p)>, decltype(&f)> _ ## p (p, &f) |
| RAII helper for non-pointer.
|
|

gempyre_utils.h contains a collection utility functions used internally within Gempyre implementation and test applications. The are in API as they may be useful for any developer. Gempyre-Python do not wrap these as Python asset have similar functions in internal or pip packages.
◆ LogLevel
The LogLevel enum.
Enumerator |
---|
Fatal | All logs disabled.
|
Error | Execution ends here.
|
Warning | Something is wrong, Default.
|
Info | At least developer should be worried.
|
Debug | Something developer should know.
|
Debug_Trace | What is going on.
What is going on, and telling it floods output and impacts performance
|
◆ log()
template<typename T , typename ... Args>
void GempyreUtils::log |
( |
LogLevel |
level, |
|
|
const T & |
e, |
|
|
Args... |
args |
|
) |
| |
|
inline |
Write a log line.
- Parameters
-
level | log level of this message. |
e | param to print. |
args | optional more parameters to print. |
◆ log_level()
UTILS_EX LogLevel GempyreUtils::log_level |
( |
| ) |
|
Get current log level.
- Returns
- current log level.
◆ set_log_level()
UTILS_EX void GempyreUtils::set_log_level |
( |
LogLevel |
level | ) |
|
Set current log level.
- Parameters
-
◆ to_str()
UTILS_EX std::string GempyreUtils::to_str |
( |
LogLevel |
log_level | ) |
|
Log Level to string.
- Parameters
-
log_level | that is converted to string. |
- Returns
- std::string