Is it possible to suppress a message printed by a function?

The analogue of this in Julia is the Logging standard library, which allows lots of control over message visibility and archiving.

For example:

julia> for i = 1:5
          @info "Reached iteration $i"
       end
[ Info: Reached iteration 1
[ Info: Reached iteration 2
[ Info: Reached iteration 3
[ Info: Reached iteration 4
[ Info: Reached iteration 5

julia> global_logger(ConsoleLogger(Warn));

julia> for i = 1:5
          @info "Reached iteration $i"
       end # no output anymore!

julia> 
2 Likes