mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-28 04:52:36 +02:00
Merge 30929 via log_enforce_newline-28
This commit is contained in:
commit
56c2250df4
@ -58,7 +58,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Create a dummy library that runs clang-tidy tests as a side-effect of building
|
# Create a dummy library that runs clang-tidy tests as a side-effect of building
|
||||||
add_library(bitcoin-tidy-tests OBJECT EXCLUDE_FROM_ALL example_logprintf.cpp example_nontrivial-threadlocal.cpp)
|
add_library(bitcoin-tidy-tests OBJECT EXCLUDE_FROM_ALL example_nontrivial-threadlocal.cpp)
|
||||||
add_dependencies(bitcoin-tidy-tests bitcoin-tidy)
|
add_dependencies(bitcoin-tidy-tests bitcoin-tidy)
|
||||||
|
|
||||||
set_target_properties(bitcoin-tidy-tests PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}")
|
set_target_properties(bitcoin-tidy-tests PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}")
|
||||||
|
@ -13,7 +13,6 @@ class BitcoinModule final : public clang::tidy::ClangTidyModule
|
|||||||
public:
|
public:
|
||||||
void addCheckFactories(clang::tidy::ClangTidyCheckFactories& CheckFactories) override
|
void addCheckFactories(clang::tidy::ClangTidyCheckFactories& CheckFactories) override
|
||||||
{
|
{
|
||||||
CheckFactories.registerCheck<bitcoin::LogPrintfCheck>("bitcoin-unterminated-logprintf");
|
|
||||||
CheckFactories.registerCheck<bitcoin::NonTrivialThreadLocal>("bitcoin-nontrivial-threadlocal");
|
CheckFactories.registerCheck<bitcoin::NonTrivialThreadLocal>("bitcoin-nontrivial-threadlocal");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -369,6 +369,8 @@ static size_t MemUsage(const BCLog::Logger::BufferedLog& buflog)
|
|||||||
|
|
||||||
void BCLog::Logger::FormatLogStrInPlace(std::string& str, BCLog::LogFlags category, BCLog::Level level, std::string_view source_file, int source_line, std::string_view logging_function, std::string_view threadname, SystemClock::time_point now, std::chrono::seconds mocktime) const
|
void BCLog::Logger::FormatLogStrInPlace(std::string& str, BCLog::LogFlags category, BCLog::Level level, std::string_view source_file, int source_line, std::string_view logging_function, std::string_view threadname, SystemClock::time_point now, std::chrono::seconds mocktime) const
|
||||||
{
|
{
|
||||||
|
if (!str.ends_with('\n')) str.push_back('\n');
|
||||||
|
|
||||||
str.insert(0, GetLogPrefix(category, level));
|
str.insert(0, GetLogPrefix(category, level));
|
||||||
|
|
||||||
if (m_log_sourcelocations) {
|
if (m_log_sourcelocations) {
|
||||||
|
Loading…
Reference in New Issue
Block a user