improvement: add flag for agentx debugging
agentx/network.py always turned on debugging. It can be useful to have debugging logs of the main application without the agentx debug logs, as they are quite noisy. Now, ./vpp-snmp-agent.py -d will turn on application debugging but NOT agentx debugging. ./vpp-snmp-agent.py -d -dd will turn on both. NOTE: ./vpp-snmp-agent.py -dd will do nothing, because the '-d' flag determines the global logging level.
This commit is contained in:
@ -388,10 +388,16 @@ def main():
|
||||
parser.add_argument(
|
||||
"-d", dest="debug", action="store_true", help="""Enable debug, default False"""
|
||||
)
|
||||
parser.add_argument(
|
||||
"-dd",
|
||||
dest="debug_agent",
|
||||
action="store_true",
|
||||
help="""Enable agentx debug, default False""",
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
if args.debug:
|
||||
print("Arguments:", args)
|
||||
print(f"Arguments: {args}")
|
||||
|
||||
agentx.setup_logging(debug=args.debug)
|
||||
|
||||
|
Reference in New Issue
Block a user