Move all loggers to be members of the class, not global objects
This commit is contained in:
@ -6,7 +6,8 @@ from __future__ import (
|
||||
print_function,
|
||||
)
|
||||
|
||||
# --------------------------------------------
|
||||
import time
|
||||
import agentx
|
||||
import logging
|
||||
|
||||
|
||||
@ -15,17 +16,11 @@ class NullHandler(logging.Handler):
|
||||
pass
|
||||
|
||||
|
||||
logger = logging.getLogger('agentx.dataset')
|
||||
logger.addHandler(NullHandler())
|
||||
# --------------------------------------------
|
||||
|
||||
import time
|
||||
import agentx
|
||||
|
||||
|
||||
class DataSet():
|
||||
def __init__(self):
|
||||
self._data = {}
|
||||
self.logger = logging.getLogger('agentx.dataset')
|
||||
self.logger.addHandler(NullHandler())
|
||||
|
||||
def set(self, oid, oid_type, value):
|
||||
if oid_type.startswith('int'):
|
||||
@ -47,7 +42,7 @@ class DataSet():
|
||||
elif oid_type == 'counter64' or oid_type == 'uint64' or oid_type == 'u64':
|
||||
t = agentx.TYPE_COUNTER64
|
||||
else:
|
||||
logger.error('Invalid oid_type: %s' % (oid_type))
|
||||
self.logger.error('Invalid oid_type: %s' % (oid_type))
|
||||
return
|
||||
|
||||
self._data[oid] = {
|
||||
|
Reference in New Issue
Block a user