Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
log.cpp
Go to the documentation of this file.
1// Used for `vinfo` in log.hpp.
2#include <cstdlib>
3#include <string>
4
6
7#ifndef __wasm__
8bool verbose_logging = std::getenv("BB_VERBOSE") == nullptr ? false : std::string(std::getenv("BB_VERBOSE")) == "1";
9#else
10bool verbose_logging = true;
11#endif
12
13// Used for `debug` in log.hpp.
14bool debug_logging = false;
15
16// Used for `log_function` in log.hpp. Defaults to `logstr`.
17LogFunction log_function = [](LogLevel /*unused*/, const char* msg) { logstr(msg); };
18
19void set_log_function(LogFunction new_log_function)
20{
21 log_function = std::move(new_log_function);
22}
std::function< void(LogLevel level, const char *msg)> LogFunction
Definition log.hpp:69
LogLevel
Definition log.hpp:61
bool debug_logging
Definition log.cpp:14
LogFunction log_function
Definition log.cpp:17
void set_log_function(LogFunction new_log_function)
Definition log.cpp:19
bool verbose_logging
Definition log.cpp:8
void logstr(char const *msg)
Definition logstr.cpp:66
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13