Improve logging in dictionary
This commit is contained in:
@@ -194,8 +194,10 @@ class Dictionary:
|
|||||||
for line_num, tokens in reader:
|
for line_num, tokens in reader:
|
||||||
key = tokens[0]
|
key = tokens[0]
|
||||||
if key == "ATTRIBUTE":
|
if key == "ATTRIBUTE":
|
||||||
|
# logging is done within the method
|
||||||
self._parse_attribute(tokens, line_num)
|
self._parse_attribute(tokens, line_num)
|
||||||
elif key == "VALUE":
|
elif key == "VALUE":
|
||||||
|
# logging is done within the method
|
||||||
self._parse_value(tokens, line_num)
|
self._parse_value(tokens, line_num)
|
||||||
elif key == "FILE_OPENED":
|
elif key == "FILE_OPENED":
|
||||||
LOG.info("Parsing file: %s", tokens[1])
|
LOG.info("Parsing file: %s", tokens[1])
|
||||||
@@ -209,10 +211,13 @@ class Dictionary:
|
|||||||
LOG.info("Finished parsing file: %s", filename)
|
LOG.info("Finished parsing file: %s", filename)
|
||||||
elif key == "VENDOR":
|
elif key == "VENDOR":
|
||||||
self._parse_vendor(tokens, line_num)
|
self._parse_vendor(tokens, line_num)
|
||||||
|
LOG.info("Register vendor %s", tokens[1])
|
||||||
elif key == "BEGIN-VENDOR":
|
elif key == "BEGIN-VENDOR":
|
||||||
self._parse_begin_vendor(tokens, line_num)
|
self._parse_begin_vendor(tokens, line_num)
|
||||||
|
LOG.info("Open Vendor section %s", tokens[1])
|
||||||
elif key == "END-VENDOR":
|
elif key == "END-VENDOR":
|
||||||
self._parse_end_vendor(tokens, line_num)
|
self._parse_end_vendor(tokens, line_num)
|
||||||
|
LOG.info("Close Vendor section %s", tokens[1])
|
||||||
elif key == "BEGIN-TLV":
|
elif key == "BEGIN-TLV":
|
||||||
raise NotImplementedError(
|
raise NotImplementedError(
|
||||||
"BEGIN-TLV is deprecated and not supported by pyrad3"
|
"BEGIN-TLV is deprecated and not supported by pyrad3"
|
||||||
@@ -455,6 +460,13 @@ class Dictionary:
|
|||||||
|
|
||||||
if self.cur_vendor != self.rfc_vendor:
|
if self.cur_vendor != self.rfc_vendor:
|
||||||
codes = [26, self.cur_vendor.code] + codes
|
codes = [26, self.cur_vendor.code] + codes
|
||||||
|
LOG.info(
|
||||||
|
"Register Attribute %s for Vendor %s",
|
||||||
|
attribute.name,
|
||||||
|
self.cur_vendor.name,
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
LOG.info("Register Attribute %s", attribute.name)
|
||||||
attrcode = codes[0] if len(codes) == 1 else tuple(codes)
|
attrcode = codes[0] if len(codes) == 1 else tuple(codes)
|
||||||
self.attrindex[attrcode] = attribute
|
self.attrindex[attrcode] = attribute
|
||||||
self.attrindex[name] = attribute
|
self.attrindex[name] = attribute
|
||||||
|
|||||||
Reference in New Issue
Block a user