Logger — IPython 0.10.2 documentation

### Navigation

- index
- modules |
- next |
- previous |
- IPython 0.10.2 documentation »
- The IPython API »

# Logger

## Module: `Logger`

Inheritance diagram for `IPython.Logger`:

Logger class for IPython’s logging facilities.

## `Logger`

class `IPython.Logger.` `Logger`(shell, logfname='Logger.log', loghead='', logmode='over')

  Bases: `object`

  A Logfile class with different policies for file creation

  `__init__`()
  `close_log`()

    Fully stop logging and close log file.

    In order to start logging again, a new logstart() call needs to be made, possibly (though not necessarily) with a new filename, mode and other options.

  `log`()

    Write the line to a log and create input cache variables _i*.

    Inputs:

    - line_ori: unmodified input line from the user. This is not

    necessarily valid Python.

    - line_mod: possibly modified input, such as the transformations made

    by input prefilters or input handlers of various kinds. This should always be valid Python.

    - continuation: if True, indicates this is part of multi-line input.
  `log_write`()

    Write data to the log file, if active

  `logmode`
  `logstart`()

    Generate a new log-file with a default header.

    Raises RuntimeError if the log has already been started

  `logstate`()

    Print a status message about the logger.

  `logstop`()

    Fully stop logging and close log file.

    In order to start logging again, a new logstart() call needs to be made, possibly (though not necessarily) with a new filename, mode and other options.

  `switch_log`()

    Switch logging on/off. val should be ONLY a boolean.

### Navigation

- index
- modules |
- next |
- previous |
- IPython 0.10.2 documentation »
- The IPython API »