Bug 1057056 - Set __doc__ attribute of decorated structured logger methods. r=jgraham
authorChris Manchester <cmanchester@mozilla.com>
Mon, 25 Aug 2014 11:16:50 -0400
changeset 223602 678b8dbcc0f6b6ba92c2e0ae0265856ad0e17c86
parent 223601 a55aa9792ca6c205ffcfef87721b0676c9382c6d
child 223603 2864580f60b812cef8be554ec50b371d804ddf7b
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgraham
bugs1057056
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1057056 - Set __doc__ attribute of decorated structured logger methods. r=jgraham
testing/mozbase/mozlog/mozlog/structured/logtypes.py
--- a/testing/mozbase/mozlog/mozlog/structured/logtypes.py
+++ b/testing/mozbase/mozlog/mozlog/structured/logtypes.py
@@ -41,16 +41,19 @@ class log_action(object):
     def __call__(self, f):
         convertor_registry[f.__name__] = self
         converter = self
 
         def inner(self, *args, **kwargs):
             data = converter.convert(*args, **kwargs)
             return f(self, data)
 
+        if hasattr(f, '__doc__'):
+            setattr(inner, '__doc__', f.__doc__)
+
         return inner
 
     def convert(self, *args, **kwargs):
         data = {}
         values = {}
         values.update(kwargs)
 
         positional_no_default = [item for item in self.args_no_default if item not in values]