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__
8// Default log level is INFO.
10 const char* verbose_ptr = std::getenv("BB_VERBOSE");
11 std::string verbose_str = verbose_ptr == nullptr ? "0" : std::string(verbose_ptr);
12 return verbose_str == "1" ? LogLevel::VERBOSE : LogLevel::INFO;
13}();
14#else
16#endif
17
18// Used for `log_function` in log.hpp. Defaults to `logstr`.
19LogFunction log_function = [](LogLevel /*unused*/, const std::string& msg) { logstr(msg.c_str()); };
20
21void set_log_function(LogFunction new_log_function)
22{
23 log_function = std::move(new_log_function);
24}
std::function< void(LogLevel level, const std::string &msg)> LogFunction
Definition log.hpp:76
LogLevel
Definition log.hpp:63
LogFunction log_function
Definition log.cpp:19
LogLevel bb_log_level
Definition log.cpp:9
void set_log_function(LogFunction new_log_function)
Definition log.cpp:21
void logstr(char const *msg)
Definition logstr.cpp:66
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13