mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
Merge #13394: cli: Ignore libevent warnings
0231ef6c6d4f45edffda4ac3bce2048f9c8a8c00 cli: Ignore libevent warnings (Cory Fields) Pull request description: Should fix rpc tests that fail due to an unclean stderr. Untested as I'm not seeing these warnings. @promag mind seeing if this fixes your problem? Tree-SHA512: fba5ae3f239b515e93e19f9c3eca659eb7fb21f1b1fec25b68285695bfd1ecbdcd9b2235543689aaf97bff85cbb762840f65365a67e791314e9a6b8db2c9e246
This commit is contained in:
parent
2c7c4bcc08
commit
62c1477638
@ -59,6 +59,18 @@ static void SetupCliArgs()
|
||||
gArgs.AddArg("-help", "", false, OptionsCategory::HIDDEN);
|
||||
}
|
||||
|
||||
/** libevent event log callback */
|
||||
static void libevent_log_cb(int severity, const char *msg)
|
||||
{
|
||||
#ifndef EVENT_LOG_ERR // EVENT_LOG_ERR was added in 2.0.19; but before then _EVENT_LOG_ERR existed.
|
||||
# define EVENT_LOG_ERR _EVENT_LOG_ERR
|
||||
#endif
|
||||
// Ignore everything other than errors
|
||||
if (severity >= EVENT_LOG_ERR) {
|
||||
throw std::runtime_error(strprintf("libevent error: %s", msg));
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Start
|
||||
@ -524,6 +536,7 @@ int main(int argc, char* argv[])
|
||||
fprintf(stderr, "Error: Initializing networking failed\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
event_set_log_callback(&libevent_log_cb);
|
||||
|
||||
try {
|
||||
int ret = AppInitRPC(argc, argv);
|
||||
|
Loading…
Reference in New Issue
Block a user