mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 23:29:12 +01:00
log: Use LogWarning for non-critical logs
As per doc/developer-notes#logging, LogWarning should be used for severe problems that do not warrant shutting down the node
This commit is contained in:
@@ -332,7 +332,7 @@ static void http_request_cb(struct evhttp_request* req, void* arg)
|
||||
if (g_work_queue->Enqueue(item.get())) {
|
||||
item.release(); /* if true, queue took ownership */
|
||||
} else {
|
||||
LogPrintf("WARNING: request rejected because http work queue depth exceeded, it can be increased with the -rpcworkqueue= setting\n");
|
||||
LogWarning("Request rejected because http work queue depth exceeded, it can be increased with the -rpcworkqueue= setting");
|
||||
item->req->WriteReply(HTTP_SERVICE_UNAVAILABLE, "Work queue depth exceeded");
|
||||
}
|
||||
} else {
|
||||
@@ -372,10 +372,10 @@ static bool HTTPBindAddresses(struct evhttp* http)
|
||||
endpoints.emplace_back("::1", http_port);
|
||||
endpoints.emplace_back("127.0.0.1", http_port);
|
||||
if (!gArgs.GetArgs("-rpcallowip").empty()) {
|
||||
LogPrintf("WARNING: option -rpcallowip was specified without -rpcbind; this doesn't usually make sense\n");
|
||||
LogWarning("Option -rpcallowip was specified without -rpcbind; this doesn't usually make sense");
|
||||
}
|
||||
if (!gArgs.GetArgs("-rpcbind").empty()) {
|
||||
LogPrintf("WARNING: option -rpcbind was ignored because -rpcallowip was not specified, refusing to allow everyone to connect\n");
|
||||
LogWarning("Option -rpcbind was ignored because -rpcallowip was not specified, refusing to allow everyone to connect");
|
||||
}
|
||||
} else { // Specific bind addresses
|
||||
for (const std::string& strRPCBind : gArgs.GetArgs("-rpcbind")) {
|
||||
@@ -396,7 +396,7 @@ static bool HTTPBindAddresses(struct evhttp* http)
|
||||
if (bind_handle) {
|
||||
const std::optional<CNetAddr> addr{LookupHost(i->first, false)};
|
||||
if (i->first.empty() || (addr.has_value() && addr->IsBindAny())) {
|
||||
LogPrintf("WARNING: the RPC server is not safe to expose to untrusted networks such as the public internet\n");
|
||||
LogWarning("The RPC server is not safe to expose to untrusted networks such as the public internet");
|
||||
}
|
||||
// Set the no-delay option (disable Nagle's algorithm) on the TCP socket.
|
||||
evutil_socket_t fd = evhttp_bound_socket_get_fd(bind_handle);
|
||||
@@ -406,7 +406,7 @@ static bool HTTPBindAddresses(struct evhttp* http)
|
||||
}
|
||||
boundSockets.push_back(bind_handle);
|
||||
} else {
|
||||
LogPrintf("Binding RPC on address %s port %i failed.\n", i->first, i->second);
|
||||
LogWarning("Binding RPC on address %s port %i failed.", i->first, i->second);
|
||||
}
|
||||
}
|
||||
return !boundSockets.empty();
|
||||
@@ -602,7 +602,7 @@ HTTPRequest::~HTTPRequest()
|
||||
{
|
||||
if (!replySent) {
|
||||
// Keep track of whether reply was sent to avoid request leaks
|
||||
LogPrintf("%s: Unhandled request\n", __func__);
|
||||
LogWarning("Unhandled HTTP request");
|
||||
WriteReply(HTTP_INTERNAL_SERVER_ERROR, "Unhandled request");
|
||||
}
|
||||
// evhttpd cleans up the request, as long as a reply was sent.
|
||||
|
||||
Reference in New Issue
Block a user