Suppress warnings only
Closed this issue · 2 comments
dpsanders commented
I would like to suppress only warnings, not errors.
Is this possible?
(And hi, by the way!)
Ismael-VC commented
Dear @dpsanders,
Sorry for the late response, suppressing and capturing only warnings is the default! See this example:
julia> @suppress begin
println("This string doesn't get printed!")
warn("This warning is ignored.")
error("Remember that errors are still printed!")
end
------------------------------------------------------------------------------------------
ErrorException Stacktrace (most recent call last)
[#2] — anonymous
⌙ at <missing>:?
[#1] — macro expansion;
⌙ at Suppressor.jl:16 [inlined]
Remember that errors are still printed!
(Hello to you too by the way, wish we can meet each other again soon, cheers!)
dpsanders commented
Ah, thanks!
I was looking to suppress function redefinition warnings and was unable to get it to work using this macro, but thanks anyway.