Skip to content

Commit

Permalink
convert -> construct
Browse files Browse the repository at this point in the history
I like the explicit semantics of conversion, but it's possible it won't be an AbstractString so construction is correct.
  • Loading branch information
timholy authored Mar 11, 2022
1 parent bff9c2f commit fc98cbe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion base/logging.jl
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ function handle_message(logger::SimpleLogger, level::LogLevel, message, _module,
end
iob = IOContext(buf, stream)
levelstr = level == Warn ? "Warning" : string(level)
msglines = eachsplit(chomp(convert(String, message)::String), '\n')
msglines = eachsplit(chomp(String(message)::String), '\n')
msg1, rest = Iterators.peel(msglines)
println(iob, "", levelstr, ": ", msg1)
for msg in rest
Expand Down
2 changes: 1 addition & 1 deletion stdlib/Logging/src/ConsoleLogger.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,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, message)::String), '\n')]
msglines = [(indent=0, msg=l) for l in split(chomp(String(message)::String), '\n')]
stream = logger.stream
if !isopen(stream)
stream = stderr
Expand Down

0 comments on commit fc98cbe

Please sign in to comment.