diff --git a/src/common/logging.jl b/src/common/logging.jl index 42b3655ea5..2b48d32844 100644 --- a/src/common/logging.jl +++ b/src/common/logging.jl @@ -9,7 +9,8 @@ Base.@kwdef struct DFTKLogger <: AbstractLogger fallback = ConsoleLogger(io, min_level) end function Logging.handle_message(logger::DFTKLogger, level, msg, args...; kwargs...) - level == Info && return level < logger.min_level ? nothing : println(logger.io, msg) + io = isopen(logger.io) ? logger.io : stdout # not sure what happens when docs are run + level == Info && return level < logger.min_level ? nothing : println(io, msg) Logging.handle_message(logger.fallback, level, msg, args...; kwargs...) end Logging.min_enabled_level(logger::DFTKLogger) = logger.min_level