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

maxlog is broken, log ids are always unique, thus breaking maxlog #29227

Closed
oxinabox opened this issue Sep 17, 2018 · 1 comment
Closed

maxlog is broken, log ids are always unique, thus breaking maxlog #29227

oxinabox opened this issue Sep 17, 2018 · 1 comment

Comments

@oxinabox
Copy link
Contributor

The following comes from julia 0.7 (release) or 1.0

julia> for ii in 1:10
       @info("this", maxlog=5)
       end
[ Info: this
[ Info: this
[ Info: this
[ Info: this
[ Info: this
[ Info: this
[ Info: this
[ Info: this
[ Info: this
[ Info: this

Notice that it was printed more than 5 times.

I recall that this used to work, to print it only 5 times.
So I checked on an old fork I had kicking around,
with some unrelated changes.

  | | |_| | | | (_| |  |  Version 0.7.0-beta.197 (2018-07-10 09:42 UTC)
 _/ |\__'_|_|_|\__'_|  |  patch-10/a4ca72175a* (fork: 8 commits, 72 days)
|__/                   |  x86_64-linux-gnu

julia> for ii in 1:10
       @info("this", maxlog=5)
       end
[ Info: this
[ Info: this
[ Info: this
[ Info: this
[ Info: this

I started looking for this, because
the automatic overwriting of the last log message in
https://github.com/oxinabox/OhMyLog.jl
used to work in for loops.
And it also depends on the id being the same inside a loop.

And I added a print statement, and it confirmed that each time the @info triggered,
the id was incremented by 1

@KristofferC
Copy link
Member

Dup of #28786

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

No branches or pull requests

2 participants