Skip to content

Commit b507e4a

Browse files
ranochaDilumAluthge
authored andcommitted
improve type stability of handle_message(logger, ...
1 parent 26304f7 commit b507e4a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

base/logging.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ function handle_message(logger::SimpleLogger, level::LogLevel, message, _module,
671671
remaining > 0 || return
672672
end
673673
buf = IOBuffer()
674-
stream = logger.stream
674+
stream::IO = logger.stream
675675
if !(isopen(stream)::Bool)
676676
stream = stderr
677677
end

stdlib/Logging/src/ConsoleLogger.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ function handle_message(logger::ConsoleLogger, level::LogLevel, message, _module
117117
# Generate a text representation of the message and all key value pairs,
118118
# split into lines.
119119
msglines = [(indent=0, msg=l) for l in split(chomp(convert(String, string(message))::String), '\n')]
120-
stream = logger.stream
120+
stream::IO = logger.stream
121121
if !(isopen(stream)::Bool)
122122
stream = stderr
123123
end

0 commit comments

Comments
 (0)