File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,18 @@ static void SetupCliArgs()
5656 gArgs .AddArg (" -help" , " " , false , OptionsCategory::HIDDEN);
5757}
5858
59+ /* * libevent event log callback */
60+ static void libevent_log_cb (int severity, const char *msg)
61+ {
62+ #ifndef EVENT_LOG_ERR // EVENT_LOG_ERR was added in 2.0.19; but before then _EVENT_LOG_ERR existed.
63+ # define EVENT_LOG_ERR _EVENT_LOG_ERR
64+ #endif
65+ // Ignore everything other than errors
66+ if (severity >= EVENT_LOG_ERR) {
67+ throw std::runtime_error (strprintf (" libevent error: %s" , msg));
68+ }
69+ }
70+
5971// ////////////////////////////////////////////////////////////////////////////
6072//
6173// Start
@@ -506,6 +518,7 @@ int main(int argc, char* argv[])
506518 fprintf (stderr, " Error: Initializing networking failed\n " );
507519 return EXIT_FAILURE;
508520 }
521+ event_set_log_callback (&libevent_log_cb);
509522
510523 try {
511524 int ret = AppInitRPC (argc, argv);
You can’t perform that action at this time.
0 commit comments