Skip to content

ConsoleLogger doesn't work with Core IO anymore #40954

Closed
@maleadt

Description

@maleadt

On latest nightly:

julia> using Logging

julia> global_logger(ConsoleLogger(IOContext(Core.stderr)))
ConsoleLogger(IOBuffer(data=UInt8[...], readable=false, writable=false, seekable=false, append=false, size=0, maxsize=0, ptr=1, mark=-1), Info, Logging.default_metafmt, true, 0, Dict{Any, Int64}())

julia> @info "test"
ERROR: MethodError: no method matching isopen(::Core.CoreSTDERR)
Closest candidates are:
  isopen(::Base.AbstractPipe) at io.jl:386
  isopen(::Base.GenericIOBuffer) at iobuffer.jl:351
  isopen(::Channel) at channels.jl:195
  ...
Stacktrace:
 [1] isopen(io::IOContext{Core.CoreSTDERR})
   @ Base ./io.jl:386
 [2] handle_message(logger::ConsoleLogger, level::Base.CoreLogging.LogLevel, message::Any, _module::Any, group::Any, id::Any, filepath::Any, line::Any; kwargs::Base.Pairs{Symbol, V, Tuple{Vararg{Symbol, N}}, NamedTuple{names, T}} where {V, N, names, T<:Tuple{Vararg{Any, N}}})
   @ Logging /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/Logging/src/ConsoleLogger.jl:121
 [3] handle_message(logger::ConsoleLogger, level::Base.CoreLogging.LogLevel, message::Any, _module::Any, group::Any, id::Any, filepath::Any, line::Any)
   @ Logging /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/Logging/src/ConsoleLogger.jl:109
 [4] top-level scope
   @ logging.jl:310

Introduced by #40423.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorloggingThe logging frameworkregressionRegression in behavior compared to a previous version

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions