Skip to contentSkip to conversation

dynamic log level syntax

DISCUSSION Stephen Hemminger 1 participant 1 message Feb 21, 2018

lore
Share & tools
lore
#0 lore raw

After using dynamic logging for a while, I think there was a poor design choice on using regular expressions to match logging string. The naming policy looks like a hierarchy and the matching is with regular expressions. For most other applications where a hierarchy is implied, a globbing rather than regular expression match is used.

Instead of current regex based

	--log-level="pmd\.net\.i40e\..*"

Globbing would use

	--log-level="pmd.net.i40e.*"

Part of the problem as well with current choice is that seperator (period) is also the regular expression match any character value.

Glibc doesn't have an easy to use version of this matching. The only close function is fnmatch and it wants slash for separator.

Unfortunately, changing the syntax now would be an API nuisance. Some of the examples in the current documentation are unclear or incorrect on this.