1
0
mirror of https://github.com/paboyle/Grid.git synced 2026-05-14 22:24:30 +01:00

working 7-link; Grid_log; generalShift

This commit is contained in:
david clarke
2023-10-12 11:11:39 -06:00
parent b9c70d156b
commit 36600899e2
4 changed files with 85 additions and 75 deletions
+21
View File
@@ -191,6 +191,27 @@ extern Colours GridLogColours;
std::string demangle(const char* name) ;
template<typename... Args>
inline std::string sjoin(Args&&... args) noexcept {
std::ostringstream msg;
(msg << ... << args);
return msg.str();
}
/*! @brief make log messages work like python print */
template <typename... Args>
inline void Grid_log(Args&&... args) {
std::string msg = sjoin(std::forward<Args>(args)...);
std::cout << GridLogMessage << msg << std::endl;
}
/*! @brief make warning messages work like python print */
template <typename... Args>
inline void Grid_warn(Args&&... args) {
std::string msg = sjoin(std::forward<Args>(args)...);
std::cout << GridLogWarning << msg << std::endl;
}
#define _NBACKTRACE (256)
extern void * Grid_backtrace_buffer[_NBACKTRACE];