[PD] verbose() and log level

Antoine Villeret antoine.villeret at gmail.com
Fri Oct 10 14:31:32 CEST 2014


after a quick test, it appears that the verbose level should be <= 0 like this :
verbose(-3,"This is a fatal message"); // appears in red with red
background in console
verbose(-2,"This is an error message"); // appears in red with white background
verbose(-1, "This is a normal message"); // appears in black with
white background
verbose(0, "This is a debug message"); // appears in grey with white background

if level is < -3, message is displayed like -1 level.
if level is > 0, message is not displayed at all

and Gem has a verbose method in CPPExtern.cpp which I guess fordward
message to Pd's verbose (but I may be wrong).

Assuming this is the way to use the verbose() function, I will update
all occurrence of verbose in my projects to follow this behavior.

Cheers

A


--
do it yourself
http://antoine.villeret.free.fr


2014-10-10 12:33 GMT+02:00 Antoine Villeret <antoine.villeret at gmail.com>:
> hi,
>
> I've found this commit [1] where IOhannes change the log level by adding 3.
> I understand that verbose(0,"foo") will be displayed in debug log
> level with this.
> But verbose(1, "cannot use modelloader plugin '%s': %s", key.c_str(),
> x.what()); and verbose(2, "added backend#%d '%s'",
> (int)(m_handles.size()-1), key.c_str()); (from [2]) are not displayed
> in any log level.
> And I think commit [1] brakes some messages.
> Should we adjust every verbose() call ? or should we roll back to
> previous log level ?
>
> [1] : https://sourceforge.net/p/pure-data/pure-data/ci/0032fcbaa8191c163a54d9e4c19dccec489bb2c8/
> [2] : https://github.com/umlaeute/Gem/blob/master/src/plugins/modelloader.cpp
> --
> do it yourself
> http://antoine.villeret.free.fr
>
>
> 2014-10-09 17:53 GMT+02:00 Antoine Villeret <antoine.villeret at gmail.com>:
>> Hello,
>>
>> I'm wondering how verbose() work.
>> I guess it should print some info in Pd's console when Pd's log level is
>> higher than verbose's first argument.
>> With the code [1] modified from examples/template/mycobject.c, I see
>> messages from level 0, 1, 2 and 3 when sending [rats(.
>> Note the `i-3` in line 18.
>> Also I didn't find any documentation about this subtraction and many many
>> occurrence of verbose in lots of externals doesn't seem to work (in Gem for
>> example).
>> Did I miss something ?
>>
>> Thanks
>>
>> Antoine
>>
>>
>> [1] : https://gist.github.com/avilleret/050c609ced6bd6b11436
>> --
>> do it yourself
>> http://antoine.villeret.free.fr



More information about the Pd-list mailing list