Package twisted :: Package python :: Module log

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

## Module twisted.python.log

twisted.log: Logfile and multi-threaded file support.

Classes
`Log` | This will create a Log file (intended to be written to with 'print', but usable from anywhere that a file is) from a file.
`Logger` | This represents a class which may 'own' a log.
`LogOwner` | Allow object to register themselves as owners of the log.
`NullFile` |
`Output` | This represents a class which traps output.
`ThreadedLogOwner` | Allow object to register themselves as owners of the log, per thread.

Function Summary
| ``startLogging`(file, setStdout)` Initialize logging to a specified file.
| `msg(*stuff)`
| ``write`(stuff)` Write some data to the log.
| `clearIgnores()`
| ``debug`(*stuff)` Write some data to the log, indented, so it's easier to distinguish from 'normal' output.
| ``deferr`()` Write the default failure (the current exception) to the log.
| ``discardLogs`()` Throw away all logs.
| ``err`(stuff)` Write a failure to the log.
| ``flushErrors`(*errorTypes)` Support function for testing frameworks.
| `ignoreErrors(*types)`
| `indent(s)`
| `initThreads()`
| `output(func, *args, **kw)`
| ``real_msg`(*stuff)` Write some data to the log (a linebreak will be appended).
| `showwarning(message, category, filename, lineno, file)`
| ``startKeepingErrors`()` Support function for testing frameworks.
| `_log_output(func, *args, **kw)`
| `_no_log_output(func, *args, **kw)`
| `_threaded_msg(*stuff)`

Variable Summary
`ThreadedLogOwner` | `logOwner`
`list` | `file_protocol`
`file` | `logerr`
`NullFile` | `logfile`
`lock` | `loglock`
`list` | `_ignoreErrors`
`int` | `_keepErrors`
`list` | `_keptErrors`

Function Details

### debug(*stuff)

Write some data to the log, indented, so it's easier to distinguish from 'normal' output.

### deferr()

Write the default failure (the current exception) to the log.

### discardLogs()

Throw away all logs.

### err(stuff)

Write a failure to the log.

### flushErrors(*errorTypes)

Support function for testing frameworks.

Return a list of errors that occurred since the last call to flushErrors(). (This will return None unless startKeepingErrors has been called.)

### real_msg(*stuff)

Write some data to the log (a linebreak will be appended).

### startKeepingErrors()

Support function for testing frameworks.

Start keeping errors in a buffer which can be retrieved (and emptied) with flushErrors.

### startLogging(file, setStdout=1)

Initialize logging to a specified file.

### write(stuff)

Write some data to the log.

Variable Details

### file_protocol

  Type:
    `list`
  Value:

        ['close',
         'closed',
         'fileno',
         'flush',
         'mode',
         'name',
         'read',
         'readline',
        ...

### logerr

  Type:
    `file`
  Value:

        <open file '<stderr>', mode 'w' at 0x80cd130>

### logfile

  Type:
    `NullFile`
  Value:

        <twisted.python.log.NullFile instance at 0x81f17d4>

### loglock

  Type:
    `lock`
  Value:

        <lock object at 0x8356000>

### logOwner

  Type:
    `ThreadedLogOwner`
  Value:

        <twisted.python.log.ThreadedLogOwner instance at 0x85209fc>

### _ignoreErrors

  Type:
    `list`
  Value:

        []

### _keepErrors

  Type:
    `int`
  Value:

        1

### _keptErrors

  Type:
    `list`
  Value:

        []

Generated by Epydoc 1.1 on Sat Feb 15 21:19:16 2003 | http://epydoc.sf.net