config params to control logging verbosity

This commit is contained in:
Doug Hoyte
2023-01-22 11:33:12 -05:00
parent 4242290584
commit 0171fc9ec3
9 changed files with 100 additions and 22 deletions

View File

@ -10,7 +10,7 @@
static const char USAGE[] =
R"(
Usage:
scan [--pause=<pause>] <filter>
scan [--pause=<pause>] [--metrics] <filter>
)";
@ -20,6 +20,9 @@ void cmd_scan(const std::vector<std::string> &subArgs) {
uint64_t pause = 0;
if (args["--pause"]) pause = args["--pause"].asLong();
bool metrics = false;
if (args["--metrics"]) metrics = true;
std::string filterStr = args["<filter>"].asString();
auto filterGroup = NostrFilterGroup::unwrapped(tao::json::from_string(filterStr));
@ -32,7 +35,7 @@ void cmd_scan(const std::vector<std::string> &subArgs) {
auto txn = env.txn_ro();
while (1) {
bool complete = query.process(txn, pause ? pause : MAX_U64, [&](const auto &sub, uint64_t quadId){
bool complete = query.process(txn, pause ? pause : MAX_U64, metrics, [&](const auto &sub, uint64_t quadId){
std::cout << getEventJson(txn, quadId) << "\n";
});