logging_api.py 文件源码

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

项目:integration-prototype 作者: SKA-ScienceDataProcessor 项目源码 文件源码
def __init__(self, name, level, pathname, lineno, msg, args,
                 exc_info, func=None, sinfo=None):
        """Constructs a SIP logging record.

        A more detailed description of arguments can be found here:
        https://docs.python.org/3.5/library/logging.html#logrecord-objects

        Args:
            name: The name of the logger.
            level: Numeric level of the logging event.
            pathname: The full pathname of the source file where the logging
                      call was made.
            lineno: Line number of the logging call.
            msg: The event description message, possibly a format string.
            args: Variable data to merge into the msg arguement to obtain
                  the event description.
            exc_info: An exception tupple with the current exception info or
                      None
            func: The name of the function from which the logging call was
                  invoked.
            sinfo: A text string representing the stack info in the current
                   thread up to the logging call.
            kwargs:
        """
        logging.LogRecord.__init__(self, name, level, pathname, lineno,
                                   msg, args, exc_info, func, sinfo)
        # Note: Can also access the following variables via the formatter as:
        #   %(hostname)s
        #   %(username)s
        #   %(origin)s
        #   %(time)s
        self.hostname = socket.gethostname()
        self.username = getpass.getuser()
        self.origin = '{}.{}:{}'.format(self.module, self.funcName, self.lineno)
        self.time = datetime.datetime.utcnow().isoformat()
        self._raw = self.__dict__.copy()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号