Unverified Commit 7d20537e authored by Ximin Luo's avatar Ximin Luo
Browse files

add a method to output debug data

parent 1b61d20d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ def get_env(key, validate=env_has_k):
    try:
        return validate(key, os.getenv(key))
    except Exception, e:
        raise EnvError(cause=e)
        raise EnvError("error parsing env-var: %s: %s" % (key, e), e)

class EnvError(Exception):
    """
+11 −1
Original line number Diff line number Diff line
@@ -108,11 +108,21 @@ class TransportPlugin(object):

    def reportMethodsEnd(self):
        """
        Write a message to stdout announcing that we finished launching transports..
        Write a message to stdout announcing that we finished launching transports.
        """

        self.emit('%sS DONE' % self.methodName)

    def getDebugData(self):
        """
        Return a dict containing internal data in arbitrary format, for debugging.
        The data should only be presented and not processed further.
        """
        d = dict(self.__dict__)
        d["config"] = dict(self.config.__dict__)
        d["__class__"] = self.__class__
        return d

    def emit(self, msg):
        """
        Announce a message.