Browse Source

[1512] added note about overhead tradeoff for the formatter classes.

JINMEI Tatuya 13 years ago
parent
commit
be4044ab9c
1 changed files with 10 additions and 0 deletions
  1. 10 0
      src/lib/python/isc/ddns/logger.py

+ 10 - 0
src/lib/python/isc/ddns/logger.py

@@ -37,6 +37,13 @@ class ClientFormatter:
     message is suppressed because of its log level (which is often the case
     message is suppressed because of its log level (which is often the case
     for debug messages).
     for debug messages).
 
 
+    Note: this optimization comes with the cost of instantiating the
+    formatter object itself.  It's not really clear which overhead is
+    heavier, and we may conclude it's actually better to just generate
+    the strings unconditionally.  Alternatively, we can make the stored
+    address of this object replaceable so that this object can be reused.
+    Right now this is an open issue.
+
     """
     """
     def __init__(self, addr):
     def __init__(self, addr):
         self.__addr = addr
         self.__addr = addr
@@ -66,6 +73,9 @@ class ZoneFormatter:
     message is suppressed because of its log level (which is often the case
     message is suppressed because of its log level (which is often the case
     for debug messages).
     for debug messages).
 
 
+    See the note for the ClientFormatter class about overhead tradeoff.
+    This class shares the same discussion.
+
     """
     """
     def __init__(self, zname, zclass):
     def __init__(self, zname, zclass):
         self.__zname = zname
         self.__zname = zname