summaryrefslogtreecommitdiff
path: root/service/twisted/plugins/logger.py
blob: 6503bb13e5b5cd3584076cec7c58e1083b26c335 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import gc
import sys

from zope.interface import implementer
from twisted.plugin import IPlugin
from pixelated.support.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()