Re: [dpdk-dev] [PATCH 06/11] eal: catch invalid log level number
From: Morten Brørup <hidden>
Date: 2021-03-10 16:35:45
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon Sent: Wednesday, March 10, 2021 2:36 PM 10/03/2021 14:26, Bruce Richardson:quoted
On Wed, Mar 10, 2021 at 01:33:20PM +0100, Thomas Monjalon wrote:quoted
10/03/2021 13:19, Bruce Richardson:quoted
On Wed, Mar 10, 2021 at 12:31:10AM +0100, Thomas Monjalon wrote:quoted
The parsing check for invalid log level was not trying to catch irrelevant numeric values. A log level 0 or too high is now a failure in options parsing so it can be caught early. Signed-off-by: Thomas Monjalon <redacted>One thing I'd note here is that our log range of 1 to 8 is a little strange, and that it would be nice if we could accept 9 as a validlogquoted
quoted
quoted
level too on the cmdline. Ideally 0 would also be acceptable, for all logging off, but it's more likely that people want to up the loglevel thanquoted
quoted
quoted
reduce it, and 9 is a more expected max value than 8.Why 9 is more expected?Because a scale of 0-9 is more logical in the decimal system. We could also generalize that any number >8 is just reduced to 8 and we issue a warning and continue.In this case, we should accept any high value, not limiting arbitrary to 9, and emit a warning.
I don't care which levels are acceptable. For reference, SYSLOG levels go from 0 to 7 (both inclusive). -Morten