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

Maximilian Pudelko max at opennetworking.org
Thu May 13 20:36:41 UTC 2021


Thanks Narada for posting this example. It's exactly right.

Max


On Thu, May 13, 2021 at 1:19 PM Narada Hess <NHESS at extremenetworks.com>
wrote:

> 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:
>
> -minloglevel=0
>
> -v=5
>
>
>
> 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:
>
>
> https://github.com/stratum/stratum/blob/main/stratum/hal/lib/barefoot/bf_sde_wrapper.cc#L1514-L1528
> <https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fstratum%2Fstratum%2Fblob%2Fmain%2Fstratum%2Fhal%2Flib%2Fbarefoot%2Fbf_sde_wrapper.cc%23L1514-L1528&data=04%7C01%7CNHESS%40extremenetworks.com%7Cb9989250f8ba4ef2fd2508d915a91318%7Cfc8c2bf6914d4c1fb35246a9adb87030%7C0%7C0%7C637564638183840751%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=%2Fy4Qydn9ND1c0WTVmMT0OCZcz3m82%2BXivD47E46umpM%3D&reserved=0>
>
> 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
>
>
>
>
>
> Max
>
>
>
> On Wed, May 12, 2021 at 3:39 PM Narada Hess via stratum-dev <
> 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:
>
> -v=5
>
> -vmodule=p4_service=0
>
>
>
> -v=5
>
> -vmodule=”p4_service=0”
>
>
>
> -v=5
>
> -vmodule=bfrt_*=0
>
>
>
> _______________________________________________
> stratum-dev mailing list
> stratum-dev at lists.stratumproject.org
> https://lists.stratumproject.org/listinfo/stratum-dev
> <https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.stratumproject.org%2Flistinfo%2Fstratum-dev&data=04%7C01%7CNHESS%40extremenetworks.com%7Cb9989250f8ba4ef2fd2508d915a91318%7Cfc8c2bf6914d4c1fb35246a9adb87030%7C0%7C0%7C637564638183850747%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=sb69FdhGVjcLpZvlIS4Q0bwtLCSX0X9dAt6Hg8DDR%2FY%3D&reserved=0>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.stratumproject.org/archives/stratum-dev/attachments/20210513/03744937/attachment-0001.html>


More information about the stratum-dev mailing list