You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support for maxlog in logging was recently added in #1877. However I have issues with Pluto getting stuck on the second run of a cell with maxlog specified. In the video I stop after 10 seconds, but it doesn't finish after that either. Link to notebook.
maybe_max_log =findfirst(((key, _),) -> key =="maxlog", next_log["kwargs"])
if maybe_max_log !==nothing
n_logs =count(log -> log["id"] == next_log["id"], running_cell.logs)
try
max_log =parse(Int, next_log["kwargs"][maybe_max_log][2] |> first)
# Don't show message with id more than max_log timesif max_log isa Int && n_logs >= max_log
returnendcatchendend
I was able to get it to work for be by changing the return to continue. However I don't understand enough of Pluto's code to know if this is the proper fix.
I would also propose to follow the default for logging in Julia and not include the maxlog argument in the log message
julia>for i in1:10@info"Some info" i maxlog =2end
┌ Info: Some info
└ i =1
┌ Info: Some info
└ i =2
I was able to get this behavior by adding the line
deleteat!(next_log["kwargs"], maybe_max_log)
inside the try-statement. But again I don't know enough about Pluto to know if editing the log-message is allowed.
And thank you for adding support for logging! I think it can be very helpful!
The text was updated successfully, but these errors were encountered:
pluto-maxlog-stuck.mp4
Support for
maxlog
in logging was recently added in #1877. However I have issues with Pluto getting stuck on the second run of a cell withmaxlog
specified. In the video I stop after 10 seconds, but it doesn't finish after that either. Link to notebook.One part of the code added in #1877 was
I was able to get it to work for be by changing the
return
tocontinue
. However I don't understand enough of Pluto's code to know if this is the proper fix.I would also propose to follow the default for logging in Julia and not include the
maxlog
argument in the log messageI was able to get this behavior by adding the line
inside the
try
-statement. But again I don't know enough about Pluto to know if editing the log-message is allowed.And thank you for adding support for logging! I think it can be very helpful!
The text was updated successfully, but these errors were encountered: