From b1c471020a6987c28d2c3614edf69ad31df6722a Mon Sep 17 00:00:00 2001 From: Nathan Daly Date: Wed, 22 May 2024 08:47:02 -0600 Subject: [PATCH] Add comments explaining that shouldlog_args is not logically thread-safe --- stdlib/Test/src/logging.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stdlib/Test/src/logging.jl b/stdlib/Test/src/logging.jl index 00ebe1aa464ea..b224d79e47cd9 100644 --- a/stdlib/Test/src/logging.jl +++ b/stdlib/Test/src/logging.jl @@ -40,6 +40,9 @@ mutable struct TestLogger <: AbstractLogger logs::Vector{LogRecord} # Guarded by lock. min_level::LogLevel catch_exceptions::Bool + # Note: shouldlog_args only maintains the info for the most recent log message, which + # may not be meaningful in a multithreaded program. See: + # https://github.com/JuliaLang/julia/pull/54497#discussion_r1603691606 shouldlog_args # Guarded by lock. message_limits::Dict{Any,Int} # Guarded by lock. respect_maxlog::Bool