diff options
author | Roald de Vries <rdevries@thoughtworks.com> | 2016-09-21 12:54:26 +0200 |
---|---|---|
committer | Roald de Vries <rdevries@thoughtworks.com> | 2016-09-21 14:43:32 +0200 |
commit | 9d7eaf2b7c527cf05b8b0f7acbd46dbc5483f09f (patch) | |
tree | 7cd24264ef65543514c6c7c4862a93d4b71e8c1e /service/twisted | |
parent | 108a31229e7f98c9c5743198e95332b5f869af9b (diff) |
add a first plugin
Diffstat (limited to 'service/twisted')
-rw-r--r-- | service/twisted/plugins/logger.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/service/twisted/plugins/logger.py b/service/twisted/plugins/logger.py new file mode 100644 index 00000000..b466d015 --- /dev/null +++ b/service/twisted/plugins/logger.py @@ -0,0 +1,15 @@ +import gc +import sys + +from zope.interface import implementer +from twisted.plugin import IPlugin +from loglinegenerator import ILogLineGenerator + + +@implementer(IPlugin, ILogLineGenerator) +class GCLogger(): + def getLogLine(self): + return '%010d' % sum(sys.getsizeof(o) for o in gc.get_objects()) + + +gcLogger = GCLogger() |