On Tue, 2011-02-22 at 09:17 +0100, IOhannes m zmoelnig wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2011-02-22 07:32, Hans-Christoph Steiner wrote:
So how about this:
- keep verbose() as it is
- add logpost(level, message) to both Tcl and C
- change ::pdwindow::post to mirror the C post() i.e. remove level
- remove ::pdwindow::fatal, ::pdwindow::warn, ::pdwindow::info since
they are not used anywhere
- keep ::pdwindow::post ::pdwindow::error ::pdwindow::bug
seems like a good idea.
Ok, I'll go ahead and submit a patch for pure-data.git.
I just pushed to pd-extended.git a reworking of the Pd window and the
i haven't looked into that yet.
post code, adding logpost() and dynamic updating of the log level. It now keeps all messages in a buffer, then when you select a loglevel from the Pd window, it'll clear the Pd window and refilter the whole log based on the new log level.
i don't know whether this is so practical. e.g. in my personal way of working i find that i often (ab?)use the pd-console as a scratchpad, where i add comments or (more often) insert spaces to group important information together.
but maybe the 2 interests don't clash in reality, so i don't have s very strong opinion about it.
I personally think this is awesome. It means you can have your log hiding everything but errors, but then when you get an error, you can expand the log to full detail. It turns out it that the buffering part doesn't seem to impact the performance noticably. Plus with the "after idle" performance tweak, I think this new logging will have more features and be faster.
In the process I found some tweaks that make things run much faster when posting lots of messages, so that's nice.
sounds good.
I'd like to refactor this into something for Pd 0.43. Miller, IOhannes, what do you think?
while we are at it, there is one more thing which i would like to have in post() on the long run: attach the calling object to a special message. the idea is, that (esp. with errors, but why not other messages as well?), that you could double click on a message and it will bring you to the object that sent it (if available/applicable)
right now this is only possible with pd_error (as this is the only fun that explicitely gets a reference to the sending object), but it would be nice if this could be done for all printouts.
this would obviously need another argument on the tcl-side
This would be very nice, I could see being about to double-click any line in the log and have it pop up which object made the log message. I won't have time to implement this in the foreseeable future.
.hc