web/contentment/util/logging.py
def emit(self, record):
		"""Inserting new logging record to mongo database."""
		
		try:
			document = self.format(record)
		except:
			self.handleError(record)
		
		try:
			document.save(force_insert=True, validate=False, write_concern=self.concern)
			
			if self.buffer:
				Log.objects.insert(self.buffer, load_bulk=False, write_concern=self.concern)
				self.buffer = None  # Disable buffering of messages after startup.
		
		except (PyMongoError, OperationError, NotUniqueError, ValidationError):
			if self.buffer is None:  # Buffering is disabled.
				self.handleError(record)
			
			# During startup there might not be a DB connection yet, so we buffer messages until at least one can be
			# written, then we dump the buffer.
			self.buffer.append(document)
Inserting new logging record to mongo database.
Inserting new logging record to mongo database.
Inserting new logging record to mongo database .
def emit(self, record):
		try:
			document = self.format(record)
		except:
			self.handleError(record)
		try:
			document.save(force_insert=True, validate=False, write_concern=self.concern)
			if self.buffer:
				Log.objects.insert(self.buffer, load_bulk=False, write_concern=self.concern)
				self.buffer = None  
		except (PyMongoError, OperationError, NotUniqueError, ValidationError):
			if self.buffer is None:  
				self.handleError(record)
			self.buffer.append(document)
def emit ( self , record ) : try : document = self . format ( record ) except : self . handleError ( record ) try : document . save ( force_insert = True , validate = False , write_concern = self . concern ) if self . buffer : Log . objects . insert ( self . buffer , load_bulk = False , write_concern = self . concern ) self . buffer = None except ( PyMongoError , OperationError , NotUniqueError , ValidationError ) : if self . buffer is None : self . handleError ( record ) self . buffer . append ( document )
Inserting new logging record to mongo database.
Inserting new logging record to mongo database .
"""Inserting new logging record to mongo database.""" # Disable buffering of messages after startup. # Buffering is disabled. # During startup there might not be a DB connection yet, so we buffer messages until at least one can be # written, then we dump the buffer.
self
record