-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
in warn macro the maxlog keyword is not effective #28786
Comments
I believe the option to limit the output of a logger to only x times is not working in general. The example below is a slightly modified copy (limited i to 15 instead of 10000) of the using Logging
for i=1:15
@info "With the default backend, you will only see (i = $i) ten times" maxlog=10
@debug "Algorithm1" i progress=i/10000
end
┌ Info: With the default backend, you will only see (i = 1) ten times
└ @ Main In[128]:5
┌ Info: With the default backend, you will only see (i = 2) ten times
└ @ Main In[128]:5
┌ Info: With the default backend, you will only see (i = 3) ten times
└ @ Main In[128]:5
┌ Info: With the default backend, you will only see (i = 4) ten times
└ @ Main In[128]:5
┌ Info: With the default backend, you will only see (i = 5) ten times
└ @ Main In[128]:5
┌ Info: With the default backend, you will only see (i = 6) ten times
└ @ Main In[128]:5
┌ Info: With the default backend, you will only see (i = 7) ten times
└ @ Main In[128]:5
┌ Info: With the default backend, you will only see (i = 8) ten times
└ @ Main In[128]:5
┌ Info: With the default backend, you will only see (i = 9) ten times
└ @ Main In[128]:5
┌ Info: With the default backend, you will only see (i = 10) ten times
└ @ Main In[128]:5
┌ Info: With the default backend, you will only see (i = 11) ten times
└ @ Main In[128]:5
┌ Info: With the default backend, you will only see (i = 12) ten times
└ @ Main In[128]:5
┌ Info: With the default backend, you will only see (i = 13) ten times
└ @ Main In[128]:5
┌ Info: With the default backend, you will only see (i = 14) ten times
└ @ Main In[128]:5
┌ Info: With the default backend, you will only see (i = 15) ten times
└ @ Main In[128]:5 I'm also on Julia 1.0: julia> versioninfo()
Julia Version 1.0.0
Commit 5d4eaca0c9 (2018-08-08 20:58 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin14.5.0)
CPU: Intel(R) Core(TM)2 Duo CPU T9600 @ 2.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, penryn) |
I seem to be seeing this also in 1.0. |
jump-dev/JuMP.jl#1432 seems to have encountered this problem too |
Could someone with the power to do so add this to the 1.1 milestone? |
Lines 231 to 248 in 3ab56f1
Looks like the id generation doesn't return the old value if one exists. Should be a simple fix. |
What I can't work out is why this worked fine in Julia 0.7-beta. See my demo in #29227 This is the diff of logging.jl from 0.7-beta.197 to master
|
Root cause is the same as #28400 (bug introduced in #28017) Analysis: #29355 (comment) |
* fix bug and add tests * Reinstate statically computed log record ids Log ids are meant to identify the location of the message in the source code and must be computed at compile time. fix #28786, fix #28400; closes #29355. * Clarify documentation regarding log record `id` (cherry picked from commit 51683c4)
* fix bug and add tests * Reinstate statically computed log record ids Log ids are meant to identify the location of the message in the source code and must be computed at compile time. fix #28786, fix #28400; closes #29355. * Clarify documentation regarding log record `id` (cherry picked from commit 51683c4)
* fix bug and add tests * Reinstate statically computed log record ids Log ids are meant to identify the location of the message in the source code and must be computed at compile time. fix #28786, fix #28400; closes #29355. * Clarify documentation regarding log record `id` (cherry picked from commit 51683c4)
* fix bug and add tests * Reinstate statically computed log record ids Log ids are meant to identify the location of the message in the source code and must be computed at compile time. fix #28786, fix #28400; closes #29355. * Clarify documentation regarding log record `id` (cherry picked from commit 51683c4)
I'm trying reproducing the old behavior of
warn(msg, once = true)
. From the documentation I assumed that was done with the@warn
macro and themaxlog
keyword but it doesn't seem to work:I'm on Julia 1.0:
The text was updated successfully, but these errors were encountered: