MacPorts Base: Support for a lower level of debug output, like ui_trace, or ui_debug2/ui_debug3?

Joshua Root jmr at macports.org
Tue Jun 1 23:29:50 UTC 2021


On 2021-6-2 09:05 , Rainer Müller wrote:
> On 24/05/2021 17.13, Christopher Nielsen wrote:
>> Has there been any thoughts/interest in implementing another level (or two) of debug output, providing more detail than we get at Debug? That would allow us to optionally output more diagnostic info in various areas, such as our portgroups, without flooding the logs when running at our present Debug level.
>>
>> I’ve found this extremely helpful in the various projects I’ve worked on over the years. And it would certainly benefit us too.
>>
>> In many of the common logging frameworks, such a level is sometimes called Trace. That terminology might be confusing within MacPorts, given that we support trace mode. So perhaps we would want to name it differently. (Debug2 and Debug3?)
>>
>> But naming aside, has anyone else considered the general idea? Thoughts?
> 
> I would see it from another perspective. Why skip verbose mode and go
> straight to debug mode? If more information is regularly required,
> shouldn't we instead move more log messages to verbose mode instead of
> hiding them in the debug log only?

For information that is routinely useful to have, I would agree. And 
similarly, if there are messages that don't really convey any useful 
information, they should simply be removed.

When it comes to messages that are only wanted when debugging something, 
I think it's rare that you would be able to consistently quantify how 
important or unimportant a message is. Rather than a numeric debug 
level, it might be more useful to be able to filter the log based on 
what you are trying to debug. Someone mentioned the way Python does it 
earlier in the thread, and it sounds like we could probably learn from 
their approach even if we don't adopt it in full.

- Josh


More information about the macports-dev mailing list