mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-09-27 18:27:34 +02:00
util: Use compile-time check for LogConnectFailure
This commit is contained in:
@@ -557,7 +557,8 @@ std::unique_ptr<Sock> CreateSockOS(int domain, int type, int protocol)
|
|||||||
std::function<std::unique_ptr<Sock>(int, int, int)> CreateSock = CreateSockOS;
|
std::function<std::unique_ptr<Sock>(int, int, int)> CreateSock = CreateSockOS;
|
||||||
|
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
static void LogConnectFailure(bool manual_connection, const char* fmt, const Args&... args) {
|
static void LogConnectFailure(bool manual_connection, util::ConstevalFormatString<sizeof...(Args)> fmt, const Args&... args)
|
||||||
|
{
|
||||||
std::string error_message = tfm::format(fmt, args...);
|
std::string error_message = tfm::format(fmt, args...);
|
||||||
if (manual_connection) {
|
if (manual_connection) {
|
||||||
LogPrintf("%s\n", error_message);
|
LogPrintf("%s\n", error_message);
|
||||||
|
@@ -17,7 +17,6 @@ import sys
|
|||||||
|
|
||||||
FUNCTION_NAMES_AND_NUMBER_OF_LEADING_ARGUMENTS = [
|
FUNCTION_NAMES_AND_NUMBER_OF_LEADING_ARGUMENTS = [
|
||||||
'tfm::format,1', # Assuming tfm::::format(std::ostream&, ...
|
'tfm::format,1', # Assuming tfm::::format(std::ostream&, ...
|
||||||
'LogConnectFailure,1',
|
|
||||||
'LogError,0',
|
'LogError,0',
|
||||||
'LogWarning,0',
|
'LogWarning,0',
|
||||||
'LogInfo,0',
|
'LogInfo,0',
|
||||||
|
@@ -13,7 +13,6 @@ import re
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
FALSE_POSITIVES = [
|
FALSE_POSITIVES = [
|
||||||
("src/netbase.cpp", "LogConnectFailure(bool manual_connection, const char* fmt, const Args&... args)"),
|
|
||||||
("src/clientversion.cpp", "strprintf(_(COPYRIGHT_HOLDERS).translated, COPYRIGHT_HOLDERS_SUBSTITUTION)"),
|
("src/clientversion.cpp", "strprintf(_(COPYRIGHT_HOLDERS).translated, COPYRIGHT_HOLDERS_SUBSTITUTION)"),
|
||||||
("src/test/translation_tests.cpp", "strprintf(format, arg)"),
|
("src/test/translation_tests.cpp", "strprintf(format, arg)"),
|
||||||
("src/validationinterface.cpp", "LogDebug(BCLog::VALIDATION, fmt \"\\n\", __VA_ARGS__)"),
|
("src/validationinterface.cpp", "LogDebug(BCLog::VALIDATION, fmt \"\\n\", __VA_ARGS__)"),
|
||||||
|
Reference in New Issue
Block a user