<div><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><strong style="font-weight:normal;"><span style="background-color:transparent;color:#000000;font-family:arial;font-size:14.6667px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;">Hi everyone! I use Twisted 16.6.0 and wrote the following simple program:</span></strong></p> <p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><strong style="font-weight:normal;"><span style="background-color:transparent;color:#000000;font-family:arial;font-size:14.6667px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;">import sys</span></strong></p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><strong style="font-weight:normal;"><span style="background-color:transparent;color:#000000;font-family:arial;font-size:14.6667px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;">from twisted.logger import (Logger, textFileLogObserver)</span></strong></p> <p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><strong style="font-weight:normal;"><span style="background-color:transparent;color:#000000;font-family:arial;font-size:14.6667px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;">class MyClass:</span></strong></p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><strong style="font-weight:normal;"><span style="background-color:transparent;color:#000000;font-family:arial;font-size:14.6667px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;">   log = Logger(namespace = "ad_hoc", observer = textFileLogObserver(sys.stdout))</span></strong></p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><strong style="font-weight:normal;"><span style="background-color:transparent;color:#000000;font-family:arial;font-size:14.6667px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;">   def __init__(self):</span></strong></p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><strong style="font-weight:normal;"><span style="background-color:transparent;color:#000000;font-family:arial;font-size:14.6667px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;">       self.log.info("MyClass.__init__ called!")</span></strong></p> <p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><strong style="font-weight:normal;"><span style="background-color:transparent;color:#000000;font-family:arial;font-size:14.6667px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;">   def __del__(self):</span></strong></p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><strong style="font-weight:normal;"><span style="background-color:transparent;color:#000000;font-family:arial;font-size:14.6667px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;">       self.log.info("Bye!")</span></strong></p> <p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><strong style="font-weight:normal;"><span style="background-color:transparent;color:#000000;font-family:arial;font-size:14.6667px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;">obj = MyClass()</span></strong></p> <p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><strong style="font-weight:normal;"><span style="background-color:transparent;color:#000000;font-family:arial;font-size:14.6667px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;">I call it with Python 2.7.13:</span></strong></p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><strong style="font-weight:normal;"><span style="background-color:transparent;color:#000000;font-family:arial;font-size:14.6667px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;">python loggertest.py</span></strong></p> <p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><strong style="font-weight:normal;"><span style="background-color:transparent;color:#000000;font-family:arial;font-size:14.6667px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;">and get this output:</span></strong></p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><strong style="font-weight:normal;"><span style="background-color:transparent;color:#000000;font-family:arial;font-size:14.6667px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;">2017-01-20T12:25:18+0300 [__main__.MyClass#info] MyClass.__init__ called!</span></strong></p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><strong style="font-weight:normal;"><span style="background-color:transparent;color:#000000;font-family:arial;font-size:14.6667px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;">2017-01-20T12:25:18+0300 [__main__.MyClass#info] Bye!</span></strong></p> <p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><strong style="font-weight:normal;"><span style="background-color:transparent;color:#000000;font-family:arial;font-size:14.6667px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;">I expect the text between ‘[‘ and ‘#’ to be ‘ad_hoc’, but it is auto-generated name instead. Am I doing something wrong or this is a bug?</span></strong></p></div><div> </div><div>-- </div><div>Kind regards, Roman Mescheryakov</div><div> </div>