A way to set logging level in Pluto notebooks

Setting global logging in this way is also very useful. However, it seems that I can’t have both at once.

For some reason, if I set the global logging level as @disberd describes, alternative loggers will stop working:

Code for above scrot
begin
    using Logging
    Logging.min_enabled_level(::PlutoRunner.PlutoCellLogger) = Logging.Info
end

foo()

debug_logger = SimpleLogger(stdout, Logging.Info)

with_logger(debug_logger) do
    foo()
end

But if I comment out the line that sets global logging, it starts behaving again.

I think for now I will stick to custom logging logic in my code, or alternatively dump it all to the terminal instead.

1 Like