[stratum-dev] How to set log levels with -vmodule

Narada Hess NHESS at extremenetworks.com
Thu May 13 20:19:30 UTC 2021

Clarifying for the list after today's TST meeting (please correct me if I'm wrong).

The way to get the max logging of everything would be to set:

In other words, log everything INFO and above at the maximum verbosity (5). And verbosity only affects messages at INFO level.

Now that I understand log level vs verbosity, I'll play with the -vmodule option and let you know what I find. N

From: Maximilian Pudelko <max at opennetworking.org>
Sent: Wednesday, May 12, 2021 5:50 PM
To: Narada Hess <NHESS at extremenetworks.com>
Cc: stratum-dev at lists.stratumproject.org
Subject: Re: [stratum-dev] How to set log levels with -vmodule

External Email: Use caution in opening links or attachments.
According to this SO<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fa%2F45920794&data=04%7C01%7CNHESS%40extremenetworks.com%7Cb9989250f8ba4ef2fd2508d915a91318%7Cfc8c2bf6914d4c1fb35246a9adb87030%7C0%7C0%7C637564638183830756%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=QvP4lAYO6b2ucrIJQuTKG1AYOQE%2BLpv30qX6wm5Ayvo%3D&reserved=0> post the -vmodule parameter is based on the source code file name. So -vmodule=p4_service=2
should print all VLOG(2) and below messages. I don't see a way to limit ERROR/WARNING/INFO on a per-module
basis, though.

The BFRT code is an entire different topic as it uses its own logging library without any hooks for us. We're pretty much
limited to letting bfrt print to stdout. The current code enables logging of a few select modules:
But that happened on a as-needed basis without any major planing. Full integration will require code
changes on the SDE side to allow something like callbacks or streams. Feel free to lobby for that at Intel :D


On Wed, May 12, 2021 at 3:39 PM Narada Hess via stratum-dev <stratum-dev at lists.stratumproject.org<mailto:stratum-dev at lists.stratumproject.org>> wrote:
Hi All,
I have used -v=<level> successfully in the stratum flags file. But when I add -vmodule=<x=y>, it does not seem to take effect. What am I doing wrong?

Also, how do you set the log levels for the barefoot modules (as opposed to the stratum code per se)? Thanks, N

Separate examples:



stratum-dev mailing list
stratum-dev at lists.stratumproject.org<mailto:stratum-dev at lists.stratumproject.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.stratumproject.org/archives/stratum-dev/attachments/20210513/da9e6324/attachment.html>

More information about the stratum-dev mailing list