Skip to content

Commit 8217238

Browse files
sunxd3devmotion
andauthored
Add option to mute the logging for setprogress! function (#138)
* 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]>
1 parent acff38f commit 8217238

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ uuid = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
33
keywords = ["markov chain monte carlo", "probablistic programming"]
44
license = "MIT"
55
desc = "A lightweight interface for common MCMC methods."
6-
version = "5.1.0"
6+
version = "5.2.0"
77

88
[deps]
99
BangBang = "198e06fe-97b7-11e9-32a5-e1d131e6ad66"

src/sample.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ const PROGRESS = Ref(true)
66
77
Enable progress logging globally if `progress` is `true`, and disable it otherwise.
88
"""
9-
function setprogress!(progress::Bool)
10-
@info "progress logging is $(progress ? "enabled" : "disabled") globally"
9+
function setprogress!(progress::Bool; silent::Bool=false)
10+
if !silent
11+
@info "progress logging is $(progress ? "enabled" : "disabled") globally"
12+
end
1113
PROGRESS[] = progress
1214
return progress
1315
end

0 commit comments

Comments
 (0)