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 withprogress and logprogress macros #6

Merged
merged 2 commits into from
Oct 18, 2019

Conversation

tkf
Copy link
Collaborator

@tkf tkf commented Oct 18, 2019

Quoting the docstring:

@withprogress [name=""] ex

Create a lexical environment in which @logprogress can be used to emit progress log events without manually specifying the log level and _id.

@withprogress begin
    for i = 1:10
        sleep(0.5)
        @logprogress "iterating" progress=i/10
    end
end

An example usecase:
JuliaFolds/Transducers.jl@f94ebc0#diff-c7e0e286be94a49828209e9f88753e8b

This lets people use somewhat low-level logging-base API (@withprogress and @logprogress) without referring to the lowest-level specification (_id and LogLevel).

@pfitzseb pfitzseb closed this Oct 18, 2019
@pfitzseb pfitzseb reopened this Oct 18, 2019
@pfitzseb pfitzseb merged commit 6b2d3f4 into JuliaLogging:master Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants