mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
log: add InfoHash filter
* filter log entries with new method setLogFilter * filter by node id, search or infohash * add optional parameter to 'log' in dhtnode
This commit is contained in:
1 parent
3af04a4259
commit
1d62b3ca64
12 files changed
+451
-302
No files matched your search
+4
-1
@@ -140,11 +140,14 @@ void cmd_loop(std::shared_ptr<DhtRunner>& dht, dht_params& params)
|
||||
}
|
||||
continue;
|
||||
} else if (op == "log") {
|
||||
params.log = !params.log;
|
||||
iss >> idstr;
|
||||
InfoHash filter(idstr);
|
||||
params.log = filter == InfoHash{} ? !params.log : true;
|
||||
if (params.log)
|
||||
log::enableLogging(*dht);
|
||||
else
|
||||
log::disableLogging(*dht);
|
||||
dht->setLogFilter(filter);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user