Package rrlog :: Package server :: Class RotateLogWriter
[hide private]
[frames] | no frames]

Class RotateLogWriter

source code

object --+
         |
        RotateLogWriter

Assigned to a list of LogWriters, rotates by creating a new one each time when a line count is exceeded. Maintains a history of old writers.

Instance Methods [hide private]
 
__init__(self, getNextWriter, rotateLineMin)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_rotate(self)
Not threadsafe.
source code
 
writeNow(self, job)
Write without buffering, return when written
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Instance Variables [hide private]
  writers
History of writers, current at [-1], oldest at [0].
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, getNextWriter, rotateLineMin)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • getNextWriter - Callable that takes a list (history) of previous writers, and returns the next logWriter to use
  • rotateLineMin - rotate when ~ lines are written
Overrides: object.__init__

_rotate(self)

source code 

Not threadsafe. Maintains the history (self.writers). A new writer is appended.. removes the oldest writer [0] if self._writer count is longer than self._configs.


Instance Variable Details [hide private]

writers

History of writers, current at [-1], oldest at [0]. Only writers with an existing (i.e.not already overwritten) table/file are available. (Migration note: This is analogous to the getWriteHistory() of version 0.1.1 but the order is ascending.)