Move all loggers to be members of the class, not global objects

This commit is contained in:
Pim van Pelt
2021-09-12 16:08:35 +00:00
parent 9265e211e3
commit 7206d92f40
5 changed files with 57 additions and 79 deletions

View File

@ -9,7 +9,7 @@ class MyAgent(agentx.Agent):
def setup(self):
global vppstat, vpp, logger
self.logger.info("Connecting to VPP Stats...")
self.logger.info("Connecting to VPP Stats Segment")
vppstat = VPPStats(socketname='/run/vpp/stats.sock', timeout=2)
if not vppstat.connect():
self.logger.error("Can't connect to VPP Stats API, bailing")