Skip to content

Commit

Permalink
stdout closed during doc compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
epolack committed Feb 26, 2024
1 parent 5b8be60 commit ab36fb2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/common/logging.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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...)

Check warning on line 14 in src/common/logging.jl

View check run for this annotation

Codecov / codecov/patch

src/common/logging.jl#L11-L14

Added lines #L11 - L14 were not covered by tests
end
Logging.min_enabled_level(logger::DFTKLogger) = logger.min_level
Expand Down

0 comments on commit ab36fb2

Please sign in to comment.