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

1 view
Skip to first unread message

Narada Hess

unread,
May 12, 2021, 6:39:40 PM5/12/21
to strat...@lists.stratumproject.org

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

 

Maximilian Pudelko

unread,
May 12, 2021, 8:49:49 PM5/12/21
to Narada Hess, strat...@lists.stratumproject.org
According to this SO 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


Max

_______________________________________________
stratum-dev mailing list
strat...@lists.stratumproject.org
https://lists.stratumproject.org/listinfo/stratum-dev

Narada Hess

unread,
May 13, 2021, 4:19:30 PM5/13/21
to Maximilian Pudelko, strat...@lists.stratumproject.org

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 <m...@opennetworking.org>
Sent: Wednesday, May 12, 2021 5:50 PM
To: Narada Hess <NH...@extremenetworks.com>
Cc: strat...@lists.stratumproject.org
Subject: Re: [stratum-dev] How to set log levels with -vmodule

 

External Email: Use caution in opening links or attachments.

Maximilian Pudelko

unread,
May 13, 2021, 4:36:41 PM5/13/21
to Narada Hess, strat...@lists.stratumproject.org
Thanks Narada for posting this example. It's exactly right.

Max

Reply all
Reply to author
Forward
0 new messages