当前位置: 首页>>代码示例>>Python>>正文


Python base.LogRecord类代码示例

本文整理汇总了Python中logbook.base.LogRecord的典型用法代码示例。如果您正苦于以下问题:Python LogRecord类的具体用法?Python LogRecord怎么用?Python LogRecord使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了LogRecord类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: log

 def log(self, tags, msg, *args, **kwargs):
     if isinstance(tags, basestring):
         tags = [tags]
     exc_info = kwargs.pop('exc_info', None)
     extra = kwargs.pop('extra', {})
     extra['tags'] = list(tags)
     record = LogRecord(self.name, NOTSET, msg, args, kwargs, exc_info,
                        extra, sys._getframe(), self)
     try:
         self.handle(record)
     finally:
         record.close()
开发者ID:EnTeQuAk,项目名称:logbook,代码行数:12,代码来源:more.py

示例2: recv

 def recv(self, timeout=None):
     if timeout is None:
         rv = self.queue.get()
     else:
         try:
             rv = self.queue.get(block=False, timeout=timeout)
         except Empty:
             return None
     return LogRecord.from_dict(rv)
开发者ID:agustinhenze,项目名称:logbook.debian,代码行数:9,代码来源:queues.py

示例3: recv

 def recv(self, timeout=None):
     """Receives a single record from the socket.  Timeout of 0 means nonblocking,
     `None` means blocking and otherwise it's a timeout in seconds after which
     the function just returns with `None`.
     """
     if timeout is None:
         rv = self.socket.recv()
     elif not timeout:
         rv = self.socket.recv(self._zmq.NOBLOCK)
         if rv is None:
             return
     else:
         if not self._zmq.select([self.socket], [], [], timeout)[0]:
             return
         rv = self.socket.recv(self._zmq.NOBLOCK)
     return LogRecord.from_dict(json.loads(rv))
开发者ID:fayazkhan,项目名称:logbook,代码行数:16,代码来源:queues.py

示例4: recv

 def recv(self, timeout=None):
     """Overwrite standard recv for timeout calls to catch interrupt errors.
     """
     if timeout:
         try:
             testsock = self._zmq.select([self.socket], [], [], timeout)[0]
         except zmq.ZMQError as e:
             if e.errno == errno.EINTR:
                 testsock = None
             else:
                 raise
         if not testsock:
             return
         rv = self.socket.recv(self._zmq.NOBLOCK)
         return LogRecord.from_dict(json.loads(rv))
     else:
         return super(ZeroMQPullSubscriber, self).recv(timeout)
开发者ID:Galithil,项目名称:bcbio-nextgen,代码行数:17,代码来源:logbook_zmqpush.py


注:本文中的logbook.base.LogRecord类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。