@@ -53,7 +53,7 @@ static int FileWriteStr(std::string_view str, FILE *fp)
5353
5454bool BCLog::Logger::StartLogging ()
5555{
56- StdLockGuard scoped_lock (m_cs);
56+ STDLOCK (m_cs);
5757
5858 assert (m_buffering);
5959 assert (m_fileout == nullptr );
@@ -97,7 +97,7 @@ bool BCLog::Logger::StartLogging()
9797
9898void BCLog::Logger::DisconnectTestLogger ()
9999{
100- StdLockGuard scoped_lock (m_cs);
100+ STDLOCK (m_cs);
101101 m_buffering = true ;
102102 if (m_fileout != nullptr ) fclose (m_fileout);
103103 m_fileout = nullptr ;
@@ -111,7 +111,7 @@ void BCLog::Logger::DisconnectTestLogger()
111111void BCLog::Logger::DisableLogging ()
112112{
113113 {
114- StdLockGuard scoped_lock (m_cs);
114+ STDLOCK (m_cs);
115115 assert (m_buffering);
116116 assert (m_print_callbacks.empty ());
117117 }
@@ -159,7 +159,7 @@ bool BCLog::Logger::WillLogCategoryLevel(BCLog::LogFlags category, BCLog::Level
159159
160160 if (!WillLogCategory (category)) return false ;
161161
162- StdLockGuard scoped_lock (m_cs);
162+ STDLOCK (m_cs);
163163 const auto it{m_category_log_levels.find (category)};
164164 return level >= (it == m_category_log_levels.end () ? LogLevel () : it->second );
165165}
@@ -392,7 +392,7 @@ BCLog::LogRateLimiter::Status BCLog::LogRateLimiter::Consume(
392392 const SourceLocation& source_loc,
393393 const std::string& str)
394394{
395- StdLockGuard scoped_lock (m_mutex);
395+ STDLOCK (m_mutex);
396396 auto & stats{m_source_locations.try_emplace (source_loc, m_max_bytes).first ->second };
397397 Status status{stats.m_dropped_bytes > 0 ? Status::STILL_SUPPRESSED : Status::UNSUPPRESSED };
398398
@@ -423,7 +423,7 @@ void BCLog::Logger::FormatLogStrInPlace(std::string& str, BCLog::LogFlags catego
423423
424424void BCLog::Logger::LogPrintStr (std::string_view str, SourceLocation&& source_loc, BCLog::LogFlags category, BCLog::Level level, bool should_ratelimit)
425425{
426- StdLockGuard scoped_lock (m_cs);
426+ STDLOCK (m_cs);
427427 return LogPrintStr_ (str, std::move (source_loc), category, level, should_ratelimit);
428428}
429429
@@ -556,7 +556,7 @@ void BCLog::LogRateLimiter::Reset()
556556{
557557 decltype (m_source_locations) source_locations;
558558 {
559- StdLockGuard scoped_lock (m_mutex);
559+ STDLOCK (m_mutex);
560560 source_locations.swap (m_source_locations);
561561 m_suppression_active = false ;
562562 }
@@ -598,7 +598,7 @@ bool BCLog::Logger::SetCategoryLogLevel(std::string_view category_str, std::stri
598598 const auto level = GetLogLevel (level_str);
599599 if (!level.has_value () || level.value () > MAX_USER_SETABLE_SEVERITY_LEVEL ) return false ;
600600
601- StdLockGuard scoped_lock (m_cs);
601+ STDLOCK (m_cs);
602602 m_category_log_levels[flag] = level.value ();
603603 return true ;
604604}
0 commit comments