Thanks Adam, these are good points. On Friday, May 22, 2015 at 2:08:33 PM UTC-7, Adam Roach wrote: > On 5/22/15 15:51, Eric Rahm wrote: > > I agree, we shouldn't make it harder to turn on logging. The easy solution > > is just to add a separate logger for verbose messages (if we choose not to > > add Verbose/Trace). > > I don't know why we wouldn't just add a more verbose log level (Verbose, > Trace... I don't care what we call it). The presence of "DEBUG + 1" in > our code is evidence of a clear, actual need.
This was my thought as well initially (my first proposal had a Verbose level). After auditing the code I changed my mind. I believe adding the Info level will serve this need. The feeling I got from most code that did 'DEBUG + 1' was that they needed to use DEBUG for the informational stuff (because there was no Info level) and wanted a lower level for the more spammy stuff (DEBUG was occupied, so fine DEBUG + 1). This was exemplified with the many variations of: #define LOGI(...) PR_LOG(..., PR_LOG_DEBUG) #define LOGV(...) PR_LOG(..., PR_LOG_DEBUG + 1) Note: For LOGI, to me at least, 'I' => Info Flipside of course the 'V' => Verbose, but I think this a semantic issue. Debug and Verbose are essentially the same thing now that we have Info. We can see this ambiguity in various logging frameworks, generally there's a debug, but if there's not there's a verbose/trace, and usually not both. > Making this a separate mechanism implies that the means of controlling > these more verbose messages is going to change at some point, and it > would be a change with no clear benefit. This means that, for example, > web pages intended to facilitate bug reporting [1] will need to be > updated to have variant instructions depending on the version of the > browser; and some such instructions are virtually guaranteed to be missed. Regardless of what we do, we'll probably have to update our various docs. In fact the page you linked to is incorrect (which is part of why I'd like to move away from raw numbers). PR_LOG_DEBUG = 4, PR_LOG_DEBUG + 1 = 5. Setting log level 6 has no difference than 5 in this case. _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform