From 875ab6e87fffff6976cfdb40a4d73dae32cd0428 Mon Sep 17 00:00:00 2001 From: Xianda Sun Date: Mon, 26 Feb 2024 16:45:47 +0000 Subject: [PATCH 1/4] add option to mute --- src/sample.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sample.jl b/src/sample.jl index 58217f39..09868a5a 100644 --- a/src/sample.jl +++ b/src/sample.jl @@ -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) + if verbose + @info "progress logging is $(progress ? "enabled" : "disabled") globally" + end PROGRESS[] = progress return progress end From 792b49647d9133decc011d96dd3fa6550838df03 Mon Sep 17 00:00:00 2001 From: Xianda Sun Date: Mon, 26 Feb 2024 16:46:47 +0000 Subject: [PATCH 2/4] version bump --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 3e2c6383..3135e080 100644 --- a/Project.toml +++ b/Project.toml @@ -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" [deps] BangBang = "198e06fe-97b7-11e9-32a5-e1d131e6ad66" From fc05a099bb45c5f174bed18ad7f3e42b97b9e2cd Mon Sep 17 00:00:00 2001 From: Xianda Sun <5433119+sunxd3@users.noreply.github.com> Date: Mon, 26 Feb 2024 16:51:06 +0000 Subject: [PATCH 3/4] Update Project.toml Co-authored-by: David Widmann --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 3135e080..97c90709 100644 --- a/Project.toml +++ b/Project.toml @@ -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.1" +version = "5.2.0" [deps] BangBang = "198e06fe-97b7-11e9-32a5-e1d131e6ad66" From 0abd194f6625cd63b5ae02de653d49f6e898696f Mon Sep 17 00:00:00 2001 From: Xianda Sun Date: Mon, 26 Feb 2024 16:57:38 +0000 Subject: [PATCH 4/4] apply suggestion by @devmotion --- src/sample.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sample.jl b/src/sample.jl index 09868a5a..175ec8df 100644 --- a/src/sample.jl +++ b/src/sample.jl @@ -6,8 +6,8 @@ const PROGRESS = Ref(true) Enable progress logging globally if `progress` is `true`, and disable it otherwise. """ -function setprogress!(progress::Bool; verbose::Bool=true) - if verbose +function setprogress!(progress::Bool; silent::Bool=false) + if !silent @info "progress logging is $(progress ? "enabled" : "disabled") globally" end PROGRESS[] = progress