Skip to content

Commit

Permalink
Allow packages to force depwarns (#37296)
Browse files Browse the repository at this point in the history
(cherry picked from commit 405cd6f)
  • Loading branch information
timholy authored and KristofferC committed Sep 8, 2020
1 parent 8a7bd5a commit c4edd15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ macro deprecate(old, new, ex=true)
end
end

function depwarn(msg, funcsym)
function depwarn(msg, funcsym; force::Bool=false)
opts = JLOptions()
if opts.depwarn == 2
throw(ErrorException(msg))
end
deplevel = opts.depwarn == 1 ? CoreLogging.Warn : CoreLogging.BelowMinLevel
deplevel = force || opts.depwarn == 1 ? CoreLogging.Warn : CoreLogging.BelowMinLevel
@logmsg(
deplevel,
msg,
Expand Down

0 comments on commit c4edd15

Please sign in to comment.