[PD-dev] [ pure-data-Patches-3494768 ] verbose() leaves blank lines when filtered out in Pd window

IOhannes m zmoelnig zmoelnig at iem.at
Tue Feb 28 10:37:35 CET 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2012-02-28 04:32, Hans-Christoph Steiner wrote:
> 
> On Mon, Feb 27, 2012, at 22:30, IOhannes m zmölnig wrote:
>> On 02/27/12 19:34, Hans-Christoph Steiner wrote:
>>>
>>> If post(), error(), etc. are your examples, then verbose() should have no level argument, just the fmt, then it could post at level 4.  That makes sense to me. If verbose() is meant to post messages at varying levels, then it should use the same numbering scheme as everything else, i.e.
>>>
>>
>> it's the other way round.
>> if you insist on that, then logpost() should have the same numbering 
>> scheme as everything else:
>>   logpost(0)==post()
>>   logpost(1)==verbose(1)
>>   logpost(-1)==error()
> 
> I don't think a numbering range from -2 to 2 makes much sense, like you
> suggest here.  Programmers start counting from 0, not -2.  You might
> want to double-check the code if you are wondering how everything else
> works:

that is entirely not the point [*]

you suggest that "loglevel "does it right, whereas "verbose" is the odd
player here.
my point was that it is not.
all the problems come from trying to force verbose() into the loglevel()
syntax, and finding that it has a different bias.
neither loglevel() nor verbose() have the 'right' bias.
unfortunately the 2 biases are different.



> 
> src/s_print.c
>   static void dopost(const char *s)
>   {
>   ...
>         sys_vgui("::pdwindow::post {%s}\n", strnescape(upbuf, s,
>         MAXPDSTRING));
> 
> tcl/pdwindow.tcl
>   proc ::pdwindow::post {message} {logpost {} 2 $message}
> 
>   proc ::pdwindow::verbose {level message} {
>       incr level 4
>       logpost {} $level $message

afaik, "::pdwindow::verbose" is nowhere used on the C-side (you might
want to double-check the code)

> 
> The numbers on the Pd window are 0 - 4 and the verbose proc uses "incr

what do those numbers prove?
how come you think those numbers normative (apart from you being
involved in their introduction and you not being involved in
verbose()-levels?)


mfgasdr
IOhannes


[*] btw, with "programmers start counting at 0" you imply that they only
count in one direction. i was not suggesting that the numbering range is
- -2..+2 but rather than "0" is the _default_ post level and lower numbers
are more important than higher numbers. this allows for more error
levels (grave, critical, fatal, atomic,...). all negative numbers would
be errors, while all positive numbers would be infos.
in linux you have a similar scheme with process priorities (where
negative numbers denote realtime priorities)






-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9MoFsACgkQkX2Xpv6ydvTyuQCg6dLF9ySCGPsbt1b6+ukmT4WE
ujsAoORImf0J4I/L9zdBeIl/D2VvwoYF
=ar1e
-----END PGP SIGNATURE-----

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3636 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20120228/5e85e288/attachment.bin>


More information about the Pd-dev mailing list