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()
56
56
gArgs .AddArg (" -help" , " " , false , OptionsCategory::HIDDEN);
57
57
}
58
58
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
+
59
71
// ////////////////////////////////////////////////////////////////////////////
60
72
//
61
73
// Start
@@ -506,6 +518,7 @@ int main(int argc, char* argv[])
506
518
fprintf (stderr, " Error: Initializing networking failed\n " );
507
519
return EXIT_FAILURE;
508
520
}
521
+ event_set_log_callback (&libevent_log_cb);
509
522
510
523
try {
511
524
int ret = AppInitRPC (argc, argv);
You can’t perform that action at this time.
0 commit comments