Skip to content

Commit

Permalink
Merge pull request #22 from TuringLang/module
Browse files Browse the repository at this point in the history
Fix module of progress logger
  • Loading branch information
cpfiffer committed Mar 6, 2020
2 parents 685dc45 + 4d0013c commit 4bfe617
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 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 = "0.5.1"
version = "0.5.2"

[deps]
ConsoleProgressMonitor = "88cd18e8-d9cc-4ea6-8889-5259c0d15c8b"
Expand Down
5 changes: 2 additions & 3 deletions src/AbstractMCMC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ macro ifwithprogresslogger(progress, exprs...)
if $hasprogresslevel($Logging.current_logger())
$ProgressLogging.@withprogress $(exprs...)
else
$with_progresslogger($Logging.current_logger()) do
$with_progresslogger($Base.@__MODULE__, $Logging.current_logger()) do
$ProgressLogging.@withprogress $(exprs...)
end
end
Expand All @@ -36,8 +36,7 @@ function hasprogresslevel(logger)
end

# filter better, e.g., according to group?
function with_progresslogger(f, logger)
_module = @__MODULE__
function with_progresslogger(f, _module, logger)
logger1 = LoggingExtras.EarlyFilteredLogger(progresslogger()) do log
log._module === _module && log.level == ProgressLogging.ProgressLevel
end
Expand Down

0 comments on commit 4bfe617

Please sign in to comment.