A way to set logging level in Pluto notebooks

That clears it up!

And thanks for the tip on LoggingExtras. This lets me achieve the workflow I want by suppressing debug prints normally, and then using the LevelOverrideLogger to enable it in specific cells as needed.

Code snippet for the above scrot
# ╔═╡ Cell 1
begin
    using Logging
    using LoggingExtras
    Logging.min_enabled_level(::PlutoRunner.PlutoCellLogger) = 
            PlutoRunner.stdout_log_level
end

# ╔═╡ Cell 2
foo()

# ╔═╡ Cell 3
with_logger(LevelOverrideLogger(Logging.Debug, current_logger())) do
    foo()
end
1 Like