Sounds good to me.
I agree that 0 (CRITICAL) as the baseline and the levels as an unsigned int is better. With the enum, understanding the numeric values should not be an issue moving forward.
I would suggest considering a compatibility mode / compile time option to preserve existing functionality for those that *really* need it, then it can be removed later on (hopefully). I can imagine someone quickly trying to run a project with old pre-compiled externals and getting flooded with prints which they could at the least disable via some compatibility flag, however the amount of time it might take for them to figure this out could make the point moot. OTOH if adding this ends up taking too much time/focus for little benefit, by all means don't do it. :)
On Aug 25, 2021, at 10:35 AM, pd-dev-request@lists.iem.at wrote:
Date: Tue, 24 Aug 2021 15:59:34 +0200 From: IOhannes m zmoelnig <zmoelnig@iem.at mailto:zmoelnig@iem.at> To: Pd-dev@lists.iem.at mailto:Pd-dev@lists.iem.at Subject: [PD-dev] unifying loglevels Message-ID: <02113e2f-d09f-6cb4-bc88-c25201fc985b@iem.at mailto:02113e2f-d09f-6cb4-bc88-c25201fc985b@iem.at> Content-Type: text/plain; charset="utf-8"; Format="flowed"
TL;DR i'd like to propose to unify the loglevels as used by verbose() and logpost()
-------- Dan Wilcox @danomatika http://twitter.com/danomatika danomatika.com http://danomatika.com/ robotcowboy.com http://robotcowboy.com/
On 8/25/21 11:13 AM, Dan Wilcox wrote:
Sounds good to me.
I would suggest considering a compatibility mode / compile time option to preserve existing functionality for
right, i was thinking about suggesting to use "-compatibility" for retaining backward compat. otoh. this doesn't help at all once externals start using the new scheme and you have a mix of old-style and new-style loglevels in use.
fgmasrd IOhannes
and you have a mix of old-style and new-style loglevels in use.
Yeah, that's a general problem we can't really avoid.
Here's another suggestion:
Since logpost() really supersedes verbose(), we could allow t_loglevel to be only used with the former (with PD_CRITICAL = 0), but not with the latter. We just have to add an appropriate comment, e.g.
/* possible log levels for logpost(). NOTE: don't use with verbose()! */
enum t_loglevel { ... };
This would have the nice side effect of nudging people to use logpost() over verbose() for trackable printing.
Existing externals continue to work as expected and everybody is happy.
Christof
On 25.08.2021 11:19, IOhannes m zmoelnig wrote:
On 8/25/21 11:13 AM, Dan Wilcox wrote:
Sounds good to me.
I would suggest considering a compatibility mode / compile time option to preserve existing functionality for
right, i was thinking about suggesting to use "-compatibility" for retaining backward compat. otoh. this doesn't help at all once externals start using the new scheme and you have a mix of old-style and new-style loglevels in use.
fgmasrd IOhannes
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev