Yes, this is definitely problematic having a mutable min_enabled_level
. Luckily the fix should be rather simple if you systematically wrap each Juno REPL command in a with_logger()
:
with_logger(some_juno_logger) do
$user_code
end
The standard REPL should probably also do something similar. Then the “repl logger” can be replaced/mutated at will, without falling afoul of the min_enabled_level
optimization.
(Edit: Going in this direction systematically, one has to wonder what the utility of the global logger is. I think it’s probably going to be replaced in the longer term, but I feel that the most coherent design depends on how/whether tasks nest in our concurrency model which seems very much to-be-decided.)
I hope you don’t have to do this by the way I still think it can be a great solution for unifying progress bars in a way which allows packages to emit progress messages without any dependencies.