mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-09-19 06:41:09 +02:00
log: Use ConstevalFormatString
This changes all logging (including the wallet logging) to produce a ConstevalFormatString at compile time, so that the format string can be validated at compile-time. Also, while touching the wallet logging, avoid a copy of the template Params by using const Params&.
This commit is contained in:
@@ -17,15 +17,7 @@ import sys
|
||||
|
||||
FUNCTION_NAMES_AND_NUMBER_OF_LEADING_ARGUMENTS = [
|
||||
'tfm::format,1', # Assuming tfm::::format(std::ostream&, ...
|
||||
'LogError,0',
|
||||
'LogWarning,0',
|
||||
'LogInfo,0',
|
||||
'LogDebug,1',
|
||||
'LogTrace,1',
|
||||
'LogPrintf,0',
|
||||
'LogPrintLevel,2',
|
||||
'strprintf,0',
|
||||
'WalletLogPrintf,0',
|
||||
]
|
||||
RUN_LINT_FILE = 'test/lint/run-lint-format-strings.py'
|
||||
|
||||
|
@@ -15,11 +15,6 @@ import sys
|
||||
FALSE_POSITIVES = [
|
||||
("src/clientversion.cpp", "strprintf(_(COPYRIGHT_HOLDERS).translated, COPYRIGHT_HOLDERS_SUBSTITUTION)"),
|
||||
("src/test/translation_tests.cpp", "strprintf(format, arg)"),
|
||||
("src/validationinterface.cpp", "LogDebug(BCLog::VALIDATION, fmt \"\\n\", __VA_ARGS__)"),
|
||||
("src/wallet/wallet.h", "WalletLogPrintf(const char* fmt, Params... parameters)"),
|
||||
("src/wallet/wallet.h", "LogPrintf((\"%s \" + std::string{fmt}).c_str(), GetDisplayName(), parameters...)"),
|
||||
("src/wallet/scriptpubkeyman.h", "WalletLogPrintf(const char* fmt, Params... parameters)"),
|
||||
("src/wallet/scriptpubkeyman.h", "LogPrintf((\"%s \" + std::string{fmt}).c_str(), m_storage.GetDisplayName(), parameters...)"),
|
||||
]
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user