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:
Pim van Pelt
2023-01-10 15:21:32 +01:00
parent 0d7dea37f5
commit 31529a2815
3 changed files with 14 additions and 4 deletions

View File

@ -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)