Skip to content

Commit

Permalink
Add option to mute the logging for setprogress! function (#138)
Browse files Browse the repository at this point in the history
* add option to mute

* version bump

* Update Project.toml

Co-authored-by: David Widmann <[email protected]>

* apply suggestion by @devmotion

---------

Co-authored-by: David Widmann <[email protected]>
  • Loading branch information
sunxd3 and devmotion authored Feb 26, 2024
1 parent acff38f commit 8217238
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ uuid = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
keywords = ["markov chain monte carlo", "probablistic programming"]
license = "MIT"
desc = "A lightweight interface for common MCMC methods."
version = "5.1.0"
version = "5.2.0"

[deps]
BangBang = "198e06fe-97b7-11e9-32a5-e1d131e6ad66"
Expand Down
6 changes: 4 additions & 2 deletions src/sample.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ const PROGRESS = Ref(true)
Enable progress logging globally if `progress` is `true`, and disable it otherwise.
"""
function setprogress!(progress::Bool)
@info "progress logging is $(progress ? "enabled" : "disabled") globally"
function setprogress!(progress::Bool; silent::Bool=false)
if !silent
@info "progress logging is $(progress ? "enabled" : "disabled") globally"
end
PROGRESS[] = progress
return progress
end
Expand Down

0 comments on commit 8217238

Please sign in to comment.