diff --git a/base/logging.jl b/base/logging.jl index f60a9a1a80eab..809a9368d95bd 100644 --- a/base/logging.jl +++ b/base/logging.jl @@ -671,7 +671,7 @@ function handle_message(logger::SimpleLogger, level::LogLevel, message, _module, remaining > 0 || return end buf = IOBuffer() - stream = logger.stream + stream::IO = logger.stream if !(isopen(stream)::Bool) stream = stderr end diff --git a/stdlib/Logging/src/ConsoleLogger.jl b/stdlib/Logging/src/ConsoleLogger.jl index 359b4019fb17c..747f8a2b22966 100644 --- a/stdlib/Logging/src/ConsoleLogger.jl +++ b/stdlib/Logging/src/ConsoleLogger.jl @@ -117,7 +117,7 @@ function handle_message(logger::ConsoleLogger, level::LogLevel, message, _module # Generate a text representation of the message and all key value pairs, # split into lines. msglines = [(indent=0, msg=l) for l in split(chomp(convert(String, string(message))::String), '\n')] - stream = logger.stream + stream::IO = logger.stream if !(isopen(stream)::Bool) stream = stderr end