Package twisted :: Package python :: Module logfile :: Class LogFile

[show private | hide private]
[frames | no frames]

## Class LogFile

    BaseLogFile --+
                  |
                 LogFile

A log file that can be rotated.

A rotateLength of None disables automatic log rotation.

Method Summary
| `__init__(self, name, directory, rotateLength, defaultMode)`
| `__getstate__(self)`
| ``__hook_orig_twisted_python_logfile_LogFile_rotate__`(self)` Rotate the file and create a new one.
| ``__hook_orig_twisted_python_logfile_LogFile_write__`(self, data)` Write some data to the file
| `__setstate__(self, state)` (inherited from `BaseLogFile`)
| ``close`(self)` Close the file. (inherited from `BaseLogFile`)
| ``flush`(self)` Flush the file. (inherited from `BaseLogFile`)
| ``getCurrentLog`(self)` Return a LogReader for the current log file. (inherited from `BaseLogFile`)
| ``getLog`(self, identifier)` Given an integer, return a LogReader for an old log file.
| ``listLogs`(self)` Return sorted list of integers - the old logs' identifiers.
| `rotate(*args, **kw)`
| ``shouldRotate`(self)` Rotate when the log file size is larger than rotateLength
| `write(*args, **kw)`
| ``_openFile`(self)` Open the log file.

Class Variable Summary
`list` | `__hook_post_twisted_python_logfile_LogFile_rotate__`
`list` | `__hook_post_twisted_python_logfile_LogFile_write__`
`list` | `__hook_pre_twisted_python_logfile_LogFile_rotate__`
`list` | `__hook_pre_twisted_python_logfile_LogFile_write__`

Method Details

### __hook_orig_twisted_python_logfile_LogFile_rotate__(self)

Rotate the file and create a new one.

If it's not possible to open new logfile, this will fail silently, and continue logging to old logfile.

### __hook_orig_twisted_python_logfile_LogFile_write__(self, data)

Write some data to the file

### getLog(self, identifier)

Given an integer, return a LogReader for an old log file.

### listLogs(self)

Return sorted list of integers - the old logs' identifiers.

### shouldRotate(self)

Rotate when the log file size is larger than rotateLength

### _openFile(self)

Open the log file.

  Overrides:
    `twisted.python.logfile.BaseLogFile._openFile` (inherited documentation)

Class Variable Details

### __hook_post_twisted_python_logfile_LogFile_rotate__

  Type:
    `list`
  Value:

        [<function _synchPost at 0x81aead4>]

### __hook_post_twisted_python_logfile_LogFile_write__

  Type:
    `list`
  Value:

        [<function _synchPost at 0x81aead4>]

### __hook_pre_twisted_python_logfile_LogFile_rotate__

  Type:
    `list`
  Value:

        [<function _synchPre at 0x81aea9c>]

### __hook_pre_twisted_python_logfile_LogFile_write__

  Type:
    `list`
  Value:

        [<function _synchPre at 0x81aea9c>]

Generated by Epydoc 1.1 on Thu May 8 13:18:56 2003 | http://epydoc.sf.net