LearnAPI.jl icon indicating copy to clipboard operation
LearnAPI.jl copied to clipboard

Add a user-changeable global variable for default verbosity

Open ablaom opened this issue 2 years ago • 1 comments

I guess, this is the right way to do this:

function __init__()
    global DEFAULT_VERBOSITY = Ref{Int}(1)
end

plus method to set/inspect?

ablaom avatar Mar 12 '23 23:03 ablaom

I don't think this needs to be done in __init__(). It should be sufficient to just write somewhere in the package

const DEFAULT_VERBOSITY = Base.RefValue{Int64}(1)
default_verbosity() = DEFAULT_VERBOSITY[]
set_default_verbosity!(level) = DEFAULT_VERBOSITY[] = level

jbrea avatar Mar 13 '23 21:03 jbrea