Lines Matching refs:record
65 def emit(self, record):
67 Emit a record.
69 Output the record to the file, catering for rollover as described
73 if self.shouldRollover(record):
75 logging.FileHandler.emit(self, record)
77 self.handleError(record)
183 def shouldRollover(self, record):
187 Basically, see if the supplied record would cause the file to exceed
196 msg = "%s\n" % self.format(record)
344 def shouldRollover(self, record):
348 record is not used, as we are just comparing times, but it is needed so
518 def emit(self, record):
520 Emit a record.
523 record to it.
526 logging.FileHandler.emit(self, record)
538 To unpickle the record at the receiving end into a LogRecord, use the
631 def makePickle(self, record):
633 Pickles the record in binary format with a length prefix, and
636 ei = record.exc_info
638 # just to get traceback text into record.exc_text ...
639 dummy = self.format(record)
643 d = dict(record.__dict__)
644 d['msg'] = record.getMessage()
653 def handleError(self, record):
665 logging.Handler.handleError(self, record)
667 def emit(self, record):
669 Emit a record.
671 Pickles the record and writes it to the socket in binary format.
677 s = self.makePickle(record)
680 self.handleError(record)
703 To unpickle the record at the receiving end into a LogRecord, use the
979 def emit(self, record):
981 Emit a record.
983 The record is formatted, and then sent to the syslog server. If
987 msg = self.format(record)
993 # We need to convert record level to lowercase, maybe this will
996 self.mapPriority(record.levelname))
1017 self.handleError(record)
1058 def getSubject(self, record):
1062 If you want to specify a subject line which is record-dependent,
1067 def emit(self, record):
1069 Emit a record.
1071 Format the record and send it to the specified addressees.
1085 msg['Subject'] = self.getSubject(record)
1087 msg.set_content(self.format(record))
1097 self.handleError(record)
1144 def getMessageID(self, record):
1146 Return the message ID for the event record. If you are using your
1154 def getEventCategory(self, record):
1156 Return the event category for the record.
1163 def getEventType(self, record):
1165 Return the event type for the record.
1174 return self.typemap.get(record.levelno, self.deftype)
1176 def emit(self, record):
1178 Emit a record.
1185 id = self.getMessageID(record)
1186 cat = self.getEventCategory(record)
1187 type = self.getEventType(record)
1188 msg = self.format(record)
1191 self.handleError(record)
1231 def mapLogRecord(self, record):
1233 Default implementation of mapping the log record into a dict
1237 return record.__dict__
1253 def emit(self, record):
1255 Emit a record.
1257 Send the record to the web server as a percent-encoded dictionary
1264 data = urllib.parse.urlencode(self.mapLogRecord(record))
1294 self.handleError(record)
1299 record is added to the buffer, a check is made to see if the buffer should
1310 def shouldFlush(self, record):
1319 def emit(self, record):
1321 Emit a record.
1323 Append the record. If shouldFlush() tells us to, call flush() to process
1326 self.buffer.append(record)
1327 if self.shouldFlush(record):
1379 def shouldFlush(self, record):
1381 Check for buffer full or a record at the flushLevel or higher.
1384 (record.levelno >= self.flushLevel)
1402 The record buffer is also cleared by this operation.
1407 for record in self.buffer:
1408 self.target.handle(record)
1448 def enqueue(self, record):
1450 Enqueue a record.
1456 self.queue.put_nowait(record)
1458 def prepare(self, record):
1460 Prepare a record for queuing. The object returned by this method is
1463 The base implementation formats the record to merge the message and
1464 arguments, and removes unpickleable items from the record in-place.
1465 Specifically, it overwrites the record's `msg` and
1471 the record to a dict or JSON string, or send a modified copy
1472 of the record while leaving the original intact.
1474 # The format operation gets traceback text into record.exc_text
1480 msg = self.format(record)
1481 # bpo-35726: make copy of record to avoid affecting other handlers in the chain.
1482 record = copy.copy(record)
1483 record.message = msg
1484 record.msg = msg
1485 record.args = None
1486 record.exc_info = None
1487 record.exc_text = None
1488 record.stack_info = None
1489 return record
1491 def emit(self, record):
1493 Emit a record.
1498 self.enqueue(self.prepare(record))
1500 self.handleError(record)
1523 Dequeue a record and return it, optionally blocking.
1541 def prepare(self, record):
1543 Prepare a record for handling.
1545 This method just returns the passed-in record. You may want to
1547 manipulation of the record before passing it to the handlers.
1549 return record
1551 def handle(self, record):
1553 Handle a record.
1555 This just loops through the handlers offering them the record
1558 record = self.prepare(record)
1563 process = record.levelno >= handler.level
1565 handler.handle(record)
1579 record = self.dequeue(True)
1580 if record is self._sentinel:
1584 self.handle(record)
1592 This is used to enqueue the sentinel record.