trace.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:Comparative-Annotation-Toolkit 作者: ComparativeGenomicsToolkit 项目源码 文件源码
def log(self, *args):
        """log arguments as a message followed by a newline"""
        # build string and output, as this minimize interleaved messages
        # discard output on I/O errors
        try:
            msg = []
            if self.inclPid:
                msg.append(str(os.getpid()))
                msg.append(": ")
            if self.inclThread:
                # can only include id, getting name will cause deadlock
                msg.append(str(threading._get_ident()))
                msg.append(": ")
            for a in args:
                msg.append(str(a))
            msg.append("\n")
            self.fh.write("".join(msg))
            self.fh.flush()
        except IOError as ex:
            pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号