Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to mute the logging for setprogress! function #138

Merged
merged 4 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.1.1"
sunxd3 marked this conversation as resolved.
Show resolved Hide resolved

[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; verbose::Bool=true)
sunxd3 marked this conversation as resolved.
Show resolved Hide resolved
if verbose
@info "progress logging is $(progress ? "enabled" : "disabled") globally"
end
PROGRESS[] = progress
return progress
end
Expand Down
Loading